# Dembski Weasels Out

Over at uncommon descent William Dembski is musing over Richard Dawkins Weasel program. Why you may ask? Way back in prehistory (the 1980’s) Dawkins wrote a little BASIC program (in Apple BASIC of all things) to demonstrate the difference between random mutation and random mutation with selection, which many people were having trouble grasping. Now, this wasn’t a simulation of natural selection, and Dawkins was very careful to point this out.

But as a demonstration of selection versus simple random mutation, with the string “methinks it is a weasel” being selected in a matter of minutes, when simple random mutation would take longer than the age of the Universe, it was pretty stunning. As a result, creationists have been having conniption fits over this little program for decades. Such is its power, the Issac Newton of Information Theory, William Dembski, spent a not inconsiderable portion of his time attacking this toy program. In particular, he claimed that after every successful mutation, the successful mutation was locked into place, and couldn’t be reversed. But he was wrong, and it seems he just can’t admit it.

As you can see, by using the Courier font, one can read up from the target sequence METHINKS*IT*IS*LIKE*A*WEASEL, as it were column by column, over each letter of the target sequence. From this it’s clear that once the right letter in the target sequence is latched on to, it locks on and never changes. In other words, in these examples of Dawkins’ WEASEL program as given in his book THE BLIND WATCHMAKER, it never happens (as far as we can tell) that some intermediate sequences achieves the corresponding letter in the target sequence, then loses it, and in the end regains it.

However, it is very easy to understand from the description of the program in the Blind Watchmaker, that no locking is occurring. The list Dawkins presents is not all of the strings that are generated per “generation”, just the “fittest” strings (ie, just those closest to the target. Showing all 6,400 strings in a paperback book is just not feasible, nor useful[1]). And even then, Dawkins is only showing every 10th fittest string! So even if the best string was backing and forthing, you are very likely to miss it (and don’t forget the back mutations to less fit strings will be selected against, and not show up when we are only displaying the best string). It doesn’t take a mathematical genius to work this out.

People have been telling Dembski this for years (Wesley Elsberry for one, and again recently), but he just hasn’t listened. Now there is documentary evidence that Dembski is wrong, from a documentary on Dawkins work. How does Dembski handle this?

Interestingly, when Dawkins did his 1987 BBC Horizons takeoff on his book, he ran the program in front of the film camera: www.youtube.com/watch?v=5sUQIpFajsg (go to 6:15) There you see that his WEASEL program does a proximity search without locking (letters in the target sequence appear, disappear, and then reappear). That leads one to wonder whether the WEASEL program, as Dawkins had programmed and described it in his book, is the same as in the BBC Horizons documentary.

Don’t admit you were wrong, claim a different program is used (ignoring for the fact that the weasel program in the documentary still converged on the correct solution in a matter of minutes). However, it is easy to see from the video that all of the generated strings are being displayed, not just every 10th fittest as was in the book. That’s the difference between printed media and things like TV, you can easily show the intermediate steps without causing confusion, again, imaging if Dawkins had shown all 6,400 intermediates, that would be roughly 160 pages of gibberish[1] to demonstrate something anyone with an IQ above room temperature could figure out from themselves.

In any case, our chief programmer at the Evolutionary Informatics Lab (www.evoinfo.org) is expanding our WEASEL WARE software to model both these possibilities. Stay tuned.

Say what? How long does it take someone to write a program that basically takes a string, copies it with mutations, compares it to a target, chooses the best mutant, copies and mutates the new string, and compares again until the target is reached? When I first read Dawkins book I made my first weasel program in a couple of hours in GBASIC (as did almost every geek in the Universe), converting it to QBASIC and using arrays and stuff took an afternoon, because I was trying to be fancy with the arrays, and adding in a lot of comments so people could follow what I had done. So a real programmer should have been able to make a “non-locking” version in the time it took Dembski to write his blog post. Heck, Dembski could have done it himself. People have written versions of the weasel program in Matlab[3], and Dembski is supposed to be a mathematician, why didn’t he?

Indeed, if he were lazy he could have just looked one up on the web and checked how it was programmed. For a time there was a cottage industry in making weasel programs, and there were lots of them. To demonstrate, I have resurrected a program I made in QBASIC[4]. Now, the program I’ve written [4] is written to be as close as possible to Dawkins original as described in the book in terms of how it works (although I’ve added in the ability to change the string and the number of offspring). All offspring strings are mutated (one mutation per string, the mutation is a random letter placed in a random lcocation), and no mutation is “locked” into place. Any given “good” mutation can potentially be mutated out again (and is if you watch carefully). If you run the program with 100 offspring (as per Dawkins), unless you are preternaturally fast you won’t see any backing and froing. If you run the program with 50 or 30 offspring, it is easier to see backing up [2]. The screen shot below shows the current best string, which is worse than the previous best string (and I had to add wait loops so it was slow enough for me to catch with PrintScreen, see also the string capture listed at [2] at the bottom of the post).

Even with the low offspring number the program converges on a solution (see second screen shot).

This demonstrates that Dawkins program works just fine without “locking”. With populations of 100 offspring, where it is hard to see back mutation, I got convergence in 65, 36 and 100 generations in 3 separate runs. Quite similar to the runs Dawkins reports in his book.

The question is, instead of constructing conspiracy theories about how Dawkins must have changed his program (rather than realising the difference between showing all of a screen dump on an interactive medium like TV, and showing the most fit strings from each generation in a printed book is one of presentation, not core programming), why didn’t Dembski write his own program (or get his minions to write one for him) to check for himself before spinning wild theories?

Oh. I forgot. That’s the difference between Intelligent Design and real science; real science actually tests hypotheses with data.

[1] If he has 100 offspring per generation, than a run of 64 generations will generate 6,400 individual strings. Typical books can have 40 lines to a page, hence 160 pages to show all offspring, as well as as the fittest of each generation.

[2] Here are runs I did using my program, with the program dumping only the fittest strings to file.
Off spring size 100, showing 10 individual generations (convergence in 37 Generations)

Best string ; Generation
pewjhokr ju hs c wecule ; 20
pewjhokr ju hs c wecsle ; 21
pewjhokr ju hs a wecsle ; 22
petjhokr ju hs a wecsle ; 23
metjhokr ju hs a wecsle ; 24
metjhokr ju hs a weasle ; 25
metjhokr ju is a weasle ; 26
metihokr ju is a weasle ; 27
metihoks ju is a weasle ; 28
metihmks ju is a weasle ; 29
metihmks ju is a weasle ; 30

Hmm, that looks “locked in” doesn’t it BUUUT here’s what happens with a population size of 50. Remember, nothing else has been changed about the program except the population size. Convergence is in 187 generations, in previous runs I have had convergence in 73, 98 and 128 runs).

Best string ; Generation
lethinks jt is a weasle ; 135
lethinks jt is a weaske ; 136
lethinks jt is a weaske ; 137
lethinks jt is a weatke ; 138
lethinks jt is a weatke ; 139
lethinks jt is a weatke ; 140
lethinks jt is a weatke ; 141
lethinks jt is a weatke ; 142
lethinks ju is a weatke ; 143
lethinks ju is a weatke ; 144
lethinks gu is a weatke ; 145

Note we see reversion now, despite the program being unchanged. If we had just looked at generation 130 and 140 (every 10th generation, as Dawkins shows in order to conserve space in his book) we would have seen

lethinks jt is a xeasle ; 130
lethinks jt is a weatke ; 140

Which Dembski imagines is locking, but its not.

[3] Heck, you could even do this in Microsoft Excel (shudder)

[4] My weasle program in QBASIC can be found here. Here’s the relevant section of the code

Start:
CLS
LOCATE 5, 2: PRINT “Target:”; TAB(12); Target\$; “ Diff”; BestDiff; “ Generation: “; Gen
LOCATE 7, 2: PRINT “Current Best String is “; Test\$(BestFit); “ with a difference of “; BestDiff
LOCATE 8, 2: PRINT “Previous Best String was “; Parent\$; “ with a difference of “; CurrBestDiff

Wait10
Gen = Gen + 1
‘Find the closest (ie fittest) string
‘Note, there is NO locking

CurrBestDiff = BestDiff
Parent\$ = Test\$(BestFit)

‘Create Offspring, all offspring are mutants
‘no site is preserved, contrary to claims by Dembski
FOR I = 1 TO OffSpring
Site = (RND * TargLen) + 1
IF Site > TargLen THEN Site = TargLen
Char\$ = CHR\$((INT(RND * 26) + 96))
IF Char\$ = CHR\$(96) THEN Char\$ = CHR\$(32)
Test\$(I) = Parent\$
MID\$(Test\$(I), Site) = Char\$
NEXT

UPDATE: I’ve run a freely mutating version of the weasel against a “locking version”, I report the results here.

More to the point, this is a waste of time. By Dawkin’s own description the Weasel program is an attempt to show very very roughly how evolution could be minimally plausible. Even if the program had issues (such for example even if it had used locking) that would mean that it might not be the ideal example. That doesn’t in any way negate the point or weaken the case for evolution at all.

One minor squabble … if I’m reading your code correctly, it appears that you select only one child per generation and use it to breed the next 100 children. Is that correct? If so, it’s not exactly the best way to demonstrate evolution :)

I’d never heard of Dawkins program before, and it’s really got me interested. I’m making a PHP version now, so I was digging through your code to see how you handled breeding in each generation. I’m trying to get them to breed randomly producing twice as many children as parents, and then cull the children so I end up with the same pool size. That’s why I found it interesting that you’d decided to select only one per generation - it makes the coding easier, but it feels too much like cheating.

Doesn’t matter, Zelinsky. Dawkins did it, so it must be wrong. After all, his programming doesn’t have the Light of God behind it.

If you modified the “target” to read “Methinks Dembski is a weasel” do you think the program would converge, or simply don an oversized grey cardigan and shuffle off to an irrelevant Bible college in Texas?

Personally, I’d go for Door number 2.

Joshua Zelinsky said:

More to the point, this is a waste of time.

Well, the point is that a leading light of the cdesignproponentits has spent an enourmous amout of time critiqing a toy demonstration of selection, and can’t even get the toy example right. Not only that, they can’t admit when they were wrong. So when they say that actualy simulations of natural selection are worng, you know how much confidence to place in their statments :-)

Alex said:

One minor squabble … if I’m reading your code correctly, it appears that you select only one child per generation and use it to breed the next 100 children. Is that correct? If so, it’s not exactly the best way to demonstrate evolution :)

What part of “toy program” didn’t you understand?

It’s not demonstrating evolution (as clearly stated in the introduction) or natural selection, but a simple demonstration of the power of selection over random search (if anything it mimics serial passage of bacteria throigh increasing concentrations of antibiotic, where you choose a single cell for each iteration of the growth/selection step). It’s like complaining that the measuring cylinder/running tap model of clearance desn’t implement the liver.

Of course, this hasn’t stopped people (including me) from adding in population structures, sexual breeding, indels gene duplication and a whole range of things (they all still work), but the point here is that Dembski completely misunderstands, and completely misrepresents, a toy program which very clearly doesn’t behave as he claims.

If Dembski and co. can’t get such a simple model right, then no one can have confidence in their criticisms of lenski et al and so on.

It’s not demonstrating evolution (as clearly stated in the introduction) or natural selection, but a simple demonstration of the power of selection over random search

Dawkins Weasel programs clearly demonstrate the power of a little feedback on selection, and the fact that having some of it can speed up convergence on a solution over a truly random search by a factor of millions.

But as Ian points out they don’t really model the process of evolution.

To demonstrate the or that, you need Dawkin’s Weasel generators.

These are self-creating software programs that exactly mimic the actions of DNA evolution.

The grand-daddy of these programs was originally described in a research paper written in 1995.

you can find it at Genetic Evolution of Machine Language Software Ronald L. Crepeau NCCOSC RDTE Division San Diego, CA 92152-5000 July 1999

If you have any familiarity at all with low-level computer languages this paper is simply jaw dropping.

Ian, valid point. Also, given that Dembski claimed in November that he was going to be trying to do research instead of blogging - http://www.uncommondescent.com/admi[…]hange-at-ud/ - and this is the first thing we’ve gotten as a result, I can’t say that I’m too impressed.

I can’t see what the issue is. You can have a Weasel program that generates one offspring, with a single mutation each time, and accepts it if the result is closer to the target. That will in effect have “locking” but might sometimes waste its time trying to mutate a correct letter. Or you can have one mutation each time that is always in an incorrect letter. That would lock too. Or you can generate one offspring, with each letter having a small random chance of mutating, and accept the new string if it has more positions matching than the current one. That will not precisely lock. Or you can make a population of (say) 50 offspring, with one of these mutation schemes, and accept the best of these.

All of these will work, at slightly different speeds, and all will make Dawkins’ point that the result is convergence to the target string much faster than random changes without any natural selection. (Yes, folks, in spite of what has been said here this is a simulation of a simple form of natural selection). It really doesn’t matter which form of these you use. They all make the same point.

To fret about which exact form Dawkins was using is a waste of time, unless you want to try to give the impression that there is some dark and mysterious coverup afoot. Sure Dembski is not intending to give that impression, is he?

Joe Felsenstein said:

I can’t see what the issue is.

Joe Felsenstein! [Wayne’s World] I’m not Worthy, I’m not Worthy [/Wayne’s World]

Seriously, the issue is a bit like arguing over whether the measuring cylinder in the Measuring Cylinder/Tap model of drug clearance is emptied by a tube or a bloke with a cup.

It’s a non-issue except for the way it highlights the determined cluelessness of cdesign proponetists. Dembski is effectively arguing that Dawkins said the measuring cylinder is emptied by a man with a cup in his book, but anyone can go to his original book, read how he set it up, and understand that Dawkins specified a tube. Dawkins doesn’t specify how big the tube, or the flow rate of the tap, but it’s sort of obvious and you can easily make an analogous system which demonstrates the same things that Dawkins does. Everyone understands except Dembski who then makes a convoluted argument over the whole thing (see www.evoinfo.org and read their “explanation” of Dawkins program if you have a spare half-hour of your life you don’t mind wasting).

Now that there is a video showing a measuring cylinder with a tube, Dembski goes “oh, Dawkins must have REALLY have used a cup in his book, then swapped to a tube for the video”. Aside from the convoluted mentality involved in this staggering piece of “reasoning”, it goes to the heart of the cdesign proponentists reliability.

When Dembski claims that Lenski et al., have “smuggled in information”, explaining why they are wrong can get quite technical, but when they claim Dawkins has “smuggled in information”, one can simply point to how deeply they have misunderstood Dawkins model, and if they can’t get Dawkins right (after being told repeatedly and being shown a video), what hope is there that they got Lenski right.

I have been kicking around an idea for the past few weeks based on Dawkins’ weasel program.

Rather than have a pre-defined endpoint (as the weasel program does and evolution doesn’t) I developed this idea.

1) Start with a 400 x 600 pixel square with each pixel randomly turned on or off.

2) Three offspring are generated with random mutations (pixels changed)

3) The program posts the four “pictures” on a webpage

4) The next user to go there picks one of the four

5) The selected “picture” is used to return to #2

I think it would be interesting to see if a recognizable picture would develop from the selection process.…

I never cease to be dumbfounded by how dumb Dembski bumbles and dumbs up everything he touches. He apparently has some sort of anti-Midas touch in which everything he handles turns to feces.

What is even more amazing is the fact that he can do this against a background of computer techniques that go back to the development of computers to carry out just such calculations. Monte Carlo techniques were developed to solve stochastic type problems that had all the major components of evolution in them, only they were called physics problems. The fundamental algorithms have been around for close to a century.

Dawkins simple little program was one of the nicest examples of a simple, easily written program that illustrated a fundamental concept to anyone who could write simple code. How can anyone not understand?

But then Dembski doesn’t even know how to initialize variables in his programs.

and who provides the intelligence and vitality for these software programs to work?

my interest in in the human mind and how it can convince itself that it knows reality.

it is a very subtle step from a paradigm to paradigm paralysis.

scientism like religion claims truths and they both would be better to claim degrees of truths.

religions have made god or source or absolute or cause or vitality in their image on the other side of the coin are the materialists that search no deeper than their existing materialistic paradigm.

the universe has many mysteries yet to discover but yet we teach theories and beliefs as fact. look at the history of science and how many facts have been overturned and found to be false.

the same applies for religious beliefs.

science needs to be about theories and probabilities and few facts. maybe no facts if one is to keep the mind open for discovery.

the greatest fear the human ego has is to be called ignorant so it projects its ignorance on to others.

dave said:

and who provides the intelligence and vitality for these software programs to work?

my interest in in the human mind and how it can convince itself that it knows reality.

it is a very subtle step from a paradigm to paradigm paralysis.

scientism like religion claims truths and they both would be better to claim degrees of truths.

religions have made god or source or absolute or cause or vitality in their image on the other side of the coin are the materialists that search no deeper than their existing materialistic paradigm.

the universe has many mysteries yet to discover but yet we teach theories and beliefs as fact. look at the history of science and how many facts have been overturned and found to be false.

the same applies for religious beliefs.

science needs to be about theories and probabilities and few facts. maybe no facts if one is to keep the mind open for discovery.

the greatest fear the human ego has is to be called ignorant so it projects its ignorance on to others.

Hello ? Planet Dave has tuned in. Is this something you just drop into any forum ? Troll off Dave.

Of course the most important thing here is that those of us, who never got around to write our own weasel program 20 years ago, now have a good excuse to finally do so. Here’s my attempt in Python (about 40 minutes of programming effort - you have to love that language!): weasel.py

And output from the final few generations of my first test run (pop size=30). Notice the reversions:

[…]
METHINKS IT IS LIKEUA WTASEL ## Gen: 114 Dif: 2
METHINKS IT IS LIKEUA WYASEL ## Gen: 115 Dif: 2
METHINKS IT IS LIKE A WYASEL ## Gen: 116 Dif: 1
METHTNKS IT IS LIKE A WYASEL ## Gen: 117 Dif: 2
METHTNKS IT IS LIKE A WEASEL ## Gen: 118 Dif: 1
METHFNKS IT IS LIKE A WEASEL ## Gen: 119 Dif: 1
METHXNKS IT IS LIKE A WEASEL ## Gen: 120 Dif: 1
METHINKS IT IS LIKE A WEASEL ## Gen: 121 Dif: 0

Anders said:

Of course the most important thing here is that those of us, who never got around to write our own weasel program 20 years ago, now have a good excuse to finally do so. Here’s my attempt in Python (about 40 minutes of programming effort - you have to love that language!):

Python! Cool! And yet, over at Uncommon Dissent, after nearly 48 hours with a trained programmer on hand, they STILL haven’t reproduced the weasel.

Mike Elzinga said:

What is even more amazing is the fact that he can do this against a background of computer techniques that go back to the development of computers to carry out just such calculations. Monte Carlo techniques were developed to solve stochastic type problems that had all the major components of evolution in them, only they were called physics problems. The fundamental algorithms have been around for close to a century.

Genetic simulations of evolution have been around almost as long as Markov chain Monte Carlo methods have been in physics. The classic MCMC paper of Metropolis et al. is 1953. The first genetic simulation of evolution is Nils Aall Barricelli’s paper of 1954.

Ian Musgrave said: What part of “toy program” didn’t you understand?

Hey, I’m just asking a simple question - no need to get bitchy. I got your point just fine the first time around, thanks.

Ian Musgrave said:

When Dembski claims that Lenski et al., have “smuggled in information”, explaining why they are wrong can get quite technical, but when they claim Dawkins has “smuggled in information”, one can simply point to how deeply they have misunderstood Dawkins model, and if they can’t get Dawkins right (after being told repeatedly and being shown a video), what hope is there that they got Lenski right.

I think that Dembski’s present concern may be the issue of “smuggling”. Dawkins’s program does have a precise target phrase that is supplied by the user. But Dawkins is not concerned with whether the information comes from that phrase or is generated de novo by the selection. As we know, he is really concerned to make a teaching example to show how wrong is the common creationist argument that evolution is like an “explosion in a junkyard”. His example succeeds at this brilliantly. And for that it simply does not matter where the information ends up coming from.

This is all presumably part of some argument Dembski will make about the ultimate source of the information. Such arguments are mostly a diversion from the real issue: wherever the information originally comes from, it is natural selection that puts it into the genome.

dave said:

and who provides the intelligence and vitality for these software programs to work?

my interest in in the human mind and how it can convince itself that it knows reality.

In that case, you should comment on a blog concerning the human mind and perception.

Panda’s Thumb supports “Discussions and critiques of evolutionary theory, science and education,” so this is not the place for your interest.

Folks, please don’t feed the troll.

Alex said:

Ian Musgrave said: What part of “toy program” didn’t you understand?

Hey, I’m just asking a simple question - no need to get bitchy. I got your point just fine the first time around, thanks.

That was mere mild exasperation (if you got my point and knew it was a toy program, why worry about the string duplication method when we are explicitly trying to duplicate Dawkins). If you want to make more realistic weasels, head over to “Very Like a Whale”(yes, it’s also my page) and download weasle6.bas for an example where multiple strings breed and offspring are selected probabilistically. There’s also a few other weasels there (although some links have died with the passage of time).

dave said:

and who provides the intelligence and vitality for these software programs to work?

my interest in in the human mind and how it can convince itself that it knows reality.

it is a very subtle step from a paradigm to paradigm paralysis.

scientism like religion claims truths and they both would be better to claim degrees of truths.

religions have made god or source or absolute or cause or vitality in their image on the other side of the coin are the materialists that search no deeper than their existing materialistic paradigm.

the universe has many mysteries yet to discover but yet we teach theories and beliefs as fact. look at the history of science and how many facts have been overturned and found to be false.

the same applies for religious beliefs.

science needs to be about theories and probabilities and few facts. maybe no facts if one is to keep the mind open for discovery.

the greatest fear the human ego has is to be called ignorant so it projects its ignorance on to others.

Facts are never false. The Earth has always been round,the Earth has always orbited the Sun and there never was any aether.

Rogue, This really amazed me:(HT to PZ or the BA, or somebody)

Ian Musgrave said:

Anders said:

Of course the most important thing here is that those of us, who never got around to write our own weasel program 20 years ago, now have a good excuse to finally do so. Here’s my attempt in Python (about 40 minutes of programming effort - you have to love that language!):

Python! Cool! And yet, over at Uncommon Dissent, after nearly 48 hours with a trained programmer on hand, they STILL haven’t reproduced the weasel.

Python isn’t cool, Lisp is cool!

(Okay, maybe Python is a little cool.)

How long does it take someone to write a program that basically takes a string, copies it with mutations, compares it to a target, chooses the best mutant, copies and mutates the new string, and compares again until the target is reached?

For me, 10 minutes in Python. After 20 minutes, I added support for “locking”, multiple mutation loci, different population sizes, a lax selection function, and a selection function that doesn’t operate in every generation.

Mr. Dembski should hire an actual programmer. I hear it’s an employer’s market.

Following up on my Red Lynx simulator, we’re thinking about a similar widget for a weasel program.

I once wrote an evolution program involving Conway’s game of life. A random bit pattern was used as the initial life pattern. Its fitness was determined by how long it would run before entering a loop. And they even reproduced sexually by combining the bits from two different patterns. This isn’t exactly rocket science. Dembski is really showing how clueless he is.

and who provides the intelligence and vitality for these software programs to work?

Nobody, DaveTroll.

They can write themselves.

Put the Word-Salad Shooter down and read the paper.

Genetic Evolution of Machine Language Software Ronald L. Crepeau NCCOSC RDTE Division San Diego, CA 92152-5000 July 1999

Rogue74656 said:

I have been kicking around an idea for the past few weeks based on Dawkins’ weasel program.

Rather than have a pre-defined endpoint (as the weasel program does and evolution doesn’t) I developed this idea.

1) Start with a 400 x 600 pixel square with each pixel randomly turned on or off.

2) Three offspring are generated with random mutations (pixels changed)

3) The program posts the four “pictures” on a webpage

4) The next user to go there picks one of the four

5) The selected “picture” is used to return to #2

I think it would be interesting to see if a recognizable picture would develop from the selection process.

Not exactly the same thing but you may find this video interesting: http://www.youtube.com/watch?v=xx5t5_trnuU

Ok Ian, I’ll consider the thread closed. Whatever else I have to say will be added to my blog.