Why a Monkey Still Hasn't Written a Shakespeare Play

With an infinite amount of time, a monkey with a typewriter could write Hamlet…

Revisiting Monkeys

Two years ago (only several months before the initial release of ChatGPT), I published an article I called Why a Monkey Has Never Written a Shakespeare Play. It’s one of my favorites I’ve written, and I’ve recently begun thinking about it in a context I couldn’t have imagined then: as applied to the advent of large language models (i.e. artificial intelligence).

Below is a shortened version of the article, plus some new thoughts about what this all means for AI. Shoot me an email and tell me what you think! And if you know anyone else who might enjoy it, please forward this along. Sharing is the number one way this newsletter is able to grow.

Tenth Grade

One morning during my sophomore year of high school, I excitedly approached my creative writing teacher to tell her about something fascinating I’d 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 sound frequencies 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? Even if every one of the words in Hamlet was only one letter long, the number of permutations of 30,000 keystrokes would be 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. Comically large. The type of large that the human brain can’t even begin to comprehend.

And Yet…

And 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).

The Infinite Monkey 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. Art may just be those things that human beings are able to create despite the enormous forces of the universe working against us, and which they can imbue with meaning, or from which they can derive meaning.


So what does this all mean in 2024, when it has become impossible to have any conversation about art or language or creativity without mentioning artificial intelligence?

First, it certainly seems that we’ve finally given some monkeys some typewriters, except the monkeys are giant tech corporations, and the typewriters are large language models with trillions of parameters. But there’s a twist: We’ve trained these monkeys to be slightly less random. However, no matter how effective the monkeys become at pressing keys to mimic certain patterns found in human-made training data, they will never understand the words they’re typing.

The monkeys (read: the AI systems) may now produce Hamlet much faster than ever before. But they won’t realize they’ve done it. They can’t explain why the one written by Shakespeare is qualitatively better than the one in which Hamlet is a poodle. And if they can explain it, it’s because they’re copying the insights made by countless human writers that came before.

But a second thought: That randomness embedded in pi or random keystrokes that previously seemed un-harnessable suddenly seems a bit less un-harnessable. We find ourselves at the precipice of so much more content existing than ever before. And it makes one wonder whether that will bring out more beauty and let the cream rise to the top… Or if the works of genius will never be found, because they’ll be drowned out by the drivel.

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.

P.P.P.S. If you’re reading this newsletter for the first time, welcome! Subscribe here to get thought-provoking articles sent to your inbox weekly: