This is how I plan to write my blog in future. I will keep this little guy in my basement and supply him with bananas until he produces an article I’m happy with. It’s a great method if you’re lazy but patient.
But how patient would I have to be? How long would it actually take?
It’s commonly said that an infinite number of monkeys with typewriters would type out the entire works of Shakespeare. Let’s do some maths and find out just how many monkeys you would need to do this and how long it would take. The answer may surprise you.
First, let’s do a simple example. Let’s sit one monkey down with a typewriter and wait while he types some letters. Let’s give him a really basic typewriter with only 50 keys (the keyboard I’m currently typing on has 105 keys.) Let’s assume that the monkey hits keys purely at random. What is the probability that the monkey types the word monkey?
Well, the probability of typing the letter “m” first is 1/50. The probability of typing the letter “o” second is also 1/50, and so on. Since each letter typed is assumed to be chosen independently of previous letters, the probability of typing monkey is:
(1/50) * (1/50) * (1/50) * (1/50) * (1/50) * (1/50) = (1/50) ^ 6
i.e. one fiftieth raised to the power of 6 (because there are 6 letters.)
This is approximately 1 chance in 15 billion. To have any reasonable expectation of getting a monkey to type the word monkey, we would need to wait a very long time. How long? If each key press takes 1 second, then we would have to wait something like 20 billion seconds, or 500 years.
And that doesn’t include toilet breaks, or time spent picking fleas off your friends.
But what about the entire works of Shakespeare? Shakespeare’s works contain something like 4 million characters (the precise number doesn’t bother me greatly – I’m sloppy like that.) So the chance of typing the whole of Shakespeare’s works without errors is:
(1/50) ^ 4 million
i.e. one fiftieth raised to the power of 4 million, or 10^-6795881.
Unless you’re a mathematician, you’ll probably have only a vague notion of what this means. For comparison, the age of the universe is “only” 4.3 * 10^17 seconds, and the number of atoms in the observable universe is estimated at 10^82 . So even if you had one monkey for every atom in the universe, and they had all been busy typing (without a single toilet break) since the Big Bang, the chance of one of them typing the complete works of Shakespeare would still be utterly negligible.
So damn! My plans for outsourcing my blog to chimpanzees just isn’t going to work, no matter how many bananas I feed them.
Bonus information: in 2003, Paignton Zoo gave a group of 6 monkeys a keyboard connected to a computer to see what they would do with it. After one month, they had typed five pages of the letter “s” and had broken the keyboard.
Thanks to Wolfram Alpha for help with calculating the numbers in this article – my pocket calculator exploded when I tried to do it. By the way, if any of you maths fiends spot any errors in my calculations, please do point them out!