Could monkeys actually write the complete works of Shakespeare?

  • A chimpanzee randomly hitting keys has about a 5% chance of typing “bananas” in its lifetime, but producing Shakespeare is another matter entirely.
  • Even 200,000 chimpanzees typing one key every second until the universe ends would almost certainly never reproduce Shakespeare’s complete works.
  • The calculation shows how infinity can make an event mathematically certain even when it is effectively impossible within the physical limits of our universe.

A monkey can type “bananas” by chance. Shakespeare is another matter entirely. Once the infinite time promised by a famous probability theorem disappears, random typing runs into the hard limits of the universe.

The Infinite Monkey Theorem says a monkey pressing keys randomly for an infinite amount of time would eventually reproduce William Shakespeare’s complete works. The idea is mathematically sound, but a University of Technology Sydney analysis argues that its familiar conclusion becomes misleading in a finite universe.

Associate Professor Stephen Woodcock and Jay Falletta examined what happens when both monkeys and time are limited. Their study replaces infinity with estimated real-world limits.

“The Infinite Monkey Theorem only considers the infinite limit, with either an infinite number of monkeys or an infinite time period of monkey labour,” said Associate Professor Woodcock.

The researchers imagined a monkey population typing on a 30-key keyboard, where the keys included all letters of the English alphabet and common punctuation.
The researchers imagined a monkey population typing on a 30-key keyboard, where the keys included all letters of the English alphabet and common punctuation. (CREDIT: CC BY-SA 4.0)

“We decided to look at the probability of a given string of letters being typed by a finite number of monkeys within a finite time period consistent with estimates for the lifespan of our universe,” he said.

Infinity meets a 30-key keyboard

The theorem depends on a simple probability idea. If an event has a finite, non-zero chance on each independent trial, then its chance of never happening approaches zero as trials approach infinity.

That logic makes Shakespeare inevitable when attempts have no limit. Woodcock and Falletta instead asked what happens when the available number of keystrokes is enormous but finite.

Their model assumed a keyboard with 30 possible keys, covering English letters and common punctuation. Each key had an equal chance of being pressed, and every keystroke was independent.

The researchers first considered one monkey, then extended the calculation to many monkeys typing independently. They modeled the expected number of keystrokes needed before a specific target string appeared.

For their timescale calculations, they assumed one key press every second. A chimpanzee’s working lifespan was set at 10^9 seconds, or just over 30 years.

The team also used a current chimpanzee population of about 200,000. They assumed that population remained constant until the heat death of the universe, estimated at about 10^100 years after the experiment begins.

Table 1. The expected number of keystrokes needed until various phrases would be typed.
Table 1. The expected number of keystrokes needed until various phrases would be typed. (CREDIT: Stephen Woodcock et al, Franklin Open)

“Bananas” is possible, Shakespeare is not

The gap between short words and meaningful literary works becomes immense almost immediately.

The calculations gave a single chimpanzee about a 5% chance of typing the word “bananas” within its own lifetime. That shows how a random process can occasionally produce a recognizable short word.

Longer passages are different.

The researchers examined targets ranging from “I chimp, therefore I am” to Curious George, Pierre Boulle’s Planet of the Apes and the complete works of Shakespeare.

For long texts, the expected number of random keystrokes rises so sharply that even the lifetime of the universe offers almost no help. Shakespeare’s works contain about 884,647 words, according to the study.

Even if every member of the roughly 200,000-strong chimpanzee population typed continuously, the complete Shakespearean collection would almost certainly never appear before the universe reached heat death.

“It is not plausible that, even with improved typing speeds or an increase in chimpanzee populations, monkey labour will ever be a viable tool for developing non-trivial written works,” the authors muse.

The expected number of keystrokes needed until each of the phrases presented in Table 1 would first be produced.
The expected number of keystrokes needed until each of the phrases presented in Table 1 would first be produced. (CREDIT: Stephen Woodcock et al, Franklin Open)

A theorem that changes when infinity disappears

The Infinite Monkey Theorem remains mathematically valid. The problem, according to the authors, comes from applying its infinite conclusion to a universe with finite time and resources.

Their finite version reaches the opposite practical result. Almost any non-trivial target text becomes effectively unreachable when the experiment must end.

“This finding places the theorem among other probability puzzles and paradoxes – such as the St. Petersburg paradox, Zeno’s paradox, and the Ross–Littlewood paradox – where using the idea of infinite resources gives results that don’t match up with what we get when we consider the constraints of our universe,” said Associate Professor Woodcock.

The authors describe the result as a challenge to one of the best-known examples of folk mathematics. Their conclusion does not overturn the theorem’s proof. It shows how dramatically infinity can separate mathematical certainty from physical plausibility.

The model includes several simplifications. It assumes equal probabilities for every key, independent keystrokes and a constant chimpanzee population. It does not consider breeding or the food needed to sustain that population.

For the longest texts, the team used an average of 5.7 characters per word when only word counts were available. That included 4.7 characters per English word plus one space or punctuation mark.

The expected number of keystrokes required to produce target strings of lengths up to L of 100,000. Note that the current chimpanzee population of around 200,000 is equivalent to log10(M) of around 5.3.
The expected number of keystrokes required to produce target strings of lengths up to L of 100,000. Note that the current chimpanzee population of around 200,000 is equivalent to log10(M) of around 5.3. (CREDIT: Stephen Woodcock et al, Franklin Open)

Random text and the question of creativity

The authors also point toward a philosophical question that the calculations do not answer.

Two identical strings could exist, with one written intentionally by a conscious creator and the other produced by chance. The study does not decide whether those outputs should be considered equivalent.

That question has fresh relevance in the era of generative artificial intelligence, where debates about creativity, meaning and consciousness can turn on how an output was produced.

The finite monkey calculation keeps its focus narrower. It shows that random typing is overwhelmingly unlikely to generate substantial written works within the physical limits used in the model.

Arthur C. Clarke once joked about super-chimpanzees becoming a source of labor, only to imagine them eventually forming trade unions. The study closes in a similarly playful spirit, but its mathematics leaves little room for a monkey-powered literary industry.

Practical implications of the research

The analysis gives teachers and students a more realistic way to discuss probability. Infinity can make an event mathematically certain even when that event is effectively impossible within any meaningful physical timescale.

That distinction matters when probability puzzles are used to explain randomness. The finite version shows why mathematical limits should not be confused with realistic expectations.

The work may also help frame discussions about creativity and generated text. Random processes can produce short recognizable sequences, but the study shows how quickly the odds collapse as meaningful text grows longer.

Within the assumptions tested, Shakespeare remains safely beyond the reach of chance-driven chimpanzee typing.

Dig deeper into the Infinite Monkey Theorem and randomness

These resources explore random text generation, the mathematics of improbable sequences, information carried by meaningful language, and the broader question of whether generated output can count as creativity.

Shakespeare, Entropy and Educated Monkeys
This analysis applies information theory to monkeys constrained to produce statistically typical English rather than uniformly random characters. Even with that enormous advantage, generating Hamlet would still require an unimaginably long timescale. (arXiv, 2025)

Simulating Keystroke and Computing the Theoretical Probability of Infinite Monkey Theorem with Markov Process
Researchers used human typing data and a Markov model to estimate how long random processes might take to reproduce Hamlet. Their results again place the required time far beyond achievable cosmic timescales. (arXiv, 2025)

Information rate of meaningful communication
This research uses modern language models to quantify how much information meaningful language communicates, building on earlier work showing that natural language contains substantial statistical redundancy. It helps explain why structured language differs so dramatically from uniformly random typing. (Proceedings of the National Academy of Sciences, 2025)

Power laws for monkeys typing randomly: the case of unequal probabilities
This influential information-theory paper examines what happens when a hypothetical typing monkey does not press every key with equal probability. It shows how surprisingly language-like statistical patterns can arise from simple random-generation rules without producing genuinely meaningful language. (IEEE Transactions on Information Theory, 2004)

Exploration of the creative processes in animals, robots and AI: who holds the authorship?
This analysis examines creativity, agency, consciousness and authorship across animals, humans and artificial systems. It directly addresses the philosophical problem raised by random text: whether an identical output should be regarded differently depending on whether it arose intentionally or by chance. (Humanities and Social Sciences Communications, 2024)

Research findings are available online in the journal Franklin Open.

The original story “Could monkeys actually write the complete works of Shakespeare?” is published in The Brighter Side of News.


Related Stories

Like these kind of feel good stories? Get The Brighter Side of News’ newsletter.


The post Could monkeys actually write the complete works of Shakespeare? appeared first on The Brighter Side of News.

Leave a comment
Stay up to date
Register now to get updates on promotions and coupons
Optimized by Optimole

Shopping cart

×