Saturday, March 8, 2014

Artificial selection: simulating rapid evolution on a spreadsheet.

I was rereading Richard Dawkins' The Blind Watchmaker recently and became interested in one of the analogies he used to illustrate natural selection and artificial selection.  The analogy he presented was that of a monkey poking at keys on a typewriter.The chances of the monkey producing a particular phrase are vanishingly small and the time needed to repeat the process until the correct phrase was randomly typed would exceed the lifetime of the monkey and indeed several generations of monkeys.

I have access to neither a monkey nor a typewriter so I settled upon MS Excel instead.  I instructed Excel to randomly plop letters in each of 8 cells to see if I could match an 8-letter word: "CharlesD".  Not surprisingly, I never found a match despite running several thousand iterations of my experiment.  It illustrates beautifully the idea that random evolution could never work.  Expecting several random mutations to spontaneously generate an organism with traits that fitted it for a particular set of environmental conditions is similarly unlikely.

But evolution is far from a random process.  Certainly mutations can be random, but the survival and reproduction of the resulting mutants is certainly non random. If several mutants are about average, better, or worse at catching prey and therefore surviving and reproducing, then those better suited to predation will survive, reproduce, and pass those superior mutant genes in greater numbers to the next generation.  This is the process of natural selection as outlined by Darwin and Wallace in the 19th century.

Artificial selection is rather like natural selection on steroids.  A plant or animal breeder can artificially select some desirable trait over several generations.  Each time a particular plant or animal better matches that trait, it will be selected as breeding stock.  This brought me to a second simulation. Again MS Excel plopped random letters in cells in a spreadsheet row, but checked the letters against the target phrase "CharlesD".  Any letters that matched the target phrase were placed in the next row and new random letters or 'mutations' were placed in other the remaining slots.  Every time a letter matched one from the target phrase, it was retained and passed onto the next row or 'generation'.

I found that in this simulation the phrase evolves to match the target phrase in a short number of repetitions; often fewer than 100 generations.  One such simulation is presented below.  The letters plopped into the phrase are just as random as the mutant letters in the first simulation I mentioned above.  The crucial difference is that the target letters are retained in successive generations as would be the case if a cattle breeder selected for higher butterfat content of milk over generations.

Try it using your own phrase in this simple MS Excel sheet.

An example that converged on the target in 30 generations:


Target phrase: C H A R L E S D
generation







1
H D A V R X P U
2
T K A L G L U N
3
G I A P P X B P
4
W S A W S U O J
5
I W A R X V O C
6
Q R A R K V O Z
7
P W A R G X M L
8
C J A R U I G P
9
C P A R A E T A
10
C W A R I E M F
11
C H A R Y E T Y
12
C H A R I E F I
13
C H A R Q E L B
14
C H A R Q E D E
15
C H A R E E L W
16
C H A R J E Y J
17
C H A R X E S D
18
C H A R Z E S D
19
C H A R Z E S D
20
C H A R I E S D
21
C H A R E E S D
22
C H A R J E S D
23
C H A R H E S D
24
C H A R O E S D
25
C H A R Z E S D
26
C H A R M E S D
27
C H A R M E S D
28
C H A R P E S D
29
C H A R U E S D
30
C H A R L E S D

No comments:

Post a Comment