If you gave a monkey a typewriter and a billion years, could it eventually type the complete works of William Shakespeare?
This sounds like a joke, but it is actually one of the most famous thought experiments in history. It helps us explore the strange relationship between probability, the nature of infinity, and the messy reality of the world we live in.
Imagine a room that stretches on forever. Inside this room, there are rows upon rows of desks, and at every desk sits a very patient monkey.
Each monkey has a typewriter, a machine with keys that stamp letters onto paper. The monkeys aren't writers: they are just hitting keys at random, over and over again.
Imagine the sound of a million typewriters all clicking at once: clack-clack-clack-ding! The room smells like old paper and ink, and the floor is covered in a mountain of discarded pages that look like alphabet soup.
Most of what they type is complete nonsense. You might see pages filled with "ajkhdfg" or "qqqqqqqqq" or even just a long string of spaces.
But every once in a while, a monkey might accidentally type a real word, like "CAT" or "APPLE." If you have enough monkeys and enough time, could they accidentally type something beautiful?
The Birth of the Typing Monkey
This idea did not start with a zoo. It started in the mind of a French mathematician named Émile Borel in the year 1913.
At that time, the world was changing quickly. Cars were replacing horses, and the typewriter was the most advanced way to share ideas. Borel was thinking about statistical mechanics, which is a fancy way of saying how tiny, random movements can create big, predictable results.
Finn says:
"If the monkeys are typing forever, do they ever get to take a break for bananas? I think I'd get bored after the first page of gibberish!"
Borel wanted to show that even if something is extremely unlikely, it is not the same as being impossible. He used the image of monkeys typing to explain that even the most complex patterns can happen by pure chance if you wait long enough.
![]()
Such is the case of the dactylographic monkeys, who, if they typed long enough, would end up providing all the books in the world.
Borel’s monkeys were never meant to be real animals. They were symbols for randomness. He was asking us to imagine a world where time never ends and every possibility gets a turn to happen.
The Difference Between Impossible and Unlikely
To understand why this works, we have to look at how many choices the monkey has. A standard typewriter has about 50 keys.
If a monkey hits one key, there is a 1 in 50 chance it will be the letter "T." If it hits two keys, the chance it will type "TO" becomes 1 in 2,500.
Grab a coin. Heads is the letter 'A' and Tails is the letter 'B'. Try to 'type' the word 'ABA' by flipping the coin three times. How many tries does it take you to get it exactly right? Now imagine trying to flip for a whole sentence!
By the time you get to a full sentence, the numbers become so large that our brains can’t really imagine them. Typing the first line of Hamlet (a very famous play) would require the monkey to hit the correct 30 keys in exactly the right order.
Mira says:
"It’s like looking at a cloud that looks exactly like a dragon. The cloud didn't try to be a dragon, it just happened because there are so many clouds and so many shapes."
Mathematically, the chance of this happening is nearly zero. But in philosophy, "nearly zero" is not the same as "zero."
When Real Monkeys Met Real Computers
In 2002, a group of scientists in England decided to see what would happen if they tried a version of this for real. They didn't have a million years, but they did have six macaques at the Paignton Zoo and a computer keyboard.
In the real-life Paignton Zoo experiment, the monkeys didn't just type letters. One of the monkeys, the leader of the group, started by smashing the computer with a stone. It turns out real monkeys have their own ideas about art!
They left the computer in the monkey enclosure for a month. The result? The monkeys did not write Shakespeare.
In fact, they mostly just typed the letter "S" over and over again. They also jumped on the keyboard, spilled things on it, and eventually decided it made a better bathroom than a writing tool.
This shows us the gap between a mathematical theory and the messy, physical world. A mathematical monkey never gets tired, never gets bored, and never has to go to the bathroom.
![]()
If I let my fingers wander idly over the keys of a typewriter, it might happen that my screed made an intelligible sentence.
Sir Arthur Eddington was a famous scientist who helped prove Einstein’s ideas. He used the monkey example to explain that the laws of physics are based on what is likely to happen, not what must happen.
The Power of the Infinite
The most important word in the theorem is infinite. Most of us think of "infinite" as just a very big number, like a trillion or a quadrillion.
But infinity is not a number: it is a direction that never ends. If you have infinite time, you aren't just waiting a long time. You are waiting longer than the universe has even existed.
The Math says that with enough time, a monkey will definitely write Shakespeare. Math deals with perfect logic and the idea that forever actually exists.
The Physical World says the universe will likely end before the monkey even finishes the first chapter. Real things like gravity and time have limits.
In an infinite timeline, every single possible thing that could happen must happen. This means the monkey wouldn't just type Shakespeare once.
He would type it a million times. He would also type your biography, the secret to time travel, and every single grocery list your family has ever written.
A History of Randomness
The Library of Everything
A writer named Jorge Luis Borges took this idea even further. He imagined a place called the Library of Babel. This library contained every possible book that could ever be written.
![]()
The Library is total... it contains all that it is given to express, in all languages.
Borges was pointing out a spooky problem: if you have every possible book, most of them are total gibberish. Finding the one book that makes sense would be like finding a single grain of gold in a desert of sand.
Mira says:
"If a robot writes a beautiful poem by accident, is it still beautiful? Or do we need to know that someone felt something when they wrote it?"
This makes us wonder: is a book valuable because of the letters on the page, or because a human mind put them there with a specific intention?
Modern Monkeys: Computers and AI
Today, we don’t use typewriters much, but we have computers that can generate billions of random letters in seconds. People have actually run "Virtual Monkey" programs on the internet.
In 2011, a programmer created a project that simulated millions of monkeys. These digital monkeys eventually managed to type a poem by Shakespeare called A Lover’s Complaint.
The number of pages a monkey would have to type to accidentally finish Hamlet is so large that there aren't enough atoms in the entire universe to even write the number down on paper!
Even with millions of simulated monkeys working at lightning speed, it still took months to get even one short poem. It reminds us that while the theorem is true, the scale of it is so vast that it might as well be magic.
We live in a world that feels very organized, but underneath it all, there is a lot of randomness. The Infinite Monkey Theorem teaches us to be curious about that randomness. It invites us to look at the stars, or a page of a book, and wonder about the tiny, unlikely chances that brought them into being.
Something to Think About
If you found a perfect poem written by a monkey, would it be just as special as a poem written by your best friend?
Think about whether the 'meaning' of a story comes from the words themselves, or from the person who chose to share them with you. There is no right or wrong answer.
Questions About Philosophy
Has a monkey ever actually typed Shakespeare?
Why do they use monkeys in the example?
Does this theorem apply to more than just typing?
The Meaning in the Mess
The Infinite Monkey Theorem reminds us that we live in a universe of infinite possibilities. Even when things feel chaotic or random, there is always a chance for something beautiful to emerge. Keep looking for patterns in the stars, in the clouds, and in the words you read today.