Curious George Discovers the Infinite Monkey Theorem

Ben Lahner
3 min readJan 1, 2024

--

Image generated by Stable Diffusion using the prompt, “A cartoon image of the monkey curious george hard at work typing on a keyboard.”

This is George. He wants to write a book. He ironically wants to call it, “Curious George Discovers the Infinite Monkey Theorem.” However, George is just a monkey — he doesn’t know how to write his name let alone an entire book. But he reasons that if he just randomly bangs on the keyboard for long enough then surely he can write his book!

After a year of random typing, the man in the yellow hat checks George’s progress to discover that he only typed the first five characters of the title, “curio”. George recognizes he cannot do this alone.

He recruits 100,000 of his smartest friends gainfully employed in research facilities across the globe for help. After a full year of 100,000 monkeys randomly typing, the man in the yellow hat again checks their work to discover they have only written the first 9 characters, “curious g”. While the additional monkeys helped, George realizes they are going to need more time.

George negotiates a cagey employment contract with all his friends. In exchange for typing the rest of their 40 year lives, they will receive a 1/100000 profit split on their completed book. 40 years go by, and the man in the yellow hat is excited to publish their much anticipated book. But to his dismay, the monkeys just barely managed to type, “curious geo” — hardly a best-seller! An additional 39 years of typing resulted in only two additional characters — “curious g” to “curious geo.”

But what if George and his friends were not limited by their 40 year life expectancies? How long would it take to finish their book? After 1.26x10⁶⁵ years, one of the 100,000 monkeys would have a 50% chance of randomly typing the full title, “curious george discovers the infinite monkey theorem” [1]. To type an entire children’s book of 4500 characters, they would need a whopping 1.02x10⁶⁷⁶⁰ years. These numbers are unfathomably large. Monkeys are thought to have first evolved 5.5x10⁷ (55 million) years ago, the age of the universe is 1.37x10¹⁰ (13.7 billion) years old, there are an estimated 1x10⁸² atoms in the universe — you get the idea.

It turns out George’s reasoning from the beginning was correct — according to the Infinite Monkey Theorem, he could write his children’s book — or any book — by randomly typing for a long enough amount of time. Unfortunately, that length of time happens to be near infinity.

Feel free to play with the code to vary the number of monkeys, how fast they type, the number of keys on the keyboard, etc.

[1] Calculating the probability of randomly typing even the title can take days on a normal computer. So to speed things up, I fit an exponential function to a handful of data points I did have the patience to compute. I fit the function f(x) = a*b^(x-c), where a= 7.639288944484754e-05, b= 32.00000045224133, c= 6.012772609139376.

--

--

Ben Lahner

I enjoy tackling questions that appear impossible to answer. Current PhD student @MIT. Website: https://blahner.github.io/