The Infinite Monkey Theorem
"A monkey typing at random for infinite time will almost surely type all of Shakespeare."
"A monkey typing at random for infinite time will almost surely type all of Shakespeare."
The infinite monkey theorem states that a monkey striking keys at random for an infinite amount of time will almost surely type any given text, such as the complete works of Shakespeare. More formally, in an unending sequence of independent random characters, any fixed finite string appears with probability one, and indeed infinitely often. The vivid image dramatises a precise fact about randomness and infinity, and it is routinely misunderstood.
Rated Empirical: grounded in studies or measurable evidence. The other 608.
For any target string, a single random block of the right length matches with a tiny but positive probability. Over many independent attempts, the chance of never matching falls toward zero, so across infinitely many attempts a match is certain. Because the per-trial probability stays fixed and the trials are independent and endless, the string not only appears but recurs endlessly, a consequence of the Borel-Cantelli reasoning. The phrase almost surely means probability one in this infinite limit, not a guarantee within any finite stretch of typing.
A 2024 analysis found that within the universe's lifespan even a vast troop of typing chimpanzees could almost certainly never produce Shakespeare's works, so the popular version misleads about real time.
Émile Borel used the image in 1913 to illustrate statistical mechanics, that some outcomes, while not strictly impossible, are so improbable they can be treated as never happening.
It is a memorable teaching example for almost-sure events and the gulf between what is possible and what is probable: an outcome can be guaranteed in the infinite limit yet effectively impossible in any physical timeframe. It clarifies why arguments that invoke infinite time must be handled carefully, and it is a favourite illustration of randomness, independence, and the meaning of probability one.
The theorem is a rigorous probability result, a consequence of independence and the Borel-Cantelli reasoning, but its content is a limit statement about infinity. It says nothing about finite or realistic timeframes, in which the expected time to produce even a short passage vastly exceeds the age and projected lifespan of the universe. It assumes truly independent, uniform random keystrokes, which real monkeys and many software imitations do not provide. Its reliability is high as mathematics and its reputation as a source of confusion is equally high.
It would not happen in any reasonable timeframe; the expected waiting time dwarfs the lifetime of the cosmos, so probability one here never means soon. Probability one does not mean guaranteed within finite time; it is an asymptotic property that permits the event to be absent from every physically possible run. And software monkeys that use matching shortcuts are not demonstrations of the theorem, which requires genuinely independent random typing.
Yes, as far as the evidence goes. The Infinite Monkey Theorem is rated Empirical here: it rests on studies or measurements rather than on a saying.
Rated from three sources. 609 of the 1,116 entries carry this rating. How the scale works.
The best-known laws are the least likely to rest on measurement.
The modern typing-monkeys image is due to the mathematician Émile Borel in 1913, popularised by Arthur Eddington in 1928, with conceptual antecedents in Aristotle and Cicero on atoms and letters.
10 languages, as recorded on Wikidata. These are names the idea already goes by, not translations we made. The whole index by language.
Everything above traces to doi.org, en.wikipedia.org and phys.org, three sources in all, one of them the original publication rather than an account of it. Nothing is written from memory, and the method is written down. Spot an error or a better source? Suggest a fix.