My first thoughts are that supervising every generation by hand is a bloody nightmare. For myself a scenario utilising a set of selection criteria to automatically select the sequences to go into the next generation would be far preferable.

My ideal output would be some sort of graph of generation against fitness/identity to target sequence, as well as an archive of all of the offspring and progeny from each generation. I definitely see the value of having every step in the process there for scrutiny, I just don't like having to do all the scrutiny myself every generation.

I appreciate that this approach doesn't allow you to vary the mutation rate generation by generation, but I'm not sure how useful that ability is anyway.

My first thoughts are that supervising every generation by hand is a bloody nightmare.

Yeah, you're right, but I wanted to be as similar to Marshall's program as possible, and with the number of matches displayed next to the select box I find I can go through 40 generations in five minutes with little problem, usually selecting between 2 and 4 strings to contribute to the next generation.

For myself a scenario utilising a set of selection criteria to automatically select the sequences to go into the next generation would be far preferable.

Agreed, and I hope to add an "automatic" option.

My ideal output would be some sort of graph of generation against fitness/identity to target sequence, as well as an archive of all of the offspring and progeny from each generation. I definitely see the value of having every step in the process there for scrutiny, I just don't like having to do all the scrutiny myself every generation.

I agree, but it takes it to another level of time committment, and then it gets out of the realm of what ICANT might possibly understand. An understandable illustration for the average layperson was my goal, something that when someone mentions Marshall's program you could come straight back with a link to my program. That's why I made sure they looked very similar.

I appreciate that this approach doesn't allow you to vary the mutation rate generation by generation, but I'm not sure how useful that ability is anyway.

I wouldn't have any problem varying the mutation rate automatically. One approach would be to track progress toward the goal and to reduce the mutation rate when it leveled off. Another approach would be to measure number of mutations against number of correct letters. Of course, you could quickly go through so many generations in an automatic mode that keeping the mutation rate high in the early stages wouldn't be necessary.

Another improvement would be to have multiple targets, which would bring the program a little closer to actual evolution. You would quickly observe that random changes early in the process would direct lines of descent toward different niches.

I made the word "science" (actually "sCiEncE") in 54 generations, using 5 offspring per parent and 1 mutation per offspring. I also used a rule where I always selected 4 individuals to contribute to the next population.

What's interesting to me about it is that there seemed to be about three quirks:

It took about 10 generations before I got my first matching letter.

It took a long time (I can't remember how long) to get from 6 correct letters to 7.

Once you get to the target sequence, it's impossible to drive it to fixation, because the offspring always mutate.

The first two I think are real quirks of evolution: the first template on which evolution could work would have to have been generated randomly, and fine-tuning (6 to 7 letters) would be hard to stabilize.

The last one might also be a real quirk of evolution (the difficulty of driving a trait to absolute fixation); but I think it's more a quirk of the generator. Maybe you could allow a range of mutations in each offspring, instead of saying exactly how many? So, instead of saying "1 mutation per individual," it could be "0-1" or "0-2."

I have no idea how difficult that might be to program, because I know nothing about programming.

{AbE: Also, maybe the possibility of a moving target sequence would make it more realistic?}

Basically looks like a WEASEL, a model of "cumulative selection" which was presented by Richard Dawkins in Chapter 3 of The Blind Watchmaker.

About 20 years ago, I used his description (he didn't post the code) to write my own WEASEL in Turbo Pascal and called it MONKEY, after Eddington's infinite monkeys (though not based on the Internet's "Infinite Monkey Protocol Suite" (IMPS), RFC 2795 (01 April 2000)). Musgrave included it in his Almost Like a Whale page where he includes many other WEASELs as well. He links to a self-extracting archive of my source code and executable, plus another link to a mathematical analysis I had written. Turns out that despite low probabilities for each individual step, the probability that each and every step would fail (a requirement for the whole system to fail) is vastly less, the end result being that the probability of eventually reaching the goal (eventually meaning within minutes or seconds) exceeds 99.99%. In comparison, single-step selection would have to run for several times longer than the current age of the universe in order to have one chance in a million of success.

If you try to run the program, it will crash. That is because your PC is too fast. The Turbo Pascal start-up code has a timing loop that calibrates its delay timeouts. I think it was around the time the first Pentium came out that the processor's speed became too great and as a result that start-up code would crash. Borland did eventually issue a patched start-up module that I linked in, but it didn't make it to Musgrave's site.

I had started to convert MONKEY to C, but its original design was strongly based on the Pascal idiom to make that conversion easy.

A. S. Eddington. The Nature of the Physical World: The Gifford Lectures, 1927:

... If I let my fingers wander idly over the keys of a typewriter it might happen that my screed made an intelligible sentence. If an army of monkeys were strumming on typewriters they might write all the books in the British Museum. The chance of their doing so is decidedly more favourable than the chance of the molecules returning to one half of the vessel.

Douglas Adams. The Hitchhikers' Guide to the Galaxy:

"Ford!" [Arthur] said, "there's an infinite number of monkeys outside who want to talk to us about this script for Hamlet they've worked out."

This memo describes a protocol suite which supports an infinite number of monkeys that sit at an infinite number of typewriters in order to determine when they have either produced the entire works of William Shakespeare or a good television show. The suite includes communications and control protocols for monkeys and the organizations that interact with them.

I played around with developing something like this a while back. I wasn’t too keen on my early attempts, because, like your program here, the selection pressure was driving the “organism” to a particular solution, rather than presenting a problem and letting random mutations develop their own solution(s). How to program that, though?

The best I was able to come up with was a picture that mutated. I started with a grid of 20x20 squares, each with a random color. Its offspring would mutate by having a random number of squares change its color to a new random color. The human operator would choose a child picture to be the new parent, all other children died away. The selection pressure then became whatever the human wanted it to be. I was hoping that the random picture itself would suggest something. “Hey, that kind of looks like an apple/fork/lightning bolt/whatever”. The human would then select that child, and as he kept making selections, a nice picture of an apple/whatever would appear.

In practice, it was a flop. At 6 children per generation (the most I could fit on the screen without scrolling), and roughly 15 seconds per generation minimum, it looked to take much longer than my attention span to generate any picture of note. I tried upping the mutation rate, but that caused any pattern that started to emerge to disintegrate. I tried altering the number of squares in the grid, the number of colors available, how far a random mutation could jump along the color scale (e.g. red to orange allowed, red to blue not); nothing seemed to help much. Only by simplifying tremendously – 4x4 grid, 4 colors, selection pressure: blue=good, not blue=bad – did I get anywhere, but that wasn’t very satisfying.

I ran the generator for 84 generations with 1 parent from each generation of 10 OFFspring with 10 mutations I did random selection of a child for each generation. At the end of 84 generations I have all zeros under select.

I ran the generator for 55 generations using 10 OFFspring with 10 mutations. I did random selection of 1 OFFspring from each parent for the following generation. At the end of the 55 generations

Parent 1 has 2 OFFspring with 1 match and 1 OFFspring with 2 matches.

Parent 2 has 1 OFFspring with 1 match and 1 OFFspring with 3 matches.

Parent 3 has 1 OFfspring with 1 match.

For my text string I used the alphabet lower case in order.

I just ran 1 Parent with 2 OFFspring then selected all OFFspring as parents until I reached 32 Parents.

I then ran the 32 parents with 1 OFFspring selecting all OFFspring as Parents at 38 generations I have 12 OFF spring with 1 match, 4 OFFspring with 2 matches and 1 OFFspring with 3 matches.

Everything was run with 10 mutations.

What am I doing wrong?

God Bless,

"John 5:39 (KJS) Search the scriptures; for in them ye think ye have eternal life: and they are they which testify of me."

It took a long time (I can't remember how long) to get from 6 correct letters to 7.

Once you get to the target sequence, it's impossible to drive it to fixation, because the offspring always mutate.

The first two I think are real quirks of evolution: the first template on which evolution could work would have to have been generated randomly, and fine-tuning (6 to 7 letters) would be hard to stabilize.

About number 1, that will vary, sometimes you're luckier than others. About number 2, getting the final few letters to match is the toughest, because there's only one right answer. In the real world there are millions of correct answers, and even creationists must acknowledge this because everyone's DNA is different.

The last one might also be a real quirk of evolution (the difficulty of driving a trait to absolute fixation); but I think it's more a quirk of the generator. Maybe you could allow a range of mutations in each offspring, instead of saying exactly how many? So, instead of saying "1 mutation per individual," it could be "0-1" or "0-2."

I have no idea how difficult that might be to program, because I know nothing about programming.

This is very easy, and I considered doing it, but I was afraid what I had was already too different from Marshall's program to be easily understood.

{AbE: Also, maybe the possibility of a moving target sequence would make it more realistic?}

This, too, is relatively easy. It would reflect a changing environment. It would show how organisms could get caught between needing a high mutation rate to keep up with a changing environment but not so high that fitness is undermined.

I was hoping to make something that was only incrementally more complicated than Perry's program but that gave a more accurate picture of how evolution works. I vaguely remember The Blind Watchmaker, but it's been over 20 years. I recall that he had a chapter about an evolution program, and I guess that's the WEASEL program you mention. Neat stuff, I still have the book on my shelf. At the time I read it I was carrying on a snail-mail debate with a fundamentalist Christian I'd met on an airplane and I sent her a copy. I'm sure she found it worked great as a paperweight.

Yeah, I can see the problems you faced. It would probably work great if selection was automated, but then it wouldn't provide any insights to the people watching it. They'd just gradually see a picture emerge.