Why a Monkey Has Never Written a Shakespeare Play

With an infinite amount of time, a monkey with a typewriter could write Hamlet… But Shakespeare did it in a year or two.

Nir Zicherman
6 min readJul 19, 2022

(A quick note: If you enjoy this article, please consider subscribing to my newsletter Z-Axis here at zaxis.page)!

One morning during my sophomore year of high school, I excitedly approached my creative writing teacher to tell her about something fascinating I had read. “It’s called the Infinite Monkey Theorem,” I explained. “It says that if you place an infinite number of monkeys in front of an infinite number of typewriters, eventually one of them will write Hamlet.”

My teacher did not share my enthusiasm for the insight. “I don’t like it.”

“Why?” I asked, surprised.

“Because,” she said, “it implies that Hamlet isn’t more than just words.”

Isn’t Hamlet just words, I wondered? Isn’t Abbey Road just sounds put together and The Godfather just pixels on a screen?

For reasons I can’t quite explain, this exchange has stayed with me after all these years, and I often find myself thinking about it. At different times in my life, I’ve interpreted it in different ways. Originally, I assumed she hadn’t taken the time to understand and appreciate the beauty of the Theorem. Later, it seemed to speak to the difference between someone who’s right-brained (like my teacher) and someone who’s left-brained (like me).

Recently, however, I’ve realized that I’m the one who’s been thinking about the Infinite Monkey Theorem the wrong way. Embedded in it is a truth about our universe that is actually the opposite of how I (and many others) instinctively understand it.

Hamlet is just under 30,000 words long. The truth is — much to my creative writing teacher’s chagrin — there is nothing mathematically or scientifically precluding a random process from generating those 30,000 words. In fact, any piece of writing, of any length, could be generated randomly. Any musical composition, of any duration or complexity, could be created in just the same way.

Taking it further, I’d argue that not only is it plausible to generate these things, but that the universe has already generated all of them and more. Take a number like pi, which is an infinitely long real number that never repeats itself. It is likely (although not yet proven) that somewhere within pi, every single combination of numbers can be found.

Numbers can be encodings of letters. That’s how you’re able to read this article, which has been encoded as bytes and decoded back into words on your screen. Therefore, if pi contains every possible sequence of numbers, it contains every possible sequence of letters, and thus words. It contains every phrase ever said, including those not yet uttered. It contains every story ever told and every story that never will be told. It contains Hamlet, and not just Shakespeare’s Hamlet, but the alternate versions, including one where Hamlet is a poodle. It contains this article and the meta essay that describes in excruciating detail the day I wrote this article.

And what’s more, it contains all of the above in every language known to man and every language not yet known to man and every language that could plausible be created by man but never will be.

But despite the fact that embedded in the ratio of a circle’s circumference to its diameter is a multiverse of information, its infinite form and its complete randomness render it completely useless. What good is information in that form? It’s so expansive that its power can never be harnessed for anything useful.

It’s the same with the monkeys and their typewriters. As mentioned, Hamlet has roughly 30,000 words. Yet it would be so hard and take so long to stumble onto that exact sequence of words that we can consider it so improbable it’s effectively impossible. Not exactly impossible, but effectively impossible.

How unlikely is it? Assuming a typewriter with 50 keys, the number of permutations of 30,000 keystrokes is 10⁵⁰⁹⁶⁹. There have only been 10¹⁷ seconds since the Big Bang. There are only 10⁸⁰ particles in the known universe. So 10⁵⁰⁹⁶⁹ is absurdly large. The probability of stumbling on Hamlet by pressing 30,000 random keys is even more unlikely than every single person in Kansas City flipping a coin at the same time and having every single one of them land on heads.

Yet somehow, in a universe that doesn’t even come close to having enough time or space to contain this unlikelihood, the fact of the matter is, William Shakespeare did write Hamlet. Somehow, amidst the absolute chaos of probabilistic infinitudes, the Beatles did make Abbey Road and Francis Ford Coppola did make The Godfather (and somehow followed it up with the even more improbable The Godfather Part II).

A quick aside: If you’re enjoying this article, please consider subscribing to my free weekly newsletter, Z-Axis, by clicking here!

In reflecting on this, and on my high school creative writing teacher’s comment, I can’t help but realize that yes, the Infinite Monkey Theorem does fall short. The Theorem is typically understood to mean: Given enough time, anything that can occur, however unlikely, will eventually occur.

Yes, this is true. But the real beauty is what is implied but not said by the Theorem. It’s the thing I failed to grasp back in high school that my teacher innately understood. Sure, given enough time, anything that can occur will occur. But we have not been given enough time! Not even close. Not even universes within universes could have randomly come up with Hamlet. And yet Hamlet does exist.

So the other reading of the Infinite Monkey Theorem is this: Not given enough time, even beautiful, insightful, miraculous things that are so unlikely to occur can occur with the ingenuity of mankind.

Maybe that’s what “art” is. This term, historically impossible to define, might actually have a root in science and math. Art may just be those things that human beings are able to create despite the enormous forces of the universe working against us (and when I say enormous, I mean meta-astronomically-cosmologically enormous), and which they can imbue with meaning, or from which they can derive meaning.

Where does that leave Hamlet? In some alternate universe, Shakespeare wrote the same play, except that the character of Hamlet is himself a poodle. And in that universe, there is an Infinite Monkey Theorem that similarly explores the improbability of that outcome, and the one-of-a-kind nature of that play.

P.S. The infinite knowledge embedded in pi reminds me of one of the greatest Jorge Luis Borges stories, “The Library of Babel”. In it, Borges imagines an infinite library made up of books of random letters. Because it is infinite, it contains not only every book ever written, but every book that could possibly be written. It contains every possible truth as well as an infinite number of falsehoods. The secrets of the universe, of life, of everything, are hidden somewhere in that library. The only issue is: it’s impossible to find. And if you found it, how would you ever know you found the book of truth, and not one of the infinite books of lies that surround it?

P.P.S. The unlikelihood of art is what this article explores, but it’s far from the most fascinating thing in the set of “things so unlikely to occur they’re effectively impossible, and yet they do occur.” How about the emergence of life, in a universe built never to allow it due to increasing entropy? And how about the fact that despite the unlikelihood of life at all, we — meaning human beings — are so self-aware that we’re able to even reflect on things like the set of “things so unlikely to occur they’re effectively impossible, and yet they do occur”? For a great read on the emergence of life despite the forces of entropy, I very highly recommend The Demon in the Machine by Paul Davies. It’s one of the best books I’ve read in years.

If you enjoyed this article, please consider subscribing to my newsletter, Z-Axis!

--

--

Nir Zicherman

Writer and entrepreneur. Former VP of Audiobooks at Spotify; Co-Founder of Anchor; subscribe to my free weekly newsletter Z-Axis at www.zaxis.page