Finding something worth knowing…

Science

Infinite monkeys will type Hamlet, but a real universe of them never could

Give a monkey a typewriter and eternity, and it will almost surely produce the complete works of Shakespeare, not once but infinitely many times. Shrink the setup to something physical, though, with as many monkeys as there are protons in the observable universe, and even a single page of Hamlet becomes hopeless.

The monkey is a stand-in for any machine spitting out an endless random stream of symbols, and almost surely means with probability one. Try a short word first. On a 50-key typewriter, the chance that six random presses spell banana is under one in 15 billion, small but not zero. Split the stream into blocks of six. After a million blocks, the chance of still having no banana is about 0.9999; after 10 billion, about 0.53; after 100 billion, roughly 0.0017. Keep going forever and that chance sinks to zero.

Hamlet is another matter. Ignoring spaces and capitals, it runs to about 130,000 letters, so a monkey on 26 keys gets even the first 20 right only about once in 20 octillion tries. Turn every proton in the observable universe, around 10 to the 80th, into a typist working from the Big Bang to the end of time, and they would still need hundreds of thousands of orders of magnitude longer for a slim chance. Such a universe would struggle to type any particular 79-character document.

Émile Borel used the monkey image in 1913, and he and Arthur Eddington applied it to the vast timescales behind statistical mechanics. Jorge Luis Borges traced the idea back through Swift and Pascal to Cicero and Aristotle.

Probability one is not the same as certain. An immortal monkey could, in principle, type G forever; nothing compels it to switch keys, and assuming otherwise is the gambler's fallacy. Every specific infinite string, including one made only of the digits of pi, has a prior probability of zero, yet the monkey must produce some string. With a two-key typewriter, each endless output corresponds to a number between 0 and 1.

Source: Infinite monkey theorem

Related

More in Science · All topics