Your company's Logo


Weasel Program


This software app is an evolution simulation based on the evolution program in Richard Dawkins' book, The Blind Watchmaker, that shows the process of natural selection. The program got its name from Dawkins using the phrase from Shakespere, "METHINKS IT IS LIKE A WEASEL" in the progam.


Environment - This is the most "Fittest" that our letters can be. I call it the "Environment" because it represents the natural environment that a living body is in. There is a process of "conforming". I prefer not to call it the "Target" because that can imply that we are pursuing something in the future. The genes are not pursuing anything, they cannot predict the future, they are just getting weeded out by present reality, and the result is what is left.

Random Start - Our starting set of letters. This random set is changed when the Reset button is pressed.

Current Fittest - The set of letters that currently most conform to the Environment.

Generation - Number of generations produced.

Offspring - Number of offspring to be produced for each generation. The higher this number is the better chance that one of the offspring will be closer to the environment.

Max Generations - Maximum allowed generations to produce. The program will stop when the Current Fittest is equal to the Environment, or the Max Generations limit is reached.

% Mutations - For every offspring, each letter has this much chance of being mutated. If this number is set to high, like over 15%, the mutation rate will be too high and probably no child will ever match the Environment.

Run - Pressing the Run button will start with the random starting letters and keep making new generations until the Current Fittest is equal to the Environment, or the Max Generations limit is reached. The number of generations that were generated will be displayed.


Step - This will make one generation at a time so all the offspring for this generation can be inspected. In the Generations output list, each generation will also list the child that was used as the "Best Fit" for that generation. "(child=49)" means the best fit child in this generation is number 49 in the offspring list. In the Offspring output list, each child lists its fitness value. The fitness value is the number of letters that match the Environment.


Pause/Continue - If the run has enough generations so that it keeps running for a while, the progress can be paused with the Pause button. You can then Step to inspect the children, or press Continue to continue the run.

Reset - This clears everything and creates a new set of random start letters.

Exit - Closes the program.

image2 Help - Brings up the help file in the default web browser.

How it works

It is commonly thought that Dawkins' Weasel program worked like this:

  • 1. Have a target phrase.
  • 2. Have a random phrase.
  • 3. Randomly change the letters in the random phrase.
  • 4. Check to see if any letters are the same as the target phrase.
  • 5. If they are then leave those alone and try again with the remaining letters.

If you made a program like that it would work and always get to the target phrase in around 42 “generations”, which corresponds with what the book said. But there would be something obviously false about that because there is no mechanism in nature to keep mutations out of the "good" genes and only mutate "bad" genes.

But this program is different than that.

There is no mechanism in this program to leave the good letters and only change the bad letters.

We see two lists. One list is the generations most like the target and another list of all the children for each generation. The list of the generations looks just like the list in the display from Dawkins' program, with each generation getting closer to the target and never reverting backwards. But, there is no mechanism in the program to keep the good letters and only change the bad letters. In the list of children you can see each set of letters change randomly. They are just as likely to be farther from the target as closer to the target. But somehow, each generation manages to get nearer and nearer to the phrase we are comparing it to. What weeds them out is the fact that If a living thing is more closely in conformity to its environment, the more likely it is to survive.

Here is the algorithm:

  • 1. Start with a random string of 28 characters.
  • 2. Make 100 copies of this string, with a 5% chance per character of that character being replaced with a random character.
  • 3. Compare each new string with the target "METHINKS IT IS LIKE A WEASEL", and give each a score (the number of letters in the string that are correct and in the correct position).
  • 4. If any of the new strings has a perfect score (28), halt.
  • 5. Otherwise, take the highest scoring string, and go to step 2.

Ver. (8/5/2012)

Free program available in both Windows and Mac versions:

Windows Installation: WeaselSetup.exe

Mac OSX:

Weasel for IOS and Android


Link to GooglePlay


Link to Apple iTunes




Copyright 2012 i-Logic Software. email: Last Modified 08/05/2012