Wednesday 2 September 2009

An Ape Sits At A Keyboard...

...and that mostly hairless bipedal ape that we know and love as Richard Dawkins wrote the Weasel program, and put it in his wonderful book The Blind Watchmaker. It's not a simulation of evolution, rather it's showing how adding selection to random events is the opposite of pure chance. Yet creationists don't seem to get this and focus on it like it's anything more than analogy. I wrote a similar program last year, though I "cheated" by locking individual letters when they hit the right character. In the spirit of Creationists not getting it, I've written it again this time without cheating. [source code here]

I'm really surprised that creationists are calling for the source code, it's a very easy program to write. It took me less than an hour writing it in C++. Without "cheating" by locking characters, I was still able to generate a solution. And just to show it wasn't a fluke, I repeated the process hundreds of times changing the mutation rate and number of children; finding a maximum and minimum and an average.

It amazes me that still there are those who go on about the program. It's easy to write and it evidentially works. Anyone who doesn't think that it can or thinks that my code is somehow cheating is welcome to download it and try it out for themselves. Play around with the variables, I made it all parameterised so it is flexible enough to mess around with. How fast it works doesn't really matter, the important thing to take away from the program is that it does work.

8 comments:

TiG said...

I tried to read through the comments at UD. *headdesk*

It's no use using logic with some of them because they just don't care. They ask a question, it gets answered, then they say, but! What about THIS!? And then they ask the same question again. It made my brain hurt.

Tomato Addict said...

AND you like games too, judging by your other blog. Darn you Kel, stop being interesting, because I'm already following too many blogs as it is! ;-)

Randy Stimpson said...

Let's say you fix the mutation rate and the number of children. Then vary the length of the target string. Try target strings with length 100, 200, 300, 400, 500, 600, 700, 800, 900 and 1000.

How does this affect the number of generations required to converge? Is there a length at which you don't get conversion?

K said...

Well Randy, you can always tweak the program to find out. This is one reason why I published the source code and parameterised the damn thing - try it out for yourself and see what happens.

Though I'm not exactly sure why it's really relevant that increasing the string size should matter.

Randy Stimpson said...

Hi Kel,I tried the Weasel Program on a string only 80 characters in length. I started the program last night before I went to bed and after more than 15 million generations there is still no convergence. I think that should poke a hole in your faith. Actually I published an Interactive Weasel Program on my blog so that any one else can start the same thought experiment I did in seconds -- just press the Suggested Settings 1 button and then the Evolve String button.

K said...

I think that should poke a hole in your faith.
Really now? Just what faith is that and why is it shattered?

K said...

Some results for you

string goal = "twentycharactersherefourtycharactersheresixtycharactershere eightycharactershere"

int mutationRate = 1
int numberChildren = 50

At generation 1327: twentycharactersherefourtycharactersheresixtycharactershere eightycharactershere - current distance: 0


numberChildren = 100

At generation 863: twentycharactersherefourtycharactersheresixtycharactershere eightycharactershere - current distance: 0


numberChildren = 25

At generation 2249: twentycharactersherefourtycharactersheresixtycharactershere eightycharactershere - current distance: 0


numberChildren = 10

At generation 6573: twentycharactersherefourtycharactersheresixtycharactershere eightycharactershere - current distance: 0


I don't know what you're smoking, the algorithm works. Not that it proves anything other than the algorithm works...

Anonymous said...

I'm newbie, hi