Whilst doing my usual blog reading and coffee-drinking this morning, I came across this statement in yet another one of GQH's seemingly endless posts:
You're not exactly dealing with a chimp here! Because if I were a chimp, I'd've produced a Shakespearean play by now, what with all this random typing I do. And I haven't.Not five minutes earlier my co-worker had shown me the answer to a statistical mechanics problem we had been discussing earlier this week (yes, we're all a bunch of nerds, you wanna make something of it?).
The statistics problem in question?
Suppose that 10^(10th) monkeys have been seated at typewriters throughout the age of the universe, 10^(18th) seconds. This number of monkeys is about three times greater than the present human population of the earth. We suppose that a monkey can hit 10 typewriter keys per second. A typewriter may have 44 keys; we accept lower case letters in place of capital letters. Assuming that Shakespeare’s Hamlet has 10^(5th) characters, will the monkeys hit upon Hamlet?
a) Show that the probability that any given sequence of 10^(5th) characters typed at random will come out in the correct sequence of Hamlet is of the order of (1/44) to the power of (10^5) = 10^(-164,345), where log base 10 of 44 =1.64345.
b) Show that the probability that a monkey Hamlet will be typed in the age of the universe is 10^(-164,316). The probability of Hamlet is therefore zero in any operational sense of an event.
Do you see, dear readers, how the heavens (or some approximation thereof) suddenly aligned, and a beam of light shone down and a voice said, You have the answers to all of the statistical mechanics questions in the universe. You have the power to bring this knowledge to the people. Or, one person in particular who thinks that, if he were a chimp, he should have somehow randomly created a work of Shakespeare by now even though he's only been blogging since September of this year.
Overly complicated answers, I has them. Let me show you them.
Note: I am not solving the problem for the probability that a bunch of chimps (or one chimp) will be able to reproduce Shakespeare. I'm only proving what has already been stated, to wit, the probability of such an event occurring within the time frame of the age of the universe is "therefore zero in any operational sense of an event." (gotta love that math language!) I'm proving that GQH, if he were a chimp, could not possibly be able to reproduce a work of Shakespeare, so he should just stick to continuing to be human(?) and writing excessively long posts with lots of footnotes (and maybe, in a few billion years, he'll get lucky).
Part a): 44^(N) possible typewriter key combinations, a sequence of 10^5 keys pressed at random required to duplicate Hamlet, so N = 10^5 and the total number of possible sequences is 44^(10^5)
One possible correct sequence to recreate Hamlet being typed at random by a chimp:
1/(44^(10^5)) = 10^N = (1/44)^(10^5)
Log base 10^N = log(1/44)^(10^5)
Solve for N:
N = -10^5 log(44)
N= -10^5 * (1.64345)
N = -164345
(1/44)^(10^5) = 10^(-164345) which is the probability that even 10^10 monkeys sitting at typewriters throughout the age of the universe (10^18 seconds) would be able to reproduce Hamlet. In case you're wondering, 10 to the negative anything is a small number. 10 to the negative 164,345 is, like, absolute zero1.
Part b): 10^10 monkeys typing for 10^18 seconds, each hitting 10 keys per second
In 10^18 seconds, 10^29 keys are hit (10^10 + 10^18 + 10^1)
Begin a new sequence each time a key is hit except (10^5)-1
At end of a 10^29 character sequence each 1 character long such that monkeys type 10^29 sequences
Hamlet = 10^5 characters long. Monkeys type (10^29)-(10^5) sequences
Probability of monkey-created Hamlet typed in 10^18 seconds = (10^29) * (10^(-164345)) = 10^(-164316)
(1): Yes, I know absolute zero is a measurement of temperature (-459.67 degrees F, -273.15 deg Celsius, and 0 Kelvin, in case you're wondering). Absolute zero is a state of matter where said matter's molecular energy is minimal; that is, it is characterized by zero entropy and cannot transfer its energy to other systems. What does this have to do with the probability that a chimp will recreate Hamlet? Well, not much, really, (though it might be how y'all are feeling by now after reading this...no energy whatsoever) but I think the concept of absolute zero is fascinating because of what happens to matter when it approaches absolute zero. Y'all ever hear of Bose-Einstein condensates? Superfluidity? NO? OMG, people, Bose-Einstein condensates are SO COOL (literally, HA HA HA...they're cooled to a few billionths of a degree above absolute zero). At that temperature, an entirely new state of matter is created! We're talking quantum mechanics in action, total weirdness! Really awesome, amazing stuff that makes me wish I was a theoretical physicist so I could play with supercooled atoms all day. But I suck at math. :)