Dawkins weasel

{{evolution}}
{{quotemine|[[Cdesign_proponentsists|cdesign proponentist's]]}}
In his 1986 book ''The Blind Watchmaker'',<ref>Richard Dawkins: ''The Blind Watchmaker'', 1986, pp. 46-47</ref> [[Richard Dawkins]] presents an algorithm which became known as the '''Dawkins Weasel'''.

==The weasel==
{{quotebox|So much for single-step selection of random variation. What about cumulative selection; how much more effective should this be? Very very much more effective, perhaps more so than we at first realize, although it is almost obvious when we reflect further. 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:

WDLTMNLT DTJBKWIRZREZLMQCO P

It now 'breeds from' this random phrase. 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. In this instance the winning phrase of the next 'generation' happened to be:

WDLTMNLT DTJBSWIRZREZLMQCO P

Not an obvious improvement! But the procedure is repeated, again mutant 'progeny' are 'bred from' the phrase, and a new 'winner' is chosen. This goes on, generation after generation. After 10 generations, the phrase chosen for 'breeding' was:

MDLDMNLS ITPSWHRZREZ MECS P

After 20 generations it was:

MELDINLS IT ISWPRKE Z WECSEL

By now, the eye of faith fancies that it can see a resemblance to the target phrase. By 30 generations there can be no doubt:

METHINGS IT ISWLIKE B WECSEL

Generation 40 takes us to within one letter of the target:

METHINKS IT IS LIKE I WEASEL

And the target was finally reached in generation 43. A second run of the computer began with the phrase:

Y YVMQKZPFfXWVHGLAWFVCHQXYOPY,

passed through (again reporting only every tenth generation):

Y YVMQKSPFTXWSHLIKEFV HQYSPY

YETHINKSPITXISHLIKEFA WQYSEY

METHINKS IT ISSLIKE A WEFSEY

METHINKS IT ISBLIKE A WEASES

METHINKS IT ISJLIKE A WEASEO

METHINKS IT IS LIKE A WEASEP

and reached the target phrase in generation 64. In a third run the computer started with:

GEWRGZRPBCTPGQMCKHFDBGW ZCCF

and reached METHINKS IT IS LIKE A WEASEL in 41 generations of selective 'breeding'.
}}

==In action==
Thanks to the marvels of the modern Internet, you can see the weasel for yourself.<ref>If you want the Dawkins weasel in other computer languages, see the [http://like-a-weasel.blogspot.com/ "like a weasel" blog], which has versions in Python, Perl, Excel VBA, etc.</ref> Click the start button to see the phrase "evolve" before your very eyes!

<center><span class="evolve">METHINKS IT IS LIKE A WEASEL</span></center>

By repeating the process you can begin to get a picture of how evolution can work. Sometimes it happens fast, sometimes slowly. Sometimes it gets a word pretty quick while the rest of the phrase lingers around looking like gibberish. Other times it gets stuck in gibberish land until one tiny kick lets it evolve quickly. Of course, evolution isn't always directional like this, the Weasel program certainly has an aim; to reproduce the exact phrase put into it from randomness and variation. However, [[natural selection]] does favour certain aspects or abilities or traits over others and the Weasel program certainly does simulate this. In the case of the algorithm, it generates an "environment" that favours strings of words that look like ME THINKS IT IS LIKE A WEASEL, just like a green environment would favour green insects as they would camouflage themselves against predators. Thus, when the algorithm runs, it uses random mutation, followed by natural selection, to derive something that is optimal for the environment it's in.

==Implementation==
[[File:Weasel.jpg|thumb|The Dawkins weasel checks out the surroundings before moving in for the kill.]]
The algorithm has been implemented in various programming languages by numerous programmers. Most implementations are quite similar, along the following lines:

#choose random string
#copy string n times with mutation
#take best fitting string
#Stop, if the number of correct letters is 28, otherwise
#goto 2

Step 3 includes the evaluation of a fitness function. Virtually all implementations define the ''best fitting string'' as the one with the most correct letters - a number between 0 and 28.

[[William Dembski]], being a noted intelligent design advocate, chooses another way:

#choose random string
#if all letters are in place: STOP Otherwise:
#mutate letters which are not in place
#goto 2

Surprisingly, Dembski insists that this is the implementation Richard Dawkins used in his book - though Dawkins himself says otherwise. [[Answers in Genesis]] makes the same claim.<ref>http://www.answersingenesis.org/articles/tj/v12/n3/dawkins</ref> The intellectual dishonesty in both cases is obvious as there exist examples of freely available scripts implementing the algorithm which clearly do allow for the mutation of in-place characters.<ref>http://www.cbs.dtu.dk/courses/27615.mol/weasel/weasel.py</ref>

This confusion is doubtless because the fitness function used combined with a small percentage chance of mutations does not encourage regressions in small strings. Using a longer sentence and increasing the mutation chance as high as 10% tends to give regressions in many generations, even to the point where the fittest in the generation is not as fit as its progenitor. High mutation rates take longer to converge on the wanted solution, which may seem at first somewhat counter intuitive.

==See also==
*[[Conservation of Information in Search - Measuring the Cost of Success]]
*[[Efficient Per Query Information Extraction from a Hamming Oracle]]

==External links==
*[http://www.youtube.com/watch?v=mcAq9bmCeR0 Evolution IS a Blind Watchmaker] - A YouTube video with a more graphical display of a similar algorithm, to synthesise a clock.

==References==
{{reflist}}