Its time once again for my yearly forced vacation.

So I have some time to read/respond to some great emails from readers!

Dear ERV–
I am just a random reader of your blog and several other science blogs. I’m sorry to bother you with this, but your contact me page was written in lolcat so I figured you couldn’t be too bad, right? :) Feel free to pose this to your readers, forward it, or garbage it- I’m sure your busy but really I’m just kinda lost right now…

So, brief about me..I’m in my late 20s and having a “mid-20s crisis” a few years too late. When I was a teenager right out of high school money was tight and I was left by myself to care for a severely disabled mother (no other family). I sort of wanted to get into science, biology was always my favorite, but for reasons I will explain in a minute, lost out to computer science/ web programming. But I didn’t even get time to study that until 4 years ago, when I finally put my mother in a nursing home and concentrated on bettering myself. So for these last 4 years I’ve just blindly been studying computers and doing IT work. I’m finally going to get my associates degree (a 2 year takes a while 2 classes at a time..) and I’m scheduled to go start work on my bachelors in comp sci with a minor in biology. The school I’ve picked out is almost completely online but they only offer minors in biology, not majors.

Sometimes I feel like I should be majoring in biology at an “in person” college instead of minoring online. But:
1- I’ve got this computer degree. Should I just completely throw it away and have wasted these years?
2- I’m afraid to go to an in-person school because if I lose my current night job then I’ll have trouble finding another job I can do while going to school. And I want to get off night shift anyway.
3- I hear research positions pay low and aren’t good for people who want to start a family. (That’s another thing..I’m married, husband has a low paying job, and we want kids but I grew up poor and will not have them until I am sure I can afford them. And my biological clock is ticking louder now.) But I don’t really even know enough about biology careers to know where to go to figure all this out.

The short version of all this is is that I think I want to change to biology, but I don’t want to start over just to find out I picked a bad major again or will end up poor. The last thing I should mention is why I originally did not pick biology as my major (besides the money thing) : I could never kill an animal. I know that genetics researchers are doing wonderful things and that often the only way to do that is to sacrifice animals for research, but I just couldn’t do it. If it’s already dead, sure, I can dissect it. But anything that requires euthanasia (Vet school) or killing an animal for research is out.

Again, I know I should probably be asking someone else this, but I really don’t know who “someone else” is. And I’d just go to the biology dept. at my community college or ask an advisor at my comm. coll, but the advising dept is not very good at my comm college and I don’t know the biology faculty. Any links, advice, anything you could provide would be so appreciated. Thank you very much for taking the time to read this.


Dear reader–

The only comp sci experience I have is when I learned BASIC in 3rd grade. BUT, I dont really see a reason you need to change anything. A biology/comp science duo is pretty much one of the best academic combos possible. Its the peanut butter and chocolate of academic combos. Bill Gates once called biology and comp science ‘sister sciences‘ because they fit together so perfectly in todays research world.

I dont think you should be worried about specializing in comp science and ‘only’ having online bio courses. Those bio courses still teach you the basics of biology– terms and ideas that will make it easier to pick up whatever project you work on at a future job. I dont think ‘real life’ bio courses would be absolutely necessary to get into biology from a comp science angle. I dont think you need to ‘start over’ and get a bio degree at a four-year-uni.

There are soooooo many labs out there that mesh computer science with genetics and evolution and protein structures and such– we have an entire field for this called ‘bioinformatics‘. They will want you for your computer skillz, not your mouse dissecting skillz, and will make sure you know the bio you need to get the job done. Jobs in research arent particularly well paid, considering the education and work hours (if youre getting a PhD in biology for the money, youre an idiot), but tech positions really arent that bad if you dont want to get a Masters/PhD. I was a tech for a couple of years after college, and sure you arent raking it in, but youre paid okay and have great health care and such.

There are alternatives to straight research, too. EVERYTHING I do in the lab requires a piece of equipment with specialized software for analyzing the data that comes out of the equipment. Someone has to make those computer programs. Someone has to improve those computer programs after users bitch about the layout or features we need. Someone has to help ar tards like me use the programs when our go-to-method of ‘mashing keys’ and ‘randomly clicking shit’ doesnt work. And these companies would offer more of the ‘traditional’ job normal people get.

So, actually, I think you are in a perfectly fine position, you just need someone to point you towards the cool shit you can do with computer science in biology! Youre right, Im not the best person to ask about this, but maybe readers have some ideas/links?

Comments

  1. #1 BeamStalk
    May 26, 2010

    I have an AA in Comp Sci and a BS in MIS. I have had the same crisis lately. I find I just don’t like the work I am currently doing with my degree. I am thinking of going back for my geology degree like I almost got in the first place but was talked out of by my parents.

    I think you have the best idea for him, look at making the programs for biology related software.

  2. #2 Jesse
    May 26, 2010

    Take this from somebody who knows a bit about pattern recognition. If you really, really want to go into bioinformatics, take not only computer science, but lots and lots of math. Then some more math. Linear algebra and applied matrix theory are a must. Math is good for you. Math will make you a much better programmer.

    More mathematics needs to be developed in the area of tensors as it applies to comoments about the mean with order >=3. Or at least I think it does, because I cannot find any references to operations that are analogous to what can be done with covariance matrices. (Problem there is that even Einstein had a bit of trouble with tensors.)

  3. #3 Gabriel Hanna
    May 26, 2010

    WOW! Is this “Ask Abbie” day? Is it only just today?

    You should do this more often. That would be fun.

    Computer science is good for a lot of things. I got my master’s doing computational physics. I had to unlearn some things I learned in the programming classes I’d taken for the sake of efficiency. You learn to avoid square roots, conditional statements, and the like. Try to keep the computer busy with adding things to other things.

    Anyway, a computer science background could really have helped.

  4. #4 KemaTheAtheist
    May 26, 2010

    I think I can contribute a lot here.

    I’ll preface this first though: if you don’t care one mite about my background, just skip down to the row of stars for the actual advice from a guy who planned one thing, ended up with a degree in CompSci, and is now half-way through gradschool for a Master’s in CompSci with a concentration in Bioinformatics.

    I’m not in a similar situation life-wise with kids and such, but I did get into a similar situation academically.

    I had a plan layed out for what I wanted to do, and everything fell through on a technically (stupid DoDMERB) that basically left me with going to my “back-up” school and with no idea what I wanted to do with my life, so I asked myself. What am I good at?

    I logically came to the conclusion “computers” so I decided to go into Comp Sci. I found out later I enjoyed biology a LOT more, but figured it was too late to change majors because I was only 2 semesters away from graduating.

    I got my degree in comp sci, starting working, and I was bored most of the time. I found out that Lockheed (where I work) has an excellent academic reimbursement program, so I decided to go to grad school to make more money. While researching universities in the area, I found that a Master’s program for Computer Science that offered a concentration in Bioinformatics.

    I nearly exploded in my seat. I didn’t even know what Bioinformatics was, but that “bio” was the most beautiful prefix I’ve ever seen. I found it in November and I was in classes the following Spring.

    I’m now 6 of 11 classes into the degree and I’m slated to graduate Spring 2011.

    **************************************
    Academic advice:

    From what I’ve seen of the classes I’ve taken and classes I will be taking, here’s a high level look at what you’d probably be expected to know:

    1.) An understanding of molecular biology… This is essentially basic undergrad freshman level. They expect more for a degree specifically in Bioinformatics, but for a concentration you just need a good understanding of the basics: DNA, transcription, translation, cell signalling, etc. You’ll learn the rest along the way when you need more in depth understanding.

    2.) Databases – I took a general course in DB systems, and I’m taking a course specific to biological databases this summer. Here’s part of the course description for the Bio DB course:

    Databases introduced include genome and sequence databases such as GenBank and Ensemble, as well as protein databases such as PDB and SWISS-PROT. Tools for accessing and manipulating sequence databases such as BLAST, multiple alignment, Perl, and gene finding tools are covered.

    Can’t go wrong learning about that stuff.

    3.) High level language like C++, Java, etc. – I’m sure the reader has this already as it’s the main ingredient of comp sci. There’s some stress on algorithms, big-O, OO programming, but this is standard as well.

    4.) General understanding of probability and statistics -this was a huge part of the Systems Biology and looks like it will be part of every “computational” bioinformatics course I plan to take… (Computational Drug Discovery, Computational Biology, Computational Genomics, etc…)

    For more in depth of what (at from JHU’s perspective) is expected from CompSci/Bioinformatics, check you the Bioinformatics section VI here: http://catalog.ep.jhu.edu/preview_program.php?catoid=16&poid=338&returnto=482

    Those courses in that section VI are specific to the “Master’s in Comp Sci with a Concentration in Bioinformatics” degree, so reading the course descriptions will give you a good idea of what you’ll want to know and you can take similar classes.

    Job advice:

    The advice I’d give about searching for a bioinformatics job is to be sure to look into companies like Lockheed Martin and others similar to it. A lot of the “big names” are starting to expand into biology/bioinformatics fields and very few people actually know about it. I think this is because when you say “Lockheed Martin” or something like that people automatically think Defense constractor, military, Hubble telescope, F-22 Raptor, etc… they don’t think “biology.”

    I WORK for Lockheed and didn’t know about it, and even more important THEY ARE LOOKING FOR PEOPLE, *ESPECIALLY WITH COMP SCI BACKGROUND!* I plan on applying to positions even before I finish my degree.

    I hope this helps,

    -Kemanorel

  5. #5 d0t
    May 26, 2010

    I have Maths/CS degrees, and am now in Computational Biology (see url). The biochemistry and physiology is a bit difficult at first, but you can actually pick most of it up as you go along, especially if you are interested in it in the first place.
    However, it really depends on what kind of things you want to do: for computational biology and bioinformatics a maths/cs background is probably great. If you want to do things like Abbie does you might want to switch.

  6. #6 Randall
    May 26, 2010

    I majored in biology as an undergrad, but have since switched into computer science for graduate school. First of all, you don’t need to kill animals to do biology; if you work primarily with bacteria or yeast, you never even have to see an animal. And I doubt you’d be killing your own in anatomy/physiology-type classes; the only case where I think you might have to get personally involved is if you’re actually doing research on flies or mice (and would you be as upset about, say, sticking a tube of flies into a refrigerator to make them freeze to death? We’re not exactly talking “break its neck by hand” here.) Anyway, there’s definitely lots of potential for overlap; biologists are producing more and more data (with sequencing, proteomics, etc.), but not many of them have the CS background to perform complex analysis of that data; if you can, that would be very valuable.

  7. #7 lylebot
    May 26, 2010

    I’m a computer science professor. A lot of my colleagues in CS are collaborating with biologists. I review NSF proposals that have almost as much biology as CS. Our department gets NIH funding. CS+biology is going to be huge over the next decade or so, in my opinion.

    And CS research pays well. In my experience (including talking to friends at other institutions), CS graduate students make $20-25k/year, which I am led to believe is more than grad students in other sciences (though admittedly not much to support a family on). And without revealing how much I make, I will say that a junior tenure track CS professor can make at least as much as full professors in some other fields. Plus there’s a large supply of industry positions that pay just as well if not better, and involve actual research.

    In conclusion: CS is where it’s at.

  8. #8 Grant
    May 26, 2010

    I’m an independent computational biologist with a Ph.D. in the field + experience. [ Contracts or job offers welcome :-) ]

    I’ve written a few posts on bioinformatics (see link on my name; the links at the end of the article will be more appropriate, the one I’ve given is just and entry point so to speak).

    Bit short on time to say much here, but I’d look at doing contract work for a biology group while you’re learning the bio. It’ll give you some idea of if this is what you want and you’ll get a few contacts. I favour people trying to get some work experience, rather than just “studying in hope” as it were. (A theme I’ve written about in a student advice post.)

    IMO, the very best comp bio people are very strong on the biology side (so that they understand what it is they are trying to address well), but there are a *lot* people working in collaborations with mainly a comp sci background. There are a lot of other skills that can be allied to this: maths, stats, DB work, etc.

    All said the comp sci degree on it’s own should still be v. useful (with or without looking in the direction of biology).

  9. #9 dvrvm
    May 27, 2010

    To throw in a remark: From what I have seen, there is a big division in bioinformatics between programmers, who come 90%+ from an IT background, and users, who all have a biology background, and use the tools but really do not understand them. I took a bioinformatics class oriented towards biologists, and we learned basically how to use the available tools, and were given a superficial introduction about the algorithms used (which most people probably didn’t really understand, except for the ones with more IT background like me…) If you really want to connect biology and informatics, the way to go is probably Proteomics, currently. There I have met a few people who really blend both sciences and work in the lab as well as on the computer (writing software, that is, not merely using it). It’s also a field which is still developing at a fast pace, and new technologies are sprouting which need work on the biochemical and on the IT side. (In contrast to, say, gene alignment algorithms, which are a relatively well-developed and stable field by now, and the IT people take care of the databases and the biologists use them.)

  10. #10 David
    May 27, 2010

    This has been bothering me for a year now. I’d like to think I’m a good programmer after 10+ years (and too many languages), but it’s the sort of thing where one needs to keep finding new problems, excuses to code.

    Looking back, the degrees I got in csci/new media/net security were mainly aimed at bootstrapping interns. I’ve taught myself sooo much more with pet ptojects than the classes ever did.

    So I’ve been voraciously consuming biology online lectures, but I haven’t found much of anything on bioinformatics. I’d like to volunteer my services (wouldn’t want to steal a job away from a real bio major) on a hobbiest/amateur level, if only I could find the kiddie table. *sigh*

    I’m looking for: a walkthrough of typical day-to-day BLASTing/etc that bioinfs do (not just the molecular bio theory) and the code they use; hello world problems to cut my teeth on with those methods; and ideally a bio grad to occasionally hand me scraps to play with as real-world examples.

    And once I “get it”, I can flesh out websites to kickstart other programmers like myself who want to cross-train themselves.
     

  11. #11 Kemanorel
    May 27, 2010

    I’m looking for: a walkthrough of typical day-to-day BLASTing/etc that bioinfs do (not just the molecular bio theory) and the code they use; hello world problems to cut my teeth on with those methods; and ideally a bio grad to occasionally hand me scraps to play with as real-world examples.

    You might look into the “Bioinformatics for Dummies” book. I have it, and it has some great stuff in there.

    I forgot whether it covers any actual code or not, but it does cover common bio DBs, BLAST, and a bunch of other good stuff. Might be a good place to start for what you’re looking for.

    There are books on Perl and Python specifically for Bioinformatics, so you might search that on Amazon for the actual coding stuff.

  12. #12 William Wallace
    May 27, 2010

    Sadly, many recent computer scientist graduates are rather less intelligent then their forerunners. If you ask a recent comp. sci. grad to apply what he’s learned in school and books to a solution for a practical problem, like how a business should sweep its parking lot, they will come up with a complex scheme involving eight transactions, five people, and seventy pages of documentation.

    So I don’t doubt that many current comp. sci. students would do well in biology.

    And before you go taking Bill Gate’s advice, take a look at Microsoft word or excel 2007, in which Microsoft assumes that those who use word processors are illiterate, can’t understand English, and must therefore be presented with a “ribbon” loaded with symbols for those who can write, but not read.

    Makes sense–a larger iconic and illogically organized ribbon to replace the previous menus and toolbars.

    Makes sense–to a biology student?

  13. #13 Kemanorel
    May 27, 2010

    Sadly, many recent computer scientist graduates are rather less intelligent then their forerunners.

    And you’re basing this assertion one what exactly? Are you intentionally being a jack ass to comp sci graduates? I would almost say you’re being facetious, except you give zero indiction that that’s what you’re doing.

    If you ask a recent comp. sci. grad to apply what he’s learned in school and books to a solution for a practical problem, like how a business should sweep its parking lot, they will come up with a complex scheme involving eight transactions, five people, and seventy pages of documentation.

    What? No comp sci graduate would ever look at that problem the way you just said. Any undergrad who’s had any introduction to “Big-O” wouldn’t look at the problem the way you just suggested either.

    Personally, I’d ask one question: Is the program was meant for a robot, or a plan for someone to execute.

    If it’s unmanned, I’d immediately go take the Roomba’s algorithm, which is open source, and apply that because it already solves most problems robots have with object detection, recognition, etc. and it would work for for any size/shape of parking lot.

    If it’s manned, then it’s a simple task of finding the shortest path to go over the area that must be covered with the least amount of overlap. Very simple algorithms are used for that. In fact, a simple “fill” algorithm can be used to produce a very efficient result with very little code. But you won’t even need code, because a program to figure that would would be a silly waste of time.

    Solution: Write 0 lines of code.

    And before you go taking Bill Gate’s advice, take a look at Microsoft word or excel 2007, in which Microsoft assumes that those who use word processors are illiterate, can’t understand English, and must therefore be presented with a “ribbon” loaded with symbols for those who can write, but not read.

    Your argument is ridiculous. Excel is a powerful tool. I wrote a 2 page macro to implement a Gillespie algorithm to simulate a GRN of a cell using excel and VB macro which also automatically produced charts to display the verious results.

    I’ve also used excel/VB to to model a dynamic mobile network based on a scenario of more than 1000 units, to calculate a network of unbroken communication across half a continent. The end result of which could be exported for visualization in a graphics program and also tracked the amount of data sent over both ground and satellite networks.

    I wrote that for a real geosyncronous satellite network my first year out of college. So, GTFO of here with your “Sadly, many recent computer scientist graduates are rather less intelligent then their forerunners” bullshit.

    You obviously don’t hang around with many programmers.

  14. #14 Grant
    May 27, 2010

    Quick round-up:

    dvrvm,

    About who has what skills, I’ve written several posts about this. (Some are listed in the links at the end of the post linked on my name.) Personally, the best “cross-overs” IMHO are in structural biology (crystallography/NMR spectroscopy) largely because structural biology has a strong physics aspect to it. That said, I’m biased as it’s my original background is computational structural biology ;-)

    David,

    re: texts: there are many and I’d like to think with all the angles they cover, they’d include what you’re looking for. Search Amazon.com, etc. Read the reviews carefully; they’ll often indicate the approach the book takes. I can’t recommend any (sorry) as I tend to work from the research literature and reference texts & am not familiar with the “starter” texts. That said, in addition to Bioinfo for Dummies, perhaps check out Arthur Lesk’s and Zvelebil’s books. A problem I suspect all books in the “starter” end will have is that they will date very quickly if they are focused on specific tools, as you want to.

  15. #15 William Wallace
    May 27, 2010

    Kemanorel,

    Briefly, I use MS excel and word all the time, and it was the user interface stupidity in office 2007 that I was commenting on. I like MS Excel, and have used it to quickly solve complex problems. But I like Excel 2000 much more than Excel 2007, mostly due to the drastically changed and less logically organized user interface found in 2007.

    Hope that clears things up for you. In case it does not, menus, toolbars, and ribbons are user interface features, and MS Excel was produced by a company significantly owned by Bill Gates. Bill Gates was cited by Abbie as an authority in her OP.

    The problem with many recent computer scientist graduates is they are walking around with half a tool belt of trendy solutions looking for problems to use them on. It’s like the proverbial carpenter who thinks every problem can be solved with a hammer. In the real world, the problem at hand is the problem, and it is independent of the solution you want to use apply.

    Proceed with caution.

    Similarly, computer science types seem to think that adding a “level of abstraction” is a good thing in many more instances than it actually is. They end up creating, documenting, and describing APIs that are much more complicated and error prone than the underlying interface they are trying to simplify/control/secure.

    Granted, in many situations adding a level of abstraction can be a Good Thing, but too many recent computer science graduates don’t seem to have common sense regarding when they should and when they should not add a level of abstraction. They are eager to create a wrapper even if the thing they are wrapping doesn’t need wrapping. They end up abusing the problem, their colleagues, their employer, and their end users, all while patting themselves on their backs about the elegant complexity they have unnecessarily created.

    You may be an exception. Whether or not you are, I don’t know. I doubt it, as there aren’t very many different problem classes in computer science—probably less than 10—and most if not all of them already have optimal or at least tractable solutions.

    The trick is identifying which known solution to apply to the problem at hand.

    Again, word processors are used to write. They are for literate people. Turning a perfectly functional system of menus and toolbars into a disorganized system of menus and ribbons is not an improvement.

    While you’re at a business recommending and implementing a plan to sweep the parking lot, the business owner will be out back, tossing the final dustpan full of debris into the dumpster.

    Good luck in your career. I don’t have high hopes for you.

    P.S. I do know of one recent computer science graduate who is an exception to the generalizations I have made. Hence, the use of “many”.

  16. #16 jose
    May 28, 2010

    Abbie is absolutely right when she says you don’t need a bio degree to work in bioinformatics. Living proof right here. The more biology you know the better, of course, but likely your future employer won’t put so much emphasis in your biology knowledge.

    If you’re thinking about working in a lab you DO need Perl. Python isn’t being used that much. Use the time you’d spend learning Python to learn more Perl. Forget about Java-esque big architectures and frameworks and use yourself to one liners and Zen programming.

    That’s mainly the thing I could tell–just get really good at Perl.

  17. #17 Kemanorel
    May 28, 2010

    …as there aren’t very many different problem classes in computer science—probably less than 10…
    The trick is identifying which known solution to apply to the problem at hand.

    Spoken like someone who doesn’t know shit about computer science.

    But I like Excel 2000 much more than Excel 2007, mostly due to the drastically changed and less logically organized user interface found in 2007.

    And you probably don’t like the interface change in YouTube either.

    You must not use Excel for anything other than very basic stuff because the benefits to someone like me who ends up using it to organize and process a lot of data see a giant improvement in 2007 not only because of a MUCH better filter capability and several other improvement to previous functions, but a file in 2003 format that runs about 20mb is only 4-5mb in 2007 format. That alone makes dealing with high volumns of data MUCH better.

    A friend of mine has 70,000 data files. What format do you think he’s going to want considering the data he has to process?

    Seriously, “it looks different” is your big stunner argument? IT is it “less logically organized?” It’s almost exactly the same: the top menu bars are almost identical. There’s only a handful of changes.

    This has to be a huge example of the Dunning-Kruger effect… I have severe doubts about your ability to assess the abilities of computer scientists considering you continue to use an outdated, and significantly worse, product because you can’t get used to a new interface.

    You are obviously not as good as you think you are.

    While you’re at a business recommending and implementing a plan to sweep the parking lot the business owner will be out back, tossing the final dustpan full of debris into the dumpster.

    Did you not just see where I said the solution to the sweeping problem is to write ZERO lines of code?

    And, why would I be there recommending and implementing a plan in the first place? This isn’t really a problem for computer scientists in the first place (unless you were talking about building an unmanned robot.

    Otherwise, it doesn’t make sense to say, “Hey, computer scientist type person. I have this problem, it’s not really for computer scientists, but you suck because nothing you could do for this problem would be faster than just going out and doing it!”

    If you really think that’s how computer scientists get work, you must be tripping balls from “cheesing” or something.

    Turning a perfectly functional system of menus and toolbars into a disorganized system of menus and ribbons is not an improvement.

    Open up Excel 2007 and Excel 2003 side by side. Do the same thing with word. Click the menus at the top. THEY AREN’T THAT DIFFERENT. And who cares if it’s not an improvement? It’s at worst a lateral move considering how alike they are, and you’re completely ignoring the benefits, especially in the size of the files for the same amount of data among many other things.

    I don’t have high hopes for you.

    That’s fine, because I don’t have any hopes for you.

    I do know of one recent computer science graduate who is an exception to the generalizations I have made. Hence, the use of “many”.

    Considering what you’ve said… I highly doubt you’ve had any extensive contact with computer scientists, let alone enough to have a sample size large enough to be able to use the qualifier “many.” I also very much doubt you have the ability to evaluate the ones you have had contact with because what you’ve said suggests strongly that you’re on the low end of the Dunning-Kruger effect.

  18. #18 William Wallace
    May 28, 2010

    Kemanorel,

    While you’re at a business studying the parking lot problem, the business owner will be out back, tossing the final dustpan full of debris into the dumpster.

    Good luck in your career. I don’t have high hopes for you.

  19. #19 Kemanorel
    May 28, 2010

    While you’re at a business studying the parking lot problem, the business owner will be out back, tossing the final dustpan full of debris into the dumpster.

    Don’t have anything new to actually say back? Smart thing on your part to recognize you took an indefensible position, even if you won’t admit it. I mean that in all sincerity.

    “‘Tis better to remain quiet and be thought a fool, then to open your mouth and remove all doubt.”

    Good luck in your career. I don’t have high hopes for you.

    *yawn*

  20. #20 Jesse
    May 28, 2010

    I have seen evidence of some really bad CS programs, but there are some really good ones too. One girl, fresh out of college with a bachelors in CS did not know what recursion was. I would call that evidence a bad CS program, but I do not recall which university she graduated from. UNM’s CS program, on the other hand, is really good. They try to teach you not only how to write code, but how to think. At some point, they start not caring about how many languages you know and they start caring about how you can apply what you know. They give you a basis from which you can rapidly pick up a new language or learn new tools.

  21. #21 William Wallace
    May 28, 2010

    *yawn*

    Kemanorel, you’re sleeping through class, again.

    Let me ask you: as a person who doesn’t demonstrate a fundamental understanding of the difference between the meanings of the words “many” and “all”, and uses this confusion to construct a delusive counter argument to a point never made, while foolishly citing himself as an example of what is right with computer science, why do you think you deserve more of a response?

    You even went on to “refute” the problems I mentioned with MS office 2007’s atrocious GUI redesign by claiming to have solved a difficult problem with Excel. Indeed, you are just another exhibit to support what I was saying.

    Jesse, I guess she went to the same school as Kemanorel. But I do agree with you that there are still some good students going into and coming out of Comp. Sci., but I suspect these programs have been watered down to accept too many idiots, and it shows. UNM’s program does sound like it is taking the right approach. Even so, as the saying goes, you can lead a horse to water….

    How you decompose a problem is more important than what tools you know how to use. One can learn to use new tools. One cannot solve problems efficiently using inappropriate tools.

  22. #22 Tyler DiPietro
    May 28, 2010

    “I doubt it, as there aren’t very many different problem classes in computer science—probably less than 10—and most if not all of them already have optimal or at least tractable solutions.”

    Have you ever even heard of NP-hard problems?

  23. #23 BrianX
    May 30, 2010

    William Wallace:

    The Ribbon interface does suck. But so do you. Like so many right-wing jerkwads, you’re responding to things Kemanorel isn’t saying.

  24. #24 harold
    May 30, 2010

    Hey Kids –

    William Wallace is a buffoonish creationist whose big words mask his total ignorance of any topic in biomedical science.

    I bet he doesn’t know anything about computer science, either.

    But let’s find out.

    William Wallace –

    Which verifiable academic credentials in computer science do you possess? Verifiable means names and dates so that it can be checked.

    Which programming languages do you use? Please back up any assertions by including a few lines of (non-executable) code in any language or system you claim expertise in.

  25. #25 Kemanorel
    June 1, 2010

    Let me ask you: as a person who doesn’t demonstrate a fundamental understanding of the difference between the meanings of the words “many” and “all”, and uses this confusion to construct a delusive counter argument to a point never made, while foolishly citing himself as an example of what is right with computer science, why do you think you deserve more of a response?

    I very well understand the difference between “many” and “all,” and I’m disputing your use of the word “MANY!”

    As someone who works in the field, has a degree in the field, is going to graduate school for a degree in the field, and knows many more people in the field than you do, I can say with MUCH more certainty that this statement:

    “Sadly, many recent computer scientist graduates are rather less intelligent then their forerunners.”

    …is a pile of bullshit even though you do use the quantifier “many.”

    There are definitely bad students and programs, but it’s DEFINITELY weighed the other direction where most CS students are just as intelligent as their forerunners. They just don’t have as much experience.

    The proof that you don’t understand the subject is that you think this:

    for a practical problem, like how a business should sweep its parking lot…

    …would apply to CS at all where humans (as opposed to robots) are doing the cleaning.

    Again, you have no understanding of the subject beyond “Computer Scientists write code,” so please stfu.

    You even went on to “refute” the problems I mentioned with MS office 2007’s atrocious GUI redesign by claiming to have solved a difficult problem with Excel.

    Because as someone who’s a professional in a computer field, I don’t get my underwear in a knot just because an interface changed, and I see what the benefits are to using the new program, like those of which I already mentioned.

    99% of the problems people have with computers is PEBCAK related. In your case William, I bet 99% of the problems you have are PEBCAK, though I bet this extends far beyond your computer desk when it comes to the problems you have. I bet most of your life could be defined as “operator error.”

    Jesse, I guess she went to the same school as Kemanorel. But I do agree with you that there are still some good students going into and coming out of Comp. Sci., but I suspect these programs have been watered down to accept too many idiots, and it shows.

    I understand that you’re just trying to be insulting, but it’s a bit silly to try to call into question my intelligence when I can prove that I did well in undergraduate at ODU (3.22 GPA, was top 8 in springboard diving in the conference, took 4 different styles of martial arts and recieved multiple black belts, and held several offices in my fraternity). I got a job at Lockheed Martin and I got into graduate school at Johns Hopkins University.

    It also doesn’t hurt that out of the 6 classes I’ve finished so far at JHU I have a 3.83 GPA.

    Seriously, you’re just being silly about being refuted by someone in the computer science field.

    How you decompose a problem is more important than what tools you know how to use. One can learn to use new tools. One cannot solve problems efficiently using inappropriate tools.

    Did you seriously just completely ignore what I said on this issue and how it’s NOT a CS problem? See what I said:

    Did you not just see where I said the solution to the sweeping problem is to write ZERO lines of code?

    I decomposed it and I specifically said I wouldn’t write any code because this isn’t a CS issue…

    I then went on to say:

    And, why would I be there recommending and implementing a plan in the first place? This isn’t really a problem for computer scientists in the first place (unless you were talking about building an unmanned robot.)

    Otherwise, it doesn’t make sense to say, “Hey, computer scientist type person. I have this problem, it’s not really for computer scientists, but you suck because nothing you could do for this problem would be faster than just going out and doing it!”

    Seriously, wtf don’t you understand here?

  26. #26 harold
    June 1, 2010

    Kemanorel –

    I suspect that William Wallace has run away.

    You see, just above, I asked him to give verifiable evidence that he knows anything about computer science, even at the level of writing simple code. He may surprise me, but I strongly suspect that he is unable to do so. And believe me, if I am wrong here, I will be very surprised.

    I know him from other venues as a creationist who knows nothing about biology. His schtick is always to use pompous, extremely insulting language that puts other people on the defensive and superficially masks his total ignorance. If you’re reading this, WW, respond to my challenges immediately above before you respond to anything else, please.

    Anyway, unlike his medieval Scottish namesake, he has a strong tendency to run away from or otherwise avoid a challenge.

  27. #27 William Wallace
    June 3, 2010

    Have you ever even heard of NP-hard problems?– Tyler DiPietro

    Have you ever heard of good enough? Or are you the kind of guy who must code up Tournament Sort for a problem involving the sorting of 8 items?

    I have heard of NP-hard, though I can’t say it helps me much. For example, I don’t remember the difference between NP-complete and NP-hard.

    Sudoku is NP-complete, for example. I found this out after I wrote a toy program to solve thousands of Sudoku puzzles per second second. Maybe if it were NP-hard I would have failed.

  28. #28 William Wallace
    June 3, 2010

    Which programming languages do you use? Please back up any assertions by including a few lines of (non-executable) code in any language or system you claim expertise in.– harold

    Written by a Ph.D. computer scientist:

    int main(int argc, char** argv) {

    for (int c = getchar(); c != -1; c = getchar()) {}

    c = c & 170;

    putchar(c);

    }

    }

    Let me know what you think.

    Which verifiable academic credentials in computer science do you possess? Verifiable means names and dates so that it can be checked.– harold

    Email me for a detailed response. In short, when I inteview potential new hires, I don’t look at their grades (though mine were good), or the degrees (though I have mine), but their ability to solve novel problems (which is what I do for a living).

    As for you, I don’t really care about your credentials.

    Neither do the problems real systems-, computer-, and electrical engineers work on.

    But I do have a favor to ask. Watch these two videos: http://www.youtube.com/watch?v=AqoSxVf4qTY and http://www.youtube.com/watch?v=nQezXbiroiE

    Enjoy. They are among my favorites.

  29. #29 Tyler DiPietro
    June 4, 2010

    “Have you ever heard of good enough?”

    So “optimal” or “at least tractable” means “good enough”, as if the former two don’t have technical definitions. You suck at computer science, Wallaids.

    Besides, your statement is false even if you assume “good enough” as a criterion. Single machine weighted total tardiness problems often can’t be solved optimally for n > 50. The same goes for vehicle routing problems.

    “I have heard of NP-hard, though I can’t say it helps me much. For example, I don’t remember the difference between NP-complete and NP-hard.”

    NP-hard means every instance of a problem is polynomial reducible to any problem in NP. NP-complete is more difficult to prove because you also have to prove that the problem is polynomial certifiable, which is often difficult.

    You’re welcome.

    “Sudoku is NP-complete, for example. I found this out after I wrote a toy program to solve thousands of Sudoku puzzles per second second.”

    Even if I believe you, if the inputs are small enough an exponential-time algorithm won’t perform much differently than a polynomial one. How big were the puzzles?

  30. #30 Kemanorel
    June 4, 2010

    How big were the puzzles?

    Sudoku is typically 9×9, but solving Sudoku is like a 100 level project. You don’t even need any classes. It’s loops and arrays. That’s all.

    //*************************
    //The brackets, [ ], should be the greater than and
    //less than signs, but HTML formating sucks!
    //If you want to make this work, just copy and paste
    //into a .txt file and use a global replace for the [ ]

    #include[stdio.h]
    #include[conio.h]
    #include[iostream.h]
    #include[stdlib.h]
    {
    a[i][j]=k;
    if(n[0)
    solve(p,q,n++);
    int ch=check(1,0);
    if(ch!=0)
    {
    display();
    getch();
    exit(0);
    }
    }
    }
    }

    int check(int n,int r)
    {
    int f=0,cont=0;
    if(r==1)
    {
    for(k=1;k[=9;k++)
    {
    for(i=n;i[=n;i++)
    for(j=1;j[=9;j++)
    {
    if(k==a[i][j])
    f++;
    }
    if(f!=1)
    return(0);
    else
    cont++;
    f=0;
    }
    if(cont!=9)
    return(0);
    else if(n==9)
    check(1,0);
    else
    check(n++,1);
    }
    else
    {
    for(k=1;k[=9;k++)
    {
    for(i=1;i[=9;i++)
    for(j=n;j[=n;j++)
    {
    if(k==a[i][j])
    f++;
    }
    if(f!=1)
    return(0);
    else
    cont++;
    f=0;
    }
    if(cont!=9)
    return(0);
    else if(n!=9)
    check(n++,1);
    }
    }
    //******************

    TA DA! Horray for bad HTML formatting for indentation and spacing

    Seriously, solving Sudoku is like bragging about learning to ride a tricycle. It’s an exercise for first semester CS students to reinforce how to use arrays and loops.

  31. #31 William Wallace
    June 4, 2010

    It’s been awhile since I’ve run into so many oblivious people.

    Sudoku is typically 9×9, but solving Sudoku is like a 100 level project.

    Hence, toy program.

    Even though it is a toy program, it looks like you failed yet again. Maybe you should go back to the 100 level.

    Give this a run, and then post your corrected source code. No cheating now, and I don’t want to see any classes or structures in your 100 level program: XXX1XX2XXXXX3X4X85X85XXX3XXXX2X6X7X4X3XXXXX5X4X8X2X6XXXX6XXX47X74X6X8XXXXX3XX2XXX

    Where the X represents a box with no clue, and 1-9 represents boxes where those numbers are provided. The string is top left square to bottom right square, in sequence, left to right, top to bottom.

    I’m more interested in the source code without structures and classes than the solution, which I already have.

  32. #32 William Wallace
    June 4, 2010

    scienceblogs don’t like 81 character strings, so here:

    XXX 1XX 2XX
    XXX 3X4 X85
    X85 XXX 3XX

    XX2 X6X 7X4
    X3X XXX X5X
    4X8 X2X 6XX

    XX6 XXX 47X
    74X 6X8 XXX
    XX3 XX2 XXX

  33. #33 Kemanorel
    June 5, 2010

    Even though it is a toy program, it looks like you failed yet again. Maybe you should go back to the 100 level.

    Give this a run, and then post your corrected source code.

    I’m sorry the program I tried write in a text comment in about 20 minutes with no design or testing has some bugs in it. ROFL.

    I didn’t even expect it to compile, let alone not have any bugs. I was just trying to show the simplicity of the sudoku solver (it was a final project option for my high school progamming course, which didn’t even cover classes). I also did it to show that you claiming write a solver isn’t impressive. Even a purely brute force algorithm for sudoku could solve hundreds in a second with today’s processor speeds. Saying you wrote one that solves thousands is just puffery.

    I have better things to do than go back and debug it, but if you want a different example of “toy” code, one that won’t cost me more time then I’m willing to spend on you as I’ve already written it, I could give you the java source code I wrote for an AI to play the game ‘Push.’

    Coming up with a decent, dynamic heuristic that applies to a gameboard of arbitrary, user-defined size so the AI’s algorithm (min/max or A* w/ beta-pruning) chooses an “intelligent” play based on an arbitrary, user-defined number of ply which determines AI difficulty, is much harder than solving a sudoku puzzle.

  34. #34 Jesse
    June 5, 2010

    Give this a run, and then post your corrected source code. No cheating now, and I don’t want to see any classes or structures in your 100 level program:

    LOL:WUT?

    I’m sorry, but both CS 151 &152 have students using classes. Classes and rudimentary OOP are most certainly 100 level material in a CS curriculum.

  35. #35 Kemanorel
    June 5, 2010

    LOL:WUT?

    I’m sorry, but both CS 151 &152 have students using classes. Classes and rudimentary OOP are most certainly 100 level material in a CS curriculum.

    He’s stating that because I did said that Sudoku can be solved without classes. (I don’t know why he decided to throw structures in there on top of that.)

    Classes are definitely 100 level though.

  36. #36 William Wallace
    June 5, 2010

    I didn’t even expect it to compile, let alone not have any bugs. I was just trying to show the simplicity of the sudoku solver (it was a final project option for my high school programming course, which didn’t even cover classes).–Kemanorel

    To be clear, I wasn’t commenting on your propsal’s compilability.

    Otherwise, peace.

    Club > horse.

  37. #37 Kemanorel
    June 7, 2010

    Written by a Ph.D. computer scientist:

    int main(int argc, char** argv) {
    for (int c = getchar(); c != -1; c = getchar()) {}
    c = c & 170;
    putchar(c);
    }
    }
    Let me know what you think.

    I think you can’t write your own code.

    That scrap of code came from Mark Chu-Carroll of the Good Math, Bad Math blog. Unless you’re Mark, you didn’t write it.

    http://scienceblogs.com/goodmath/2009/04/the_return_of_the_compression.php

  38. #38 William Wallace
    June 7, 2010

    The code was written by a Ph.D. computer scientist, it won’t even compile, and you were too stupid to even see that. Epic fail.

    And, I was going to let you bow out gracefully, but since you seem to have so much time on your hands, when do we get to see your 100 level solution to the test sudoku puzzle?

    You’re a disgrace to anybody who actually uses computers to solve problems.

  39. #39 Kemanorel
    June 7, 2010

    First, I apologize to ERV because this is an extremely long post, but it’s time for WW to get smacked around a bit:

    The code was written by a Ph.D. computer scientist, it won’t even compile, and you were too stupid to even see that. Epic fail.

    ROFL. You don’t even recognize coding short-hand and you’re calling me stupid? The more you talk, the more to show you don’t know what the fuck you’re talking about.

    If you’re talking to someone who knows code, it’s perfectly alright do say things like this:

    while( x = getchar() != EOF)

    That won’t compile, but a computer programmer familiar with C/Java would know you really mean this:

    x = getchar();
    while( x != fin.EOF()) //fin is a file instream
    {

    x = getchar();
    }

    Seriously, if you don’t even recognize short-hand when you see it, you’re better off just shutting the fuck up. The little code snippet you stole was just a tiny part of a script written in short hand. Anyone familiar with code would see that it didn’t even have any file input because coders know that would be implied.

    That was the entire point of the post was talking about BAD ways to do file compression. Did you even read the post you stole the code from?

    You’re a disgrace to anybody who actually uses computers to solve problems.

    I already told you that I’m not going back to debug something I wrote as a spoof.

    If you want to see some of my code that I wrote with actual intention, like I said, I’ll be glad to give you the full artificial intelligence “Push” game that I wrote.

    Here’s a sample. The double recursive algorithm I wrote for the AI to search ahead based on a min/max tree search:

    //return minimum score of next nodes
    public static int Alphabetamaxnode(int size, int depth, char[][] nextboard, char[][] previousboard, char[][] currentboard, int[] localalphabeta)
    {
    int localminscore = 0;
    int minscore = 0;
    int counter = 0;
    String move[];
    String letter; //side of board
    int roworcol; //index of row or column from player input
    String roworcol2; //string parse of playerinput to be converted to roworcol
    char token = ‘X';
    boolean check;
    int alpha = -1000;
    int beta = 1000;
    char[][] max_previousboard = new char[size][size];
    char[][] max_currentboard = new char[size][size];
    char[][] max_nextboard = new char[size][size];

    SetBoard(size, max_previousboard, previousboard);
    SetBoard(size, max_currentboard, currentboard);
    SetBoard(size, max_nextboard, nextboard);

    move = new String[(size * 4)];
    Getmoves(move, size);

    if(depth > 0)
    {
    for(counter = 0; counter < (size * 4); counter++)
    {
    letter = move[counter].substring(0, 1);
    roworcol2 = move[counter].substring(1);
    roworcol = Integer.parseInt(roworcol2);

    SetBoard(size, max_previousboard, max_currentboard);
    SetBoard(size, max_currentboard, max_nextboard);
    MakeMove(letter, roworcol, size, token, max_nextboard);

    check = Checkillegalmove(size, token, max_nextboard, max_previousboard);
    if(check == false)
    {
    if(alpha < localalphabeta[2])
    {
    alpha = localalphabeta[1];
    beta = localalphabeta[2];

    localalphabeta[0] = Alphabetaminnode(size, (depth - 1), max_nextboard, max_previousboard, max_currentboard, localalphabeta);
    expanded_nodes = expanded_nodes + 1;
    localminscore = localalphabeta[0];

    if(beta > localalphabeta[0])
    {
    beta = localalphabeta[0];
    localalphabeta[2] = beta;
    }

    if(localminscore < minscore)
    {
    minscore = localminscore;
    localalphabeta[0] = minscore;
    }
    }
    }
    SetBoard(size, max_nextboard, max_previousboard);
    }
    }
    else
    {
    minscore = EvaluateBoard(size, max_nextboard);

    if(localminscore < minscore)
    {
    minscore = localminscore;
    localalphabeta[0] = minscore;
    }
    }

    return localalphabeta[0];
    }

    //return maxiumum score of next nodes
    public static int Alphabetaminnode(int size, int depth, char[][] nextboard, char[][] previousboard, char[][] currentboard, int[] localalphabeta)
    {
    int localmaxscore = 0;
    int maxscore = 0;
    int counter = 0;
    String move[];
    String letter; //side of board
    int roworcol; //index of row or column from player input
    String roworcol2; //string parse of playerinput to be converted to roworcol
    char token = 'O';
    boolean check;
    int alpha = -1000;
    int beta = 1000;
    char[][] min_previousboard = new char[size][size];
    char[][] min_currentboard = new char[size][size];
    char[][] min_nextboard = new char[size][size];

    SetBoard(size, min_previousboard, previousboard);
    SetBoard(size, min_currentboard, currentboard);
    SetBoard(size, min_nextboard, nextboard);

    move = new String[(size * 4)];
    Getmoves(move, size);

    if(depth > 0)
    {
    for(counter = 0; counter < (size * 4); counter++)
    {
    letter = move[counter].substring(0, 1);
    roworcol2 = move[counter].substring(1);
    roworcol = Integer.parseInt(roworcol2);

    SetBoard(size, min_previousboard, min_currentboard);
    SetBoard(size, min_currentboard, min_nextboard);
    MakeMove(letter, roworcol, size, token, min_nextboard);

    check = Checkillegalmove(size, token, min_nextboard, min_previousboard);
    if(check == false)
    {
    if(beta > localalphabeta[1])
    {
    localalphabeta[0] = Alphabetamaxnode(size, (depth – 1), min_nextboard, min_previousboard, min_currentboard, localalphabeta);
    expanded_nodes = expanded_nodes + 1;
    localmaxscore = localalphabeta[0];

    if(alpha < localalphabeta[0])
    {
    alpha = localalphabeta[0];
    localalphabeta[1] = alpha;
    }

    if(localmaxscore > maxscore)
    {
    maxscore = localmaxscore;
    localalphabeta[0] = maxscore;
    }
    }
    }

    SetBoard(size, min_nextboard, min_previousboard);
    }
    }
    else
    {
    maxscore = EvaluateBoard(size, min_nextboard);

    if(localmaxscore > maxscore)
    {
    maxscore = localmaxscore;
    localalphabeta[0] = maxscore;
    }
    }

    return localalphabeta[0];
    }

    It searches every single possible move combination up to five moves ahead. It could do more, but by ply (the number of moves ahead it looks) #5 it’s searching and evaluating more than 1 million possible game boards (given the standard 4×4 game board), using a heuristic algorithm to evaluate the best possible guaranteed outcome.

    The increase in win percentage, however, isn’t worth the extra computation complexity needed to go down another one or two ply which would result in 16 or 268 times the number of computations as 5 ply.

    The other AI algorithm, not posted here, uses beta-pruning to automatically cut parts of the search tree so it easily searches down 9 or so ply for the same computational cost.

    Here’s the heuristic algorithm for evaluating who’s leading on the board:

    public static int EvaluateBoard(int size, char[][] board)
    {
    int boardscore = 0;
    int bonusX = 0;
    int bonusO = 0;
    int totalXtokens = 0;
    int totalOtokens = 0;
    int totalscoreX = 0;
    int totalscoreO = 0;
    int bonusfactor = 3; //I thought maybe I could use this as a form of difficulty
    int row = 0;
    int col = 0;
    int flag = 0;

    //calculate rows
    for(row = 0; row < size; row++)
    {
    for(col = 0; col < size; col++)
    {
    if(board[row][col] == 'X')
    {
    totalXtokens++;
    }
    else if(board[row][col] == 'O')
    {
    totalOtokens++;
    }
    }

    //calculate bonus points
    if(totalXtokens >= 2)
    bonusX = (3^(totalXtokens – 1) * bonusfactor) – 1;
    if(totalOtokens >= 2)
    bonusO = (3^(totalOtokens – 1) * bonusfactor) – 1;

    if(totalXtokens == size)
    bonusX = bonusX + 100000;
    if(totalOtokens == size)
    bonusO = bonusO + 100000;

    //total up score for each row
    totalscoreX = totalscoreX + totalXtokens + bonusX;
    totalscoreO = totalscoreO – totalOtokens – bonusO;

    //reset
    bonusX = 0;
    bonusO = 0;
    totalXtokens = 0;
    totalOtokens = 0;
    }

    //calculate columns
    for(col = 0; col < size; col++)
    {
    for(row = 0; row < size; row++)
    {
    if(board[row][col] == 'X')
    {
    totalXtokens++;
    }
    else if(board[row][col] == 'O')
    {
    totalOtokens++;
    }
    }

    //calculate bonus points
    if(totalXtokens >= 2)
    bonusX = (3^(totalXtokens – 1) * bonusfactor) – 1;
    if(totalOtokens >= 2)
    bonusO = (3^(totalXtokens – 1) * bonusfactor) – 1;

    if(totalXtokens == size)
    bonusX = bonusX + 100000;
    if(totalOtokens == size)
    bonusO = bonusO + 100000;

    //total up score for each column
    totalscoreX = totalscoreX + totalXtokens + bonusX;
    totalscoreO = totalscoreO – totalOtokens – bonusO;

    //reset
    bonusX = 0;
    bonusO = 0;
    totalXtokens = 0;
    totalOtokens = 0;
    }

    //calculate diagonals
    //topleft -> bottom right
    col = 0;
    for(row = 0; row < size; row++)
    {
    if(board[row][col] == 'X')
    {
    totalXtokens++;
    }
    else if(board[row][col] == 'O')
    {
    totalOtokens++;
    }

    col++;
    }

    //calculate bonus points
    if(totalXtokens >= 2)
    bonusX = (3^(totalXtokens – 1) * (bonusfactor – 2)) – 1;
    if(totalOtokens >= 2)
    bonusO = (3^(totalOtokens – 1) * (bonusfactor – 2)) – 1;

    if(totalXtokens == size)
    bonusX = bonusX + 100000;
    if(totalOtokens == size)
    bonusO = bonusO + 100000;

    //total up score for each column
    totalscoreX = totalscoreX + totalXtokens + bonusX;
    totalscoreO = totalscoreO – totalOtokens – bonusO;

    //reset
    bonusX = 0;
    bonusO = 0;
    totalXtokens = 0;
    totalOtokens = 0;

    //bottomleft -> topright
    col = 0;
    for(row = (size – 1); row >= 0; row–)
    {
    if(board[row][col] == ‘X’)
    {
    totalXtokens++;
    }
    else if(board[row][col] == ‘O’)
    {
    totalOtokens++;
    }
    col++;
    }

    //calculate bonus points
    if(totalXtokens >= 2)
    bonusX = (3^(totalXtokens – 1) * (bonusfactor – 2)) – 1;
    if(totalOtokens >= 2)
    bonusO = (3^(totalOtokens – 1) * (bonusfactor – 2)) – 1;

    if(totalXtokens == size)
    bonusX = bonusX + 100000;
    if(totalOtokens == size)
    bonusO = bonusO + 100000;

    //total up score for each column
    totalscoreX = totalscoreX + totalXtokens + bonusX;
    totalscoreO = totalscoreO – totalOtokens – bonusO;

    //reset
    bonusX = 0;
    bonusO = 0;
    totalXtokens = 0;
    totalOtokens = 0;

    //return total board score
    boardscore = totalscoreX + totalscoreO;
    return boardscore;
    }

    The heuristic is actually set up to not only increase the computer’s position, but also to decrease the opponent’s position to make it harder to win.

    This output isn’t quite right because of uneven spacing, but it looks something like this:

    Please select a game board size: 4
    Please choose a player for X (H/M/A): H
    Please choose a player for O (H/M/A): M
    0 1 2 3
    +-+-+-+-+
    | | | | |
    +-+-+-+-+
    | | | | |
    +-+-+-+-+
    | | | | |
    +-+-+-+-+
    | | | | |
    +-+-+-+-+
    Player X choose a move: R0
    0 1 2 3
    +-+-+-+-+
    | | | |X|
    +-+-+-+-+
    | | | | |
    +-+-+-+-+
    | | | | |
    +-+-+-+-+
    | | | | |
    +-+-+-+-+
    Player O chooses L2
    0 1 2 3
    +-+-+-+-+
    | | | |X|
    +-+-+-+-+
    | | | | |
    +-+-+-+-+
    |O| | | |
    +-+-+-+-+
    | | | | |
    +-+-+-+-+
    Player X choose a move: R0
    0 1 2 3
    +-+-+-+-+
    | | |X|X|
    +-+-+-+-+
    | | | | |
    +-+-+-+-+
    |O| | | |
    +-+-+-+-+
    | | | | |
    +-+-+-+-+
    Player O chooses T1
    0 1 2 3
    +-+-+-+-+
    | |O|X|X|
    +-+-+-+-+
    | | | | |
    +-+-+-+-+
    |O| | | |
    +-+-+-+-+
    | | | | |
    +-+-+-+-+

    And so on until:
    Player X choose a move: R3
    0 1 2 3
    +-+-+-+-+
    | |O|X|X|
    +-+-+-+-+
    | | | |X|
    +-+-+-+-+
    |O|O|O|X|
    +-+-+-+-+
    | | | |X|
    +-+-+-+-+
    Player X wins!

    Not bad for the first program I ever wrote in Java, eh?

    You told me I can bow out gracefully… I suggest you take your own advice, or prove you actually can code something decent, because you haven’t shown a damn thing yet.

  40. #40 William Wallace
    June 7, 2010

    ROFL. You don’t even recognize coding short-hand and you’re calling me stupid? The more you talk, the more to show you don’t know what the fuck you’re talking about.–Kemanorel

    Stop please. This is getting bloody, and I can’t bear to see you do this to yourself.

    What you call coding shorthand was fine in Chu-Carrol’s code. It’s clear you still don’t even know why Chu-Carrol’s code won’t compile. Today’s computer lesson: If you can’t figure it out by inspection, why not try compiling it?

    Screw it, since you have better things to do, I’ll just tell you the answer: {}.

    I already told you that I’m not going back to debug something I wrote as a spoof.–Kemanorel

    Read: the 100 level toy program is too difficult for you.

    At least you figured out how to do the >. You’re welcome. Now if you could only figure out how to do <.

    “You have shamed the entire computer science community. F*cking Ritchie, everybody.”–paraphrase of something I once read at ERV

  41. #41 Kemanorel
    June 8, 2010

    It’s clear you still don’t even know why Chu-Carrol’s code won’t compile… Screw it, since you have better things to do, I’ll just tell you the answer: {}.

    Why are you getting stuck on it compiling? That is not the point of the snippet. Talk about missing the point completely.

    Read: the 100 level toy program is too difficult for you.

    I essentially just gave you the solution to a much harder problem and you completely ignored it in favor of going back to sudoku? You seem to have a huge hang up for tiny scraps of code meant to demonstrate and not actually run.

    Either provide code for a solution to a substantial problem or just gtfo. I’m done arguing with someone who’s done nothing to establish any credibility of knowledge on the subject.

  42. #42 William Wallace
    June 8, 2010

    I essentially just gave you the solution to a much harder problem and you completely ignored it in favor of going back to sudoku?–Kemanorel

    Prove it. The sudoku problem I provided had 17 out of 81 clues.

    BTW, I especially like your comments

    //total up score for each column
    totalscoreX = …

    Only a master computer scientist like yourself would leave clues like you did in that comment for those who have to read the assignments that follow.

    Or, as an alternative explanation, it looks like somebody programmed you to write pointless comments. Who was your programmer?

  43. #43 Kemanorel
    June 8, 2010

    Prove it. The sudoku problem I provided had 17 out of 81 clues.

    ROFL

    Only a master computer scientist like yourself would leave clues like you did in that comment for those who have to read the assignments that follow.

    Really? Attacking my documentation is the best you can do?

    I’m sorry that my documentation like “//reset” followed by a bunch of variables being set to 0 is so hard for you to understand.

    Seriously, if you can’t understand by looking at the output that this…

    //total up score for each column
    totalscoreX = totalscoreX + totalXtokens + bonusX;
    totalscoreO = totalscoreO – totalOtokens – bonusO;

    … is calculating a score for the X and O tokens on the game board then we’re done. You’re being intentionally stupid, grasping any pathetic little excuse you possible can.

    ROFL.

    AND you still haven’t done damn thing to show you have any kind of expertise in the matter. You claim you’ve done this and that and you’re so great, but you still haven’t done a single damn thing to convince anyone you know wtf you’re talking about.

    ROFL.

  44. #44 William Wallace
    June 9, 2010

    Ignorance is bliss.

  45. #45 Stephen Wells
    June 9, 2010

    Willy, why don’t you post at least part of a program, that you wrote, that does something. That would improve the conversation a bit.

    To get the ball rolling, here’s a little bit of one of mine:

    ////////////////////////////////////////////////////////////////////////////////
    // Description: The geometric fitting of ghosts to atoms. Fits ghost bodies over
    // real atoms using rotor equations
    ////////////////////////////////////////////////////////////////////////////////
    void Froda::fitGhosts(){

    //LABELFIT
    double step;
    int atoma;
    double small_grad_square =pow(smallgrad,2);
    bool update_base=false;
    register double pmet; // one over temp

    Vector grad0, grad1; //gradients here and at x+sigma d
    double g02, g12; // moduli squared
    double alpha; // step length from line minim
    Vector trial; // trial rotor value

    // Turn atoms positions into a new posCentralit and target bonds
    // rotor-fit the ghost bonds to the target bonds
    // apply the rotor so that current ghost is in the right place and orientation

    // the new posCentral comes from the currentPos of the atoms
    // the ideal bonds are in ghost_bondVector
    // the real bonds are made from currentPos
    // the rotated ideal bonds go into ghost_pos

    unsigned int ghost_size;

    double aweight = 0.0;

    for( unsigned int clusterNumber = 2; clusterNumber < = myNClusters; clusterNumber++ ){

    //cerr << "Cluster number: " << clusterNumber << endl;

    ghost.at(clusterNumber).posCentral.x=0;
    ghost.at(clusterNumber).posCentral.y=0;
    ghost.at(clusterNumber).posCentral.z=0;

    ghost_size = ghost[clusterNumber].bodysize;

    //redefine the bond vectors if the weights have changed
    //the change of central pos is sum ( new weight * bondvector ) / sum ( new weight )
    //////////////////////////////////////////////////////////////////////
    if ( ghost[clusterNumber].changedWeight ) {
    if ( ghost[clusterNumber].bodysize == 1 )
    continue;
    Vector newC = NULL_VEC;
    ghost.at(clusterNumber).bodyweight = 0;
    ghost.at(clusterNumber).radMS = 0;

    for( unsigned int ghostVertex = 0; ghostVertex < ghost_size; ghostVertex++ ){
    atoma = ghost[clusterNumber].atoms.at(ghostVertex);
    //double aweight = frodaAtom.at(atoma).weight;
    aweight = frodaAtom.at(atoma).weight;
    ghost.at(clusterNumber).bodyweight += aweight;

    newC.x += aweight * ghost[clusterNumber].bondVector[ghostVertex].x;
    newC.y += aweight * ghost[clusterNumber].bondVector[ghostVertex].y;
    newC.z += aweight * ghost[clusterNumber].bondVector[ghostVertex].z;
    }
    newC.x /= ghost.at(clusterNumber).bodyweight;
    newC.y /= ghost.at(clusterNumber).bodyweight;
    newC.z /= ghost.at(clusterNumber).bodyweight;

    //this newC change is due to reweighting, not motion
    //so pass into CM function
    ghost.at(clusterNumber).oldPosCentral.x += newC.x;
    ghost.at(clusterNumber).oldPosCentral.y += newC.y;
    ghost.at(clusterNumber).oldPosCentral.z += newC.z;
    ghost.at(clusterNumber).olderPosCentral.x += newC.x;
    ghost.at(clusterNumber).olderPosCentral.y += newC.y;
    ghost.at(clusterNumber).olderPosCentral.z += newC.z;

    //cerr << "Center of body " << clusterNumber << " reweighted by ";
    //cerr << newC.x << " " << newC.y << " " << newC.z << endl;

    for( unsigned int ghostVertex = 0; ghostVertex < ghost_size; ghostVertex++ ){
    ghost[clusterNumber].bondVector[ghostVertex].x -= newC.x;
    ghost[clusterNumber].bondVector[ghostVertex].y -= newC.y;
    ghost[clusterNumber].bondVector[ghostVertex].z -= newC.z;

    double rad2 = dotProduct( ghost[clusterNumber].bondVector.at(ghostVertex),
    ghost[clusterNumber].bondVector.at(ghostVertex) );

    atoma = ghost[clusterNumber].atoms.at(ghostVertex);
    aweight = frodaAtom.at(atoma).weight;
    ghost.at(clusterNumber).radMS += aweight * rad2;
    }
    ghost.at(clusterNumber).radMS /= ghost.at(clusterNumber).bodyweight;
    ghost.at(clusterNumber).radRMS = sqrt(ghost.at(clusterNumber).radMS);
    }

    for (unsigned int ghostAtomNumber=0; ghostAtomNumber < ghost_size; ghostAtomNumber++){
    atoma = ghost[clusterNumber].atoms.at(ghostAtomNumber);
    aweight = frodaAtom.at(atoma).weight;
    ghost.at(clusterNumber).posCentral.x += aweight * currentPos.at(atoma).x;
    ghost.at(clusterNumber).posCentral.y += aweight * currentPos.at(atoma).y;
    ghost.at(clusterNumber).posCentral.z += aweight * currentPos.at(atoma).z;
    }

    pmet = 1.0/ghost.at(clusterNumber).bodyweight;
    ghost.at(clusterNumber).posCentral.x *= pmet;
    ghost.at(clusterNumber).posCentral.y *= pmet;
    ghost.at(clusterNumber).posCentral.z *= pmet;

    for( unsigned int ghostAtomNumber = 0; ghostAtomNumber < ghost_size; ghostAtomNumber++ ){
    atoma = ghost[clusterNumber].atoms.at(ghostAtomNumber);
    ghost[clusterNumber].posAtom.at(ghostAtomNumber).x = currentPos.at(atoma).x - ghost.at(clusterNu
    mber).posCentral.x;
    ghost[clusterNumber].posAtom.at(ghostAtomNumber).y = currentPos.at(atoma).y - ghost.at(clusterNu
    mber).posCentral.y;
    ghost[clusterNumber].posAtom.at(ghostAtomNumber).z = currentPos.at(atoma).z - ghost.at(clusterNu
    mber).posCentral.z;
    }

    }

    // Now find the rotor that matches the ghost_bondVector bonds to posAtom
    // use a line minimiser (secant method)

    for( unsigned int clusterNumber = 2;clusterNumber <= myNClusters ; clusterNumber++ ){
    ghost_size = ghost[clusterNumber].bodysize;

    if ( ghost_size == 1){ // single-site ghost
    ghost.at(clusterNumber).pos.at(0).x = currentPos.at( ghost[clusterNumber].atoms.at(0) ).x;
    ghost.at(clusterNumber).pos.at(0).y = currentPos.at( ghost[clusterNumber].atoms.at(0) ).y;
    ghost.at(clusterNumber).pos.at(0).z = currentPos.at( ghost[clusterNumber].atoms.at(0) ).z;

    continue;
    }
    rotor = ghost.at(clusterNumber).runningRotor;
    update_base = false;

    step = 1/ (2.0*ghost.at(clusterNumber).bodyweight * ghost.at(clusterNumber).radMS);

    for(unsigned int rotorCycle=0; rotorCycle < maxRotorCycles ; rotorCycle++){

    bool leave = false;

    grad0 = NULL_VEC;
    grad1 = NULL_VEC;

    for(unsigned int ghostAtomNumber = 0; ghostAtomNumber < ghost_size; ghostAtomNumber++ ){

    atoma = ghost[clusterNumber].atoms.at(ghostAtomNumber);

    // BMH 8/30/06 - replaced next 7 lines with getGradient function
    //////////////////////////////////////////////////////////////////////
    //aweight = frodaAtom.at(atoma).weight;
    //dot = deps2dbx(ghost[clusterNumber].bondVector.at(ghostAtomNumber), ghost[clusterNumber].pos
    Atom.at(ghostAtomNumber), rotor);
    //grad0.x += aweight *dot;
    //dot = deps2dby(ghost[clusterNumber].bondVector.at(ghostAtomNumber), ghost[clusterNumber].pos
    Atom.at(ghostAtomNumber), rotor);
    //grad0.y += aweight *dot;
    //dot = deps2dbz(ghost[clusterNumber].bondVector.at(ghostAtomNumber), ghost[clusterNumber].pos
    Atom.at(ghostAtomNumber), rotor);
    //grad0.z += aweight *dot;

    grad0 += getGradient( frodaAtom.at(atoma).weight,
    ghost[clusterNumber].bondVector.at(ghostAtomNumber),
    ghost[clusterNumber].posAtom.at(ghostAtomNumber),
    rotor );
    } // end loop over atoms

    //grad0 is the gradient at this point

    g02 = dotProduct(grad0, grad0);
    if(g02 < small_grad_square){
    leave = true;
    }

    if (leave) break; //already good enough

    //form an experimental step and get the new gradient;
    tempvec.x = step*grad0.x;
    tempvec.y = step*grad0.y;
    tempvec.z = step*grad0.z;

    dot = ( dotProduct(tempvec,tempvec));
    if (dot > large_rotor_2){ // too big clusterNumber step
    tempvec.x *= large_rotor_2/dot;
    tempvec.y *= large_rotor_2/dot;
    tempvec.z *= large_rotor_2/dot;
    }
    trial.x = rotor.x – tempvec.x;
    trial.y = rotor.y – tempvec.y;
    trial.z = rotor.z – tempvec.z;

    //calculate the gradient at the trial position

    //for( unsigned int ghostAtomNumber = 0; ghostAtomNumber < ghost_size; ghostAtomNumber++ ){
    for( unsigned int ghostAtomNumber = 0; ghostAtomNumber < ghost[clusterNumber].atoms.size(); ghos
    tAtomNumber++ ){
    atoma = ghost[clusterNumber].atoms.at(ghostAtomNumber);

    // BMH 8/30/06 - replaced next 7 lines with getGradient function
    //////////////////////////////////////////////////////////////////////
    //aweight = frodaAtom.at(atoma).weight;
    //dot = deps2dbx(ghost[clusterNumber].bondVector.at(ghostAtomNumber), ghost[clusterNumber].pos
    Atom.at(ghostAtomNumber), trial);
    //grad1.x += aweight *dot;
    //dot = deps2dby(ghost[clusterNumber].bondVector.at(ghostAtomNumber), ghost[clusterNumber].pos
    Atom.at(ghostAtomNumber), trial);
    //grad1.y += aweight *dot;
    //dot = deps2dbz(ghost[clusterNumber].bondVector.at(ghostAtomNumber), ghost[clusterNumber].pos
    Atom.at(ghostAtomNumber), trial);
    //grad1.z += aweight *dot;

    grad1 += getGradient( frodaAtom.at(atoma).weight,
    ghost[clusterNumber].bondVector.at(ghostAtomNumber),
    ghost[clusterNumber].posAtom.at(ghostAtomNumber),
    trial );

    } // end loop over atoms

    //grad1 is the gradient at the trial position;
    g12 = dotProduct(grad1, grad1);
    if(g12 < small_grad_square){
    leave = true;
    rotor = trial;
    }

    if (leave) break; //the trial position is good- carry on

    //if we get this far, then we need to calculate clusterNumber step and iterate again
    //we are either in the quadratic regime or not
    //so either steepest-descent or secant
    //if using SD, we already have our tempvec step
    //if using secant, recalculate

    if ( (rotorCycle > 2) && (g12 < g02)) { //use secant
    alpha = 1.0 / (1.0 - (dotProduct(grad0, grad1)/(g02)));

    tempvec.x *= alpha;
    tempvec.y *= alpha;
    tempvec.z *= alpha;
    }

    dot = ( dotProduct(tempvec,tempvec));
    if (dot > large_rotor_2){ // too big clusterNumber step
    //cout < < "Body " << clusterNumber << " has rotor step " << dot << "; Rotor " << rotor.x << "
    , " << rotor.y << ", " << rotor.z << endl;
    tempvec.x *= large_rotor_2/dot;
    tempvec.y *= large_rotor_2/dot;
    tempvec.z *= large_rotor_2/dot;
    }

    //Finally - rotor update

    rotor.x -= tempvec.x;
    rotor.y -= tempvec.y;
    rotor.z -= tempvec.z;

    dot = dotProduct (rotor, rotor);
    if (dot > large_rotor_2) update_base=true;

    // if the rotor is large, redefine the ghost_pos_base to the new orientation

    if (update_base){
    //cerr << “Updating ghost for body ” << clusterNumber << ” at ” << rotorCycle+1 << ” ” << fit
    Cycles << endl;
    myX = Xval(rotor);
    for( unsigned int ghostSiteNumber = 0; ghostSiteNumber < ghost_size; ghostSiteNumber++ ){
    //tempvec.x = epsx(ghost[clusterNumber].bondVector.at(ghostSiteNumber), 0.0, rotor, myX);
    //tempvec.y = epsy(ghost[clusterNumber].bondVector.at(ghostSiteNumber), 0.0, rotor, myX);
    //tempvec.z = epsz(ghost[clusterNumber].bondVector.at(ghostSiteNumber), 0.0, rotor, myX);
    tempvec.x = epsx(ghost[clusterNumber].bondVector[ghostSiteNumber], 0.0, rotor, myX);
    tempvec.y = epsy(ghost[clusterNumber].bondVector[ghostSiteNumber], 0.0, rotor, myX);
    tempvec.z = epsz(ghost[clusterNumber].bondVector[ghostSiteNumber], 0.0, rotor, myX);

    //ghost[clusterNumber].bondVector.at(ghostSiteNumber).x = tempvec.x;
    //ghost[clusterNumber].bondVector.at(ghostSiteNumber).y = tempvec.y;
    //ghost[clusterNumber].bondVector.at(ghostSiteNumber).z = tempvec.z;
    ghost[clusterNumber].bondVector[ghostSiteNumber].x = tempvec.x;
    ghost[clusterNumber].bondVector[ghostSiteNumber].y = tempvec.y;
    ghost[clusterNumber].bondVector[ghostSiteNumber].z = tempvec.z;
    }
    ghost[clusterNumber].baseRotor.x += rotor.x;
    ghost[clusterNumber].baseRotor.y += rotor.y;
    ghost[clusterNumber].baseRotor.z += rotor.z;
    rotor.x = rotor.y = rotor.z =0.0;
    update_base =false;
    }

    } // end loop over iterations

    // create ghost_pos with the new target positions for the atoms

    myX = Xval(rotor);
    ghost.at(clusterNumber).runningRotor = rotor;
    for( unsigned int ghostNumber = 0; ghostNumber < ghost_size; ghostNumber++ ){
    //ghost[clusterNumber].pos.at(ghostNumber).x = epsx(ghost[clusterNumber].bondVector.at(ghostNumb
    er), 0.0, rotor, myX) + ghost.at(clusterNumber).posCentral.x;
    //ghost[clusterNumber].pos.at(ghostNumber).y = epsy(ghost[clusterNumber].bondVector.at(ghostNumb
    er), 0.0, rotor, myX) + ghost.at(clusterNumber).posCentral.y;
    //ghost[clusterNumber].pos.at(ghostNumber).z = epsz(ghost[clusterNumber].bondVector.at(ghostNumb
    er), 0.0, rotor, myX) + ghost.at(clusterNumber).posCentral.z;
    ghost[clusterNumber].pos.at(ghostNumber).x = epsx(ghost[clusterNumber].bondVector[ghostNumber],
    0.0, rotor, myX) + ghost.at(clusterNumber).posCentral.x;
    ghost[clusterNumber].pos.at(ghostNumber).y = epsy(ghost[clusterNumber].bondVector[ghostNumber],
    0.0, rotor, myX) + ghost.at(clusterNumber).posCentral.y;
    ghost[clusterNumber].pos.at(ghostNumber).z = epsz(ghost[clusterNumber].bondVector[ghostNumber],
    0.0, rotor, myX) + ghost.at(clusterNumber).posCentral.z;
    }

    } // end loop over clusters

    return;
    }

    Oh look, it does math and has comments in it.

    The code this came from has earned me about $5000 so far in licence fees from pharma companies.

    Your move, Willy.

  46. #46 Kemanorel
    June 9, 2010

    Ignorance is bliss.

    Only if you’re happier to live in delusion than reality…
    I find reality much more satisfying than any delusion.

    I guess that explains a lot about the difference between you and me.

  47. #47 Monado
    June 10, 2010

    Meanwhile, does anyone use/like R for stats?

  48. #48 William Wallace
    June 11, 2010

    Your move, Willy–Stephen Wells

    I must say at first blush I am much more impressed with your coding abilities and coding style than Kemanorel’s ability to do anything other than get lost. I am surprised that you’ve actually entered a pissing match though. I thought you were a bit more mature than that. The only criticism I have, and it’s not that big of a deal as I used to do it too, is your use of register. Modern compiliers are usually so good that anything you do to try to help can at best do no harm. I certainly would give it a shot if there were a bottleneck, but I’d likely remove it after comparing the code generated with and without such help, if the hint provided no advantage.

    In any event, you don’t get pearls. Those cost money. Here is a toy program I was going to share with a math teacher who suggested a classroom demonstration to teach high school kids that their naive intuition fails when considering the Monty Hall problem. The math teacher’s blog post is THE ANSWER TO THE MONTE [sic] HALL PROBLEM. I wrote it in about 5 or 10 minutes. I never shared the program because she seemed to understand the mathematical equations I used to prove my point.

    Yes, it’s trivial. Yes it uses more memory than necessary (but memory is cheap these days).

    Anyway, the program was a supplement to a reply to her suggestion, in which I showed mathematically that the suggested demonstration was risky, in that 14.44% of the time, the demonstration would corroborate the students intuition, and 2.14% it would absolutely convince a student that his intuition was correct, becuase switching doors wouldn’t provide any advantage whatsoever.
    /* include your own damn libraries */
    #define NUM_RUNS ((long)100000)
    #define TRIALS_PER_RUN ((long)40)
    int main()
    {
      long int i;
      long int j;
      long int swc; /* switch win count */
      long int swc_array[NUM_RUNS];
      long int swcrhg[TRIALS_PER_RUN+1]; /* switch win run histogram */
      long int tmp_wc; /* for calculating range win counts */

      /* seed rand with current time*/
      srand((unsigned int)time(NULL));
      for(i=0;i<NUM_RUNS;i++){
        for(j=0,swc=0;j<TRIALS_PER_RUN;j++){    
          if((rand()%3) != (rand()%3)){
            /* you didn’t win on the first pick, so by MHP rules, you */
            /* will win if you switch, so increment switch win count */
            swc++;
          }
        }
        swc_array[i]=swc;
      }
      /* initialize histograms to 0 */
      for(i=0;i<=TRIALS_PER_RUN;i++)/* 0 to 40 wins */
        swcrhg[i]=0;
      /* calculate histograms */
      for(i=0;i<NUM_RUNS;i++)
        swcrhg[swc_array[i]]++;
      printf(“Switch wins   No Switch Wins Occurances Percentage\n”);
      printf(“———–   ————– ———- ———-\n”);
      for(i=0;i<=TRIALS_PER_RUN;i++) /* 0 to 40 wins */
        printf(“%2d            %2d                  %5d    %6.3f%%\n”,i,TRIALS_PER_RUN-i,swcrhg[i],(float)swcrhg[i]/(float)NUM_RUNS*100.0);  
      /* calculate count of TRIALS_PER_RUN/2 or fewer wins */
      for(i=0,tmp_wc=0;i<=TRIALS_PER_RUN/2;i++) 
        tmp_wc +=swcrhg[i];
      printf(“\n%02d or fewer wins by switching %5d percentage %6.3f%%.\n”,TRIALS_PER_RUN/2,tmp_wc,(float)tmp_wc/(float)NUM_RUNS*100.00);
      /* calculate the count of 23 or fewer wins (assuming 40) */
      /* 0-TRIALS_PER_RUN/2 were already counted, so continue… */
      for(i=TRIALS_PER_RUN/2+1;i<=23;i++)
        tmp_wc +=swcrhg[i];
      printf(“\n23 or fewer wins by switching %5d percentage %6.3f%%.\n”,tmp_wc,(float)tmp_wc/(float)NUM_RUNS*100.00);
      return 0;
    }

  49. #49 William Wallace
    June 11, 2010

    P.S. The reply with equations I refrenced above was a blog post on my blog, which required the use of LaTeX to get equations to display properly. The relevent equations (in non-LaTeX format) are:

    P(X≤20)=SUM(i=0,20,COMB(40,i)*(2/3)^i*(1/3)^(40-i))
    P(X≤23)=SUM(i=0,23,COMB(40,i)*(2/3)^i*(1/3)^(40-i))

    Where SUM(i=a,b,c) is the summation of c from i=a to b, and where COMB(n,k) = n!/((n-k)!*k!)

  50. #50 Steve Johnston
    April 5, 2011

    You can actually try to advance biology from within computer science.

    Please take a look at my blog at:
    http://softwarephysics.blogspot.com/

    Below are some of the posts that deal with the long-term evolution of software from a biological perspective that might shed some light on the origin and evolution of life as well:

    Self-Replicating Information
    http://softwarephysics.blogspot.com/2008/06/new-introduction-to-softwarephysics.html

    SoftwareBiology
    http://softwarephysics.blogspot.com/2008/06/introduction-to-softwarephysics-ii.html

    When Toasters Fly
    http://softwarephysics.blogspot.com/2010/09/new-introduction-to-softwarephysics.html

    The Adaptationist View of Software Evolution
    http://softwarephysics.blogspot.com/2010/11/new-introduction-to-softwarephysics.html

    Software Symbiogenesis
    http://softwarephysics.blogspot.com/2008/07/introduction-to-softwarephysics-ii.html

    A Proposal For All Practicing Paleontologists
    http://softwarephysics.blogspot.com/2009/04/new-introduction-to-softwarephysics.html

    Regards,
    Steve Johnston

The site is currently under maintenance and will be back shortly. New comments have been disabled during this time, please check back soon.