Secure & Private (Zero Data Retention)
Free Access • No Sign-Up
2 AM Probability & Deep Time
The Infinite Monkey Theorem Odds & Time Calculator
Calculate the statistical permutations, probability, and chronological time required for an idealized primate typing randomly at 10 keystrokes/second to produce any phrase, word, or sentence.
Test Presets:
Probability Per Attempt
1 in 387M
27 available keys (A-Z + space)
Expected Keystrokes
387,420,489
27^L total permutations
Time for 1 Monkey
1.2 Years
At 10 keys / second continuously
Virtual Monkey Live Keystroke Stream:
Click 'Start Simulation' to watch a virtual monkey type randomly...
1. Permutation Search Space Formulation
Given an alphabet size (K = 27) (letters A–Z plus whitespace) and a target phrase length (L), every individual keystroke is modeled as an independent identically distributed (i.i.d.) discrete random variable:
$$P( ext{single character match}) = rac{1}{27}$$
$$P( ext{exact } L ext{-character match}) = left(rac{1}{27}
ight)^L = 27^{-L}$$
2. Expected Keystrokes & Geometric Distribution
The waiting time until the first occurrence of a non-overlapping Bernoulli sequence follows a geometric distribution with mean:
$$E[ ext{keystrokes}] = 27^L$$
For length (L=6) (e.g. "BANANA"), (E = 27^6 = 387,420,489) keystrokes.
For length (L=12) (e.g. "TO BE OR NOT"), (E = 27^{12} approx 1.50 imes 10^{17}) keystrokes.
3. Deep Time vs Cosmic Age Benchmarking
$$ ext{Time in Seconds} = rac{E[ ext{keystrokes}]}{ ext{Typing Speed (10 keys/s)}}$$
The observable universe is approximately 13.8 billion years old ((4.35 imes 10^{17}) seconds). A single monkey typing at 10 keystrokes/s produces (4.35 imes 10^{18}) characters in the entire history of the universe—sufficient only to reliably produce strings of length (L le 13).
5 Critical Misconceptions & Combinatorial Traps
1. The Independent Trials vs Continuous Stream Trap
In a continuous stream, trials are not independent disjoint blocks of (L) characters. Because a target word can begin at any keystroke index, overlapping subsequences reduce the mean waiting time. However, if the word has periodic autocorrelations (like "ANANAS"), self-overlaps increase the variance and conditional waiting time.
Typing a short 40-character phrase requires (27^{40} approx 1.79 imes 10^{57}) keystrokes. By comparison, planet Earth contains approximately (1.33 imes 10^{50}) atoms. Even if every atom on Earth were an ultra-fast quantum computer typing a billion words per second since the Big Bang, they would not yet have produced a single 40-character sentence.
3. Biological Primates Are Not Uniform Pseudo-Random Generators
In 2002, researchers at Paignton Zoo gave a computer keyboard to six Celebes crested macaques. The monkeys did not produce random text; they mashed the letter 'S' repeatedly, hit the keyboard with a rock, and urinated on the electronics. Real animals exhibit heavy biological bias, destroying mathematical randomness.
4. The Hamlet Delusion & The Heat Death Limit
Popular culture claims monkeys will eventually type Shakespeare's complete works. But the entire universe will suffer thermodynamic Heat Death ((10^{100}) years) long before a monkey randomly types even the first scene of Hamlet ((27^{130,000}) permutations). Mathematical infinity cannot be realized in a finite universe.
5. The Mathematical Definition of "Almost Surely"
In measure theory, an event occurring "almost surely" (probability 1) means the set of non-occurring sequences has Lebesgue measure zero. However, measure zero does NOT mean impossible—a monkey could theoretically type the letter "A" for eternity. Probability 1 does not guarantee physical manifestation in finite spacetime.
The theorem states that an infinite sequence of random keystrokes on a typewriter will almost surely contain any given text, including the complete works of William Shakespeare, because the probability of the string appearing somewhere in an infinite sequence approaches 1.
Because the search space scales exponentially ((27^L)). Each additional character increases the number of possible permutations by a factor of 27. Going from a 6-letter word to an 8-letter word multiplies the expected keystrokes by (27 imes 27 = 729).
'BANANA' has 6 letters. On a 27-key keyboard, there are (27^6 = 387,420,489) combinations. At 10 keystrokes per second, a single monkey would take approximately 38.7 million seconds (1.23 years) of non-stop typing to produce it.
Yes. In 2002, the University of Plymouth tested six crested macaques. Over one month, they produced five pages of text largely composed of the letter 'S', smashed the computer with a stone, and defecated on it, demonstrating that living primates do not behave like statistical random variables.
A pseudo-random algorithm produces uniform character distributions across all keys. Physical primates exhibit motor fatigue, positional preferences (hitting keys nearest their dominant hand), and behavioral patterns that introduce heavy entropy distortions.