Testing Evolution – How to Do It

Sketch by Leonardo da Vinci

This is part of a series: Testing Evolution

This post is mainly written for anyone who wants to duplicate my results.  I’ll try to make it accessible to non-geeks, but there are a lot of technical details.

Summary:

  • I used an evolution simulator to test evolution because that was the easiest way to do it with my skill set
  • My big insight: mutation and natural selection are, for lack of a better term, platform-independent
  • I clarify what exactly mutation and natural selection are, and why I can do the same process to self-copying programs
  • I give examples of other evolutionary algorithms, to give an idea of what most of their authors’ goals are and how they write them
  • I list the main differences between my algorithm and most evolutionary algorithms
    1. They do artificial selection, while mine does natural selection
    2. They usually make their creatures a collection of settings or useful attributes, while I made mine actual programs written in a general-purpose programming language
    3. They mutate as few things as practical, while mine mutates the entire creature’s source code
    4. They reward small, but insignificant improvements, while mine only rewards changes that significantly improve a creature’s ability to spread its genes
    5. They put the creature copier in the simulator, while I put it in each creature

I wanted to test Atheism by testing evolution, but I needed to decide how.

Should I have become an expert in geology and fossilology, to see if the fossil record really fits evolution?  Should I have studied population genetics, and built the world’s most advance mathematical model or numerical simulator of a population of living things, to see what really happens under realistic conditions?  Should I have studied biochemistry, and tested whether it’s even possible for a living thing to appear by only natural, chemical processes?

All of these would probably work, but they require a huge commitment of time, energy, and thought.  The only people who can do them are the greatest of geniuses – the kind who is right even when everyone else thinks they’re wrong.  I’m no dummy, but I didn’t think I was smart enough to do that.  Also, I didn’t want to devote my entire career to testing evolution.  I wanted something that was conclusive and provably correct, but could be done with the knowledge and skills that I had, in a reasonable amount of time.

The most advanced skills I had that were useful for testing evolution were:

  • Good reading comprehension
    I didn’t know what all the big words in every scientific paper meant, but the complicated sentences weren’t a problem
  • Computer programming
    I knew a programming language well enough that if I could figure out a way to test evolution in software, I’d be able to write the code to do it

It turned out that these skills were enough.

My big insight was that the process that causes evolution can be done to many other things as well – including self-copying programs.  Thus, if I did the same process to self-copying programs, I should get the same result as I’d get from breeding living things – provided that I make the creatures and their environment similar enough to reality in the right ways.

Now I needed to figure out how to do that process to living things.  Here’s what causes evolution:

  • Mutation
  • Natural Selection

Both of these are simple and easy to understand.  Mutation is the fancy biological jargon for data corruption.  If your hard drive is dying, it might mutate that presentation you’re working on.  If you copy something down and make a typo, you’ve mutated it.  I can make the same thing happen to self-copying programs by making it so every time a creature runs, there’s a chance that the simulator will change its source/binary at random.

Natural selection is also pretty simple, but it takes a little more explanation.

Natural selection is a play on words.  Charles Darwin’s big insight was that nature can do something very similar to selective breeding.  Farmers often breed their crops and their animals to have traits that they want, like bigger yield or resistance to disease.  They grow a generation, decide which ones are the best, and only let the best ones breed.  But what happens if you take away the farmer?  Does everything grow without limit?  Of course not.

Instead, some creatures – for any of a million reasons – will be more likely to survive and have kids.  Perhaps they’re bigger than the rest, or better-looking, or more resistant to disease.  Whatever the exact reason happens to be, those which are best at surviving and spreading their genes will become most common.  They might even drive all the others extinct.  This effect is similar to what you’d get if a farmer was breeding his crops and animals for the most resilience and the most descendents.  It’s as if nature itself was selectively breeding everything that lives in it – no intelligence required.  Thus, Darwin called this phenomenon “Natural Selection”.

So how could I do this to self-copying programs?  I simply didn’t write a fitness function.  Instead, I just put the creatures in whatever their native environment was, and ran them with as few restrictions as practical.

What’s a fitness function?  It’s a piece of software that gives every creature a score/grade.  The simulator then only lets the top X% to survive to the next round, and makes extra copies of the best of the best to fill the space that the unfit had taken.  Nowadays, evolutionary algorithms usually have more sophisticated ways of deciding which creatures survive, but they follow this same basic pattern.

This leads to a very important point: my evolution simulator is significantly different from most evolutionary algorithms.  For my goal of testing evolution, it’s much better.  But that doesn’t necessarily mean that I’m a better programmer than the authors of other evolutionary algorithms.  Neither does it necessarily mean that they did a bad job, or that they’re dishonest in any way.  All it means is that my goal is a very unusual one, and thus my algorithm is unusual.

For starters, to give you an idea of what evolutionary algorithms are used for, here are some examples:

Here are some of the main differences between most evolutionary algorithms and mine.  Keep in mind that my goal was to test evolution, and thus Atheism.  The general principle that I followed was “do what nature does, don’t do what nature doesn’t do”; I was not trying to rig the simulator to cause open-ended evolution.  If evolution works as advertised, I shouldn’t need to.

  1. They do artificial selection, while mine does natural selection
    Why it matters:

    • In nature, the only goal is survival.  For the purpose of engineering, survival is a very vague goal.  Vague goals make it harder to accomplish things, because the vaguer the goal, the more “solutions” technically fit it, but aren’t useful in practice.
    • This significantly affects how much a creature evolves.  Unless the exact method of artificial selection acts very similarly to natural selection in the wild, it’ll throw off the result
    • In artificial selection, the goal can be as specific as the engineer wants it to be.  Usually, a fitness function measures 1 or more specific traits, like the range of frequencies that an antenna catches.
    • Depending on how you look at it, natural selection is either what happens if you make an evolutionary algorithm with no fitness function, or it’s what happens when the environment is the only fitness function.  In either case, it makes sense to use the fitness function that natural selection uses.
  2. They usually make their creatures a collection of settings or useful attributes, while I made mine actual programs written in a general-purpose programming language
    Why it matters:

    • The genetic code is just that: code (in the sense of computer code).  The more that scientists learn of it, the more it looks like the operating system of a computer, complete with protein files that are sent to the 3D printers that we call ribosomes.  Thus, to accurately test evolution, it makes sense to use actual code in a general-purpose programming language.
    • A general-purpose programming language makes it possible, in theory, to make many more kinds of programs than a typical string of settings
    • It’s easier to write, so long as the programming language that you use gives you a way to:
      • Generate and run arbitrary code at runtime
      • Prevent rogue code from breaking the simulator
  3. They mutate only the things that are most relevant for getting results, while mine mutates the entire creature’s source code
    Why it matters:

    • Nature doesn’t have the luxury of optimizing natural selection.  Instead, real mutations happen to the thing that the data is stored on, without caring if the resulting code works.
    • If you restrict the list of things that mutate – and the way that they mutate – to changes that are guaranteed to be valid code, you greatly increase the chance of success compared to what happens in nature.  This makes its results significantly different from what happens in nature
      In contrast, there are 3 ways that most evolutionary algorithms mutate things.  Most of them are significantly different from what happens in nature:

      1. Adjust random settings by a small amount
      2. Add/remove/rearrange logical blocks of code
      3. Pull code/settings from 2 creatures to form a new one, in a way that’s similar to the sexual reproduction
  4. They reward small, but insignificant improvements, while mine only rewards changes that significantly improve a creature’s ability to spread its genes
    Why it matters:

    • The normal strategy of relative grading goes a long way toward helping evolution get started, but nature doesn’t work this way.  Thus, it significantly throws off the result
    • In the real world, there’s a minimum level of performance that you or any living creature can have.  If you drop below it, you die
    • My way raises the bar for survival, compared to most evolutionary algorithms
    • My creatures can actually all die out
    • Relative grading also gets rid of the problem of near-neutral mutations, which tend to to cause devolution.  This turned out to be what dominates in the long run, but most evolutionary algorithms would miss this.
  5. They put the creature copier in the simulator, while I put it in each creature
    Why it matters:

    • Putting the copy machine in the simulator is a good optimization for almost all other possible uses for evolutionary algorithms, but nature doesn’t do it.  The very fact that it is an optimization that affects how well evolution works means that if you’re trying to test evolution, you shouldn’t do it
    • Putting the copy machine inside of each creature raises the bar for performance, because in order to survive, each creature must successfully do its job.  In the real world, 1% of a cell, copied from its ancestor before it died, will not survive.  In a typical evolutionary algorithm, though, this would be enough, provided that it was better than its competitors.

I hope that this post series will intrigue/provoke someone enough to write their own version of it.  Don’t just take my word for it, try it yourself.  If you stick closely to the principles I gave here, I expect that you’ll get the same result that I did.  Here are a few miscellaneous pointers:

  • Read up on Muller’s Ratchet
  • Find, read, and understand some well-reasoned arguments and solid evidence from both Creationists and Evolutionists
    This will help you properly understand the controversy, and it’ll help you to correctly interpret the results.
  • Pay especially close attention to what happens when evolutionary biologists do experiments on actual living things.  As far as I can tell, they consistently run into devolution.  If there were exceptions, I’m sure that they’d talk about them.
  • Compare the results that evolutionary biologists get in the the lab with the results of their simulations and mathematical models.  You’ll find that the simulations and models are all over the board.  Most of them predict devolution, but a large minority predicts that devolution won’t eventually cause extinction.
  • If you get a different result, compare the way you built yours with the way I built mine, and also with what happens in experiments on living things.

If anyone does re-implement my simulator, please tell me.  I’d love to see how you built it and what the results are.

Here are starter links for learning more about Muller’s Ratchet:

For more info on evolutionary algorithms:

This is part of a series: Testing Evolution

Photo credit:

Wikimedia Commons

Advertisements

6 thoughts on “Testing Evolution – How to Do It

What do you think?

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s