Evolution and Arithmetic

Chapter 8: Weasels

← Nonsense Preferred to NonsenseThirty-Six Amino Acids →

A Simulation of Our Own

We've now seen how the Weasel program creates an illusion of ease by hiding most of what actually makes cumulative selection difficult. Essentially, smoke and mirrors. So let's build a simulation of our own, aimed at capturing some of the real issues evolution has to face.

The first thing to do is run the classic Weasel setup: 27 characters, 28 positions, the same target. We'll even deliberately use a rule that locks a position the moment it receives the right letter, since in effect that is what Weasel does for the most part. But instead of counting generations of whole populations, we'll count every single random change along the way, whether or not it ends up being kept.

Here's how it works. Start with a random string of 28 characters, and the same goal as Weasel: METHINKS IT IS LIKE A WEASEL. The computer picks one of the 27 characters at random, and one of the 28 positions at random. Unless that position is locked, the character sitting there is replaced with the new one. The moment a position receives its correct character, it locks, and can never change again; every position not yet locked stays open to change. This very loosely mimics point mutation and selection: a change that matches the target is treated as beneficial, makes its carrier more competitive, and is kept for good; any other change is treated as neutral, and can be overwritten later.

A single run took 2,769 draws to finish. Running it 100 times gave an average of 2,860 draws, with a low of 1,508 and a high of 6,724. Each draw stands for a single mutation — compare that with the forty-odd "generations" of the Weasel version. (The method and all the results: The Lock Simulations.)

Now let's translate that result into the language of biology. Proteins aren't built from a 27-character alphabet; they're built from 20 amino acids. With fewer choices at each position, a target of the same length is easier to hit. To get a fair, equally difficult comparison, we can change the alphabet to 20 characters and try different lengths, to see what length takes as long as the Weasel case. At 36 positions, the average came out to 2,779 draws (low 1,377, high 5,799); at 37 positions, 2,992 draws (low 1,612, high 5,690). Both land in essentially the same range as the original 28-position, 27-character result. So a target of 36 or 37 amino acids is the fair protein equivalent of the 28-letter English target Dawkins used.

Last revised 2026-11-19

← Nonsense Preferred to NonsenseThirty-Six Amino Acids →