Science

Monkeys would take 7 universe lifespans to type works of Shakespeare

Monkeys would take 7 universe lifespans to type works of Shakespeare
"It was the best of times, it was the blurst of times."
"It was the best of times, it was the blurst of times."
View 2 Images
"It was the best of times, it was the blurst of times."
1/2
"It was the best of times, it was the blurst of times."
The expected number of keystrokes needed until various texts would first be produced. Note the vertical scale, which is in units of log10(log10) universe deaths, truncated at 0. Points above 1 on this axis correspond to strings which are almost certain never to be typed before the universe ends.
2/2
The expected number of keystrokes needed until various texts would first be produced. Note the vertical scale, which is in units of log10(log10) universe deaths, truncated at 0. Points above 1 on this axis correspond to strings which are almost certain never to be typed before the universe ends.

Along with Schrödinger’s Cat, the Infinite Monkeys Theorem is one of the most famous thought experiments. A new study, with tongue firmly in cheek, has calculated that you might be waiting seven googol years for your Shakespeare.

According to the Infinite Monkeys Theorem, if you had an army of monkeys typing away forever, they’d eventually produce the entire works of Shakespeare by pure chance. It’s a mathematical exercise in probabilities when infinity is involved – basically, if there’s a non-zero chance of an event occurring, it will almost certainly occur at some point if spread out over infinite time.

In theory, it’s mathematically true, but obviously in our finite universe, it’s impossible to have infinite monkeys or infinite time. But what if you grounded it in finite terms? Mathematicians in Australia have now crunched the numbers on when you might expect their work to be finished.

“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,” said Stephen Woodcock, co-lead author of the study.

For their calculations, the team assumed the monkeys were using a keyboard containing 30 keys – the 26 letters of the English alphabet, plus the most common punctuation marks. Each chimp is assumed to press one random key every second.

Then, they calculated the chances that certain monkey-themed texts would be typed out by a single chimpanzee in its lifetime, or a population of 200,000 – a rough estimate of how many are thought to be alive today – working until the heat death of the universe. That’s thought to be about 1 googol years from now, which is a 1 followed by 100 zeroes. They’ve got time.

As you might expect, the simpler the phrase, the better the chance that the monkeys would eventually write it among their random key mashing. There was a 5% chance that a single chimp would accurately spell out the word ‘bananas’ within its own 30-year lifetime, and close to 100% chance that it would be found among the ramblings of 200,000 of them before the universe died.

The slightly more complex phrase, ‘I chimp, therefore I am’ would have a vanishingly tiny chance of being written out by any one chimp in its lifetime: 0.000000000000000000000001%. Again though, it trends close to 100% when spread across the remainder of the universe’s lifespan.

Beyond that though, you’re extremely unlikely to see longer texts ever crop up, even when given an unfathomable amount of time. The odds of the 1,800 words that comprise Curious George bering typed out? It’s buried more than 15,000 zeroes after a decimal point.

For the original Planet of the Apes novel, made up of about 83,000 words, the probability involves almost 700,000 decimal-place zeroes. And for the complete works of the Bard, with around 885,000 words, there’s close to 7.5 million zeroes before you get to the meaty numbers.

Put another way, it’d take 200,000 monkeys more than four times the expected lifespan of the universe before they stumbled onto Curious George, almost six before they got to Planet of the Apes, and you’d have to see seven universes live and die before the works of Shakespeare appeared. We can't even imagine the frustration of a monkey making a typo in the last line of The Two Noble Kinsmen and having to start over.

The expected number of keystrokes needed until various texts would first be produced. Note the vertical scale, which is in units of log10(log10) universe deaths, truncated at 0. Points above 1 on this axis correspond to strings which are almost certain never to be typed before the universe ends.
The expected number of keystrokes needed until various texts would first be produced. Note the vertical scale, which is in units of log10(log10) universe deaths, truncated at 0. Points above 1 on this axis correspond to strings which are almost certain never to be typed before the universe ends.

“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 Woodcock.

Of course, it could be argued that the point of the original thought experiment wasn’t to be taken as a literal method of producing great works, but just an exercise in illustrating the concept of infinity. After all, having 200,000 immortal or self-replicating monkeys working consistently until the end of the universe is just as infeasible as having infinite time to begin with. But still, even mathematicians need to have a bit of fun sometimes.

“As such,” the paper finishes, “we have to conclude that Shakespeare himself inadvertently provided the answer as to whether monkey labour could meaningfully be a replacement for human endeavor as a source of scholarship or creativity.

“To quote Hamlet, Act 3, Scene 3, Line 87: ‘No.’”

The paper was published in the journal Franklin Open.

Source: University of Technology, Sydney

11 comments
11 comments
c w
That's not a monkey.
paul314
The only saving grace is that most key-mashers operate more than one key a second. So it might be only 2 or 3 times the projected life of the universe.
Nostradamus
This sounds like a huge underestimation of monkeys.
veryken
Not googol in time. Rather, it's a googol in chance. The time supposition is about an instant Shakespearean volume in its entirety at some magical moment — or a build-up of keystroke character after keystroke character, all preserved intact by monkey historians in proper logical archival sequence, which ain't ever gonna happen because of chance of muck-up.

Better chance of alien DNA recombination.
TechGazer
I think that's a silly thought experiment because it leaves out the fact that you need some intelligent being or device to identify which set of pages has the random letters in the right places. Otherwise they're just producing a lot of random noise.
Spud Murphy
What's more troubling is that the researchers got paid to do this. Of all the things they could be doing with their time, they did this?
rgbatduke
Two comments. First, there are some obvious, egregious errors in arithmetic. If the probability of a chimpanzee typing out Shakespeare in its lifetime is 1-ish in 10^{75,000,000} as the article asserts, well, the expected lifetime of the Universe is only 10^14 years or so. Even if you count it as 10^22 seconds or so, it is mere noise. How many Universe lifetimes? Not seven. More like 10^{75,000,000} as dividing that by the lifetime of the Universe doesn't meaningfully change the exponent on a log scale.

Second, the amusing thing about this is that a couple of million years ago, Gorilla's, Chimps, and Humans likely had a common ancestor. You can even see the point where the crucial shared chromosome changed. by comparing their mutual and distinct genome. William Shakespeare was, in fact, a heavily mutated, evolved, MONKEY. So the correct, EMPIRICAL answer to the question how long would it take a few million monkeys to type out Shakespeare is -- a couple of million years, as long as you put the monkeys in an evolutionary environment that strongly favors the development of literate intelligence!
LLicit
This type of argument is often used by creationists, but they are largely missing the point. Yes it's extremely unlikely they would type the complete Hamlet randomly. But if one monkey happens to type "To", and then all 200,000 switch to that, then pretty quickly you can get to "To be, or not to be" and so on which better reflects the evolutionary process.
Steve Pretty
We already have the works of Shakespeare, so our monkeys could make better use of their time. And yes, chimps are not monkeys, they are apes!
Ari Loucks
That will take a while. Thank God for evolution.
Load More