Chapter 4
Algorithms and Data Structures
Section 5
Level 4 - Problem 4
Write a program that implements Richard Dawkins' weasel computer simulation, described in Dawkins' words as follows (The Blind Watchmaker, chapter 3): We again use our computer monkey, but with a crucial difference in its program. It again begins by choosing a random sequence of 28 letters, just as before ... it duplicates it repeatedly, but with a certain chance of random error – 'mutation' – in the copying. The computer examines the mutant nonsense phrases, the 'progeny' of the original phrase, and chooses the one which, however slightly, most resembles the target phrase, METHINKS IT IS LIKE A WEASEL.