Jon was a Computer Science major at Ohio State University taking a course in artificial intelligence. The professor had set up an interesting group project where each student was responsible for writing an insect program that would be matched against all the other student’s insect programs in a really cool network based insect war simulation environment thing that rocked.

The insect programs had certain constraints set by the professor. Size, shape, speed, and other traits were selected by each student but there were rules such that you couldn’t just turn all the dials to full.

Once the basic properties of the insect were fleshed out, code was written to specify how the insect should act. There was an API for determining where your insect was located on the grid, approximating positions of other insects, moving your insect, attacking, rotating, etc. Pretty standard stuff.

The professor decided to pair students up: one smart kid with one dumb kid; the students who were having a hard time in the class would be able to work closely with a student that was excelling. Each student was responsible for their own insect but they were to debate their designs with each other.

Jon was one of the smart kids and was paired with a kid that wanted to change majors. Jon’s dumb kid rarely attended class and seemed to dislike CS in general. He wasn’t even in class the day the assignment was handed out and so Jon set out on his own to build the coolest and most advanced insect program ever created.

Over the course of a few weeks he burned through code until his insect was capable of responding intelligently to a myriad of changes in environment. It knew to run when outmatched by judging the relative strengths and weaknesses of an opposing insect. It would attempt to strafe and stay behind other insects. It would stay close to corners to reduce the potential attack positions of other insects. It was The Coolest Insect Ever.

The day before the competition, Jon’s dumb kid decided to come to class. Jon asked him if he had finished his insect, to which the dumb kid replied he hadn’t even started but would finish it that day, in class. Jon grinned smugly and tried to explain to the poor fool that he himself had spent all week working on his insect and that it still was not yet complete. The dumb kid shrugged and started in coding something that would get him the damn credit for the project.

Right before the class ended the dumb kid asked Jon to take a look at his insect. Jon had to fight the urge to laugh out loud when he saw that the entire insect was a mere 25 lines of code that barely made it through the compiler and with some lines having no chance of even being executed. The dumb kid had not even configured his insect’s basic set of traits but had left them at the professor provided defaults.

Looking more closely, Jon found that the insect was programmed to do the same thing every time it had a turn to move:

  1. Rotate 90 degrees.
  2. Attack.

Turn and then attack. That’s it? Jon asked, to which the dumb kid replied, Do you think I'll pass?

Jon tried to give the dumb kid some ideas on making his insect more advanced but the dumb kid wasn’t interested. Jon decided that the dumb kid would most assuredly not pass.

The next day the competition was on. The professor loaded up the simulation program and everyone hooked their insects into the system. The dumb kid was late and then couldn’t figure out how to get his insect loaded up. Jon helped him out while mumbling something about futility…

Finally the simulation began and Jon was excited to see his insect perform well through the first full round. In the second round, Jon’s insect would get stuck in one of the corners, enter an infinite loop, and be forcefully removed by the professor. One by one all other insects would be killed by other insects or removed by the professor due to logic problems – that is, all but the dumb kid’s insect.

As he sat watching the dumb kid’s lonely insect turn-and-attack, turn-and-attack, turn-and-attack, as if to mock the whole class, Jon was forced to re-evaluate his definition of cool in relation to computer programs.

This story was told to me by Jon Miller (UNIX sysadmin) in the first person. It has stuck with me as an excellent illustration of the power of simplicity and the devil that is the human tendency toward complexity.

This entry has been tagged python, ramblings, theory, coding — follow a tag for an archive of related essays, weblog entries, and bookmarks.

Discuss

  1. Well… it seems that the simple insect won because the others all turned out to be flawed. I guess simplicity wins in that regard: it’s less susceptible to convoluted errors.

    Anonymous Coward on Tuesday, December 25, 2007 at 04:24 AM #

  2. If'n I was an insect I'd slap your ass up in a tree like a taco norton and you'd be flying so high your cooch would be a roach motel.

    Yabadabadoo Gun’s ‘N’ Roses the unarticulated artichoke.

    Because the world is taste like donkey.

    Ibod Catooga on Tuesday, December 25, 2007 at 06:57 AM #

  3. Alfie on Tuesday, December 25, 2007 at 08:33 AM #

  4. “It has stuck with me as an excellent illustration of the power of simplicity and the devil that is the human tendency toward complexity.”

    Complication, not complexity.

    Bonnie on Tuesday, December 25, 2007 at 09:36 AM #

  5. It’s a bit of a savage idea to pair up the “smart” kids with the “dumb” kids. We did a similar thing on an individual basis using Pyrobot- similar idea, but nonetheless the right one: KISS~. Oh, and subsumption architecture!

    rio on Tuesday, December 25, 2007 at 09:46 AM #

  6. KISS is no solution. KISS means you are only good enough to manage the most basic tasks and fail any time you need to handle complexity.

    If you look at living beings, do you think its KISS, or complexity? If you study how DNA is arranged, sometimes overlapping or spliced at areas you didn’t notice from the mere dataset – do you think its KISS or complex?

    The key lies NOT to focus on KISS but instead focus on managing complexity. And this exact reason is why 500.000 lines of Java code are the totally wrong way to go about.

    she on Tuesday, December 25, 2007 at 11:09 AM #

  7. Good example to illustrate my point. When you have a bunch of nerds who think at a very high level and tend to miss out the most simple stuff. Lesson – when you are with a bunch of nerds, think differently, maybe like a dumb guy in this case. You will beat them all. Many might disagree, but trust me, it works more often than not.

    Venkataramanan S on Tuesday, December 25, 2007 at 01:02 PM #

  8. I've seen something smiliar. I was at a presentation of a students project, where ants should discover a landscape and collect food. One group of students had a very simple approach, where the ants should go randomly in one direction and if they found food, they should bring it home, if they found a barrier, they turn again randomly in an other direction. They hadn’t used the fancy functions like making a scent-line for other ants. etc., and the other students laughed, but in they end, they won the competiton and the other complex programms were not very effective.

    I think this how nature works at this point: if you just look at one ant, their behaviour is not very complex, but a group of ants form a more complex dynamic behaviour.

    namipuk on Tuesday, December 25, 2007 at 01:07 PM #

  9. This whole post is stupid and pointless. The fact that other students in the class are incompetent doesn’t mean the dumb kid is any smarter and/or did the right thing and/or had some insight and/or taught us a lesson. You're looking for some mystery where there is none. And if you look hard enough.. this post happens.

    Just because you chose to do something advanced doesn’t mean you are going to succeed at implementing it. If anything this points to people being overambitious / incompetent.

    NerdPower on Tuesday, December 25, 2007 at 03:18 PM #

  10. Sometimes beating /dev/random is the hardest part :) A.

    Alaric on Tuesday, December 25, 2007 at 04:30 PM #

  11. I think this goes to show not that simplicity is the right answer, but rather the benefits of bottom up development. If the “smart kid” had started from something as simple as the “dumb kid” and built the fancy shit as the exceptions, not the rules he would have done better. Team work is great for bouncing ideas off people even if they are “dumb”. Calling a guy dumb is the quickest was to stick a foot in your own mouth.

    Dave on Tuesday, December 25, 2007 at 08:50 PM #

  12. A few simple rules of behavior when applied in a complex environment will end up creating VERY complex outcomes.

    We all knew this, right?

    What? You people have never understood the driving force behind all those situation comedies you've watched your whole damned lives?

    All most of us ever want to do is drain the swamp, but then we find ourselves up to our asses in alligators, and still you don’t get this author’s point?

    It’s NOT a deterministic world, folks, that’s what chaos theory keeps showing us.

    God doesn’t play dice with the universe GOD is the dice!

    editec on Wednesday, December 26, 2007 at 12:29 PM #

  13. Simple and robust algorithms almost always perform the best. Any strategy that involves a lot of tweaking and fine tuning isn’t going to be robust.

    My guess is that a lot of the over-confident students are going to spend several years proving their cleverness in projects which will often fail, until they eventually mature and realise that life is too short to create fragile stovepipe solutions.

    The turn and attack strategy didn’t deserve to win, but then neither did the others. Simplistic isn’t good either.

    It also goes to show that you should game the system. In that kind of mass brawl, the best strategy is to lay low and let everyone else take each other out. That’s just game theory, and the other contestants should have been aware of it. On the other hand, had the insects been allowed to eat each other like tadpoles (thereby increasing their own strength), then that would have been a different game entirely.

    CG on Wednesday, December 26, 2007 at 05:08 PM #

  14. The posting shows you that you should always start simple and to add things only if they are rigorously tested for compliance to the wants or needs of the program.

    Obviously, the other bugs were never tested to see how they actually worked by the “smart fellows”. However, throwing code together is not always gonna work so well in the long run!

    Look what M$ did to me!

    Clippy on Thursday, December 27, 2007 at 02:52 PM #

  15. I think this is an excellent example of whatever you're trying to say. I look at someone like Hillary Clinton who has no intelligence whatsoever, and would be the worst president ever (after Bill Clinton), but because the reaction to her is so simplistic, she will win.

    Mack Davis on Thursday, December 27, 2007 at 09:50 PM #

Leave a comment





(syntax: markdown)