Saturday, 24 July 2010

Monkeys typing Hamlet

Quoted from Chance:
"There is a very, very small (very close to zero, but not quite quite zero) probability that a sequence of randomly typed letters will happen to form Shakespeare's Hamlet. Actually, we can compute the probability. Let's assume there are thirty kinds of typed characters in English: twenty-six letters, comma, period, semicolon, and colon-we will ignore spaces and capital letters; let's give this monkey a break! The chance that the monkey will type correctly the first letter in Hamlet, which is "a" (from "Act I"), is 1/30. We need to multiply this number by 1/30 for the second character typed to agree with Hamlet (meaning, to be the letter "c"). [...] Continuing the multiplication this way, for each of the one hundred forty-two thousand, nine hundred and forty-three characters in the entire tradegy Hamlet, we see that the answer is 1/30 raised to the power 142,943. This number is extremely close to zero-but not exactly zero. It is around 0.0... followed by over two hundred thousand zeros, then a one.[...] Given infinite time (whatever that means), a monkey will type the entire Shakespearean tradegy."

No comments:

Post a Comment