rm-hull / cumulative-selection.cljs
Last updated

In his 1986 book The Blind Watchmaker, Richard Dawkins ponders the infinite monkey problem: The scenario is staged to produce a string of gibberish letters, assuming that the selection of each letter in a sequence of 28 characters will be random. The number of possible combinations in this random sequence is 27^28, or about 10^40, so the probability that the monkey will produce a given sequence is extremely low. Any particular sequence of 28 characters could be selected as a "target" phrase, all equally as improbable as Dawkins's chosen target, "METHINKS IT IS LIKE A WEASEL". Dawkins then goes on to show that a process of cumulative selection can take far fewer steps to reach any given target. It duplicates repeatedly, but with a certain chance of random error – 'mutation' – in the copying. By repeating the procedure, a randomly generated sequence of 28 letters and spaces will be gradually changed each generation, and will converge to the target phrase in a hundred-or-so generations.

Fork me on GitHub!