Monday

May 20th, 2024

Insight

Shakespeare, mathematics and the monkey who called 911

Nicholas Goldberg

By Nicholas Goldberg

Published August 29, 2022

Shakespeare, mathematics and the monkey who called 911
Have you heard about the monkey who called 911?

Two weeks ago the San Luis Obispo County sheriff's office received a 911 call, but there was no voice on the other end. Baffled, deputies were dispatched to the source — a local zoo — to hunt down the caller, but they found no humans in distress. Instead they realized that a capuchin monkey named Route had grabbed a mislaid cellphone and randomly banged at the keypad until she called the emergency number.

Everyone laughed it off. The news stories said things such as "that's bananas" and dismissed it as "monkey business." But the story got me wondering. How likely was it that the monkey would call 911? Of all the keys Route could have punched, what were the chances she would hit a 9, a 1, another 1 and then the green "connect" button all in a row (assuming she didn't just happen on an "emergency" key)?

So I did some research. Very little, because I'm not mathematically minded. But here's what I learned.

If there were 13 buttons on the phone keypad (10 numbers, plus an *, a # and the connect button), Route had a 1 in 13 chance of hitting the 9 randomly. The chance of hitting the 1 next was also 1 in 13, as was the chance of hitting a third 1 and the same for "connect." The chance of hitting the full four-button combination was 1 in 13 X 13 X 13 X 13. Or 1 in 28,561.

The more keys she struck, the better her chances became. (This doesn't take into account that she might also have to disconnect between tries.)

On the face of it, Route's story is just an amusing little anecdote. But it brought to mind something else — the old thought experiment that basically hypothesizes that an infinite number of monkeys typing for an infinite amount of time would eventually produce "Hamlet."

I always assumed this was just a bit of drunken barroom philoso-babble. But it turns out it's a real thing. It even has a name: the "infinite monkey theorem."

And it isn't really babble: The infinite monkey theorem is not only true, it raises serious questions — cosmic, existential questions, such as whether meaning can arise out of chaos, or complexity out of randomness.

Scientists, for instance, have used the parable of the typing monkeys in debates over how evolution could have occurred from random mutations.

Sign up for the daily JWR update. It's free. Just click here.

It also makes you wonder about the distinction between genius and dumb luck. It even seems to hint that Shakespeare isn't so great after all because a bunch of monkeys could write his plays.

Apparently many non-mathematicians don't believe the infinite monkey theorem is true when they first hear it. That's because humans have a difficult time with the concept of infinity.

Infinite time is not just a long time. It's forever.

Given that there are a limited number of keys on a typewriter and that the monkeys have an unlimited amount of time to type, it stands to reason that eventually every possible combination of keys will be struck. So the monkeys will almost certainly type "Hamlet" sooner or later. And "King Lear." And everything else ever written.

In fact, you wouldn't even need an infinite number of monkeys; one would suffice. (Admittedly, he or she would have to live forever.)

"In infinite time, even things that are extremely unlikely will happen," says Deanna Needell, a professor of applied mathematics at UCLA. "They seem unfathomable because we live finite lives and think in finite terms. But in infinite time all those unthinkable things? They happen."

So now let's imagine that the monkeys don't have infinite time. Could 100 of them type "Hamlet" in 100 years? A thousand years? How long would it take?

There have been a number of efforts to answer this. My favorite requires no math skills whatsoever. In 2003, professors and students at Plymouth University in England put a computer into a cage with six crested macaques for a month.

This did not result in "Hamlet."

Instead the monkeys typed about five pages of gibberish, mostly using the letter S. They also hit the keyboard repeatedly with a rock. And they "soiled" it, apparently by urinating on it.

Thus proving the statement attributed to MIT mathematician Gian-Carlo Rota: "Giving monkeys typewriters is not a practical method for writing plays."

Another effort to randomly type Shakespeare was undertaken by data engineer Jesse Anderson in 2011 — a computer-based simulation.

Anderson created millions of virtual monkeys that typed random sequences of text, each nine characters long. The strings of characters were then checked against all of Shakespeare's works. When they matched, they were kept and used like a jigsaw puzzle piece toward the creation of the whole.

Anderson's program re-created Shakespeare relatively quickly. But mathematicians said his methodology made it too easy.

Ian Stewart, an emeritus professor of math at the University of Warwick, told the BBC that it would actually take "longer than the age of the universe" for a monkey — or a virtual monkey — to randomly type a flawless re-creation of Shakespeare's works.

Sign up for the daily JWR update. It's free. Just click here.

To understand that, remember that there are 26 characters on a typewriter (counting just the letters). The likelihood of typing just the first 20 letters correctly of "Hamlet" would be 1 in 26-raised-to-the-20th-power, or 1 in 19,928,148,895,209,409,152,340,197,376, according to Wikipedia. (That's ignoring punctuation, spaces, capitals and apostrophes.)

And that's just the first 20 letters. "Hamlet" has more than 130,000 characters.

Of course, just as interesting as how long it would take is what it would mean were it to happen. Would "Hamlet" still be "Hamlet" if it was typed by random chance?

If the monkey (or computer program) that typed it lacked the intention to communicate but was driven entirely by luck and happenstance, has it really created a play? Is the monkey another Shakespeare?

Some philosophers seem to think so.

But I think that's bananas.

(COMMENT, BELOW)

Nicholas Goldberg
Los Angeles Times/(TNS)

Nicholas Goldberg is an associate editor and op-ed columnist for the Los Angeles Times.

Previously:
08/15/22The creepy battle over Charles Manson's paltry estate
07/27/22Why do people believe in conspiracy theories?
07/20/22 How would you feel if you lost $58 billion? Would you still buy that superyacht?
07/13/22 Are animals people, too?
07/06/22 Are Joe Biden -- and Dianne Feinstein -- too old to do their jobs?
05/19/22 Huge corporate diversity loss. GREAT
04/20/22 When bathrooms have naming rights, has branding gone too far?
04/13/22 Why I won't cheer as Germany ends its antiwar experiment
04/04/22 In Europe, the war in Ukraine raises the question --- is the past really past?
02/22/22 What if the CIA is spying on Americans?
02/10/22 Is civility really passe in American politics?
01/27/22 Why do murderers have to show 'remorse' to be granted parole?
01/25/22 Are you anxious about reentering the post-COVID world? Maybe you have 'cave syndrome'
01/11/22 When an anti-vaxxer dies of COVID, is that cause for glib, ironic satisfaction?
12/29/21 Can the US strike a balance between isolationism and policing the world?
12/16/21 If the Miss America beauty pageant isn't a beauty pageant, then what exactly is it?
12/08/21 How did the party of 'Happy Days Are Here Again' become the party of Eeyore?
11/11/21 History reveals: Nicholas Kristof for political office? Delusional
10/01/21 Think vaccine mandates are controversial? What if police held you down and injected you?
09/13/21 If you don't say what they like, protesters show up at your door. Is that OK?
08/05/21 Think toxic Cuomo will resign? Think, again!
07/14/21 A moral mosquito dilemma in LALA-land
06/29/21Is life fair? One-third of Americans think so
04/27/21: The Supreme Court debates the all-powerful F-word
03/25/21: Do we really need a law mandating gender-neutral toy sections at stores?
03/15/21: I've had a cellphone for 25 years. Can I get rid of my landline yet
03/15/21: After 365 days of COVID exile, I went back to my office. Here's what I found
02/12/21: The preacher and the pornographer: The unlikely, unexaggerated friendship between Jerry Falwell and Larry Flynt
02/10/21: Some newspapers are deleting old crime stories to give people fresh starts. Is that wise?
12/28/20: Should Bill Cosby's sexual assault conviction be overturned?

Columnists

Toons