Monkeys on a Typewriter

""Hanging out while the monkeys type away...""

- They Might Be Giants, We Live in a Dump

A standard thought experiment from probability theory states that a million monkeys hammering a million typewriters (or a hundred, or a thousand) will eventually write the entire works of Shakespeare (or Dickens, or all the books in the British Library). This is a vivid enough mental image that it gets referenced a lot in fiction.

One common joke is to assume that the number of monkeys required to write something is proportional to its artistic merit, so Shakespeare might take a million monkeys a million years, but three monkeys could write Atlanta Nights in half a day. This isn't actually true (in fact, all that matters is the length of the thing that the monkeys are replicating), but it is funny. When we start throwing infinity in it (which is implied by the "eventually" in the first sentence of this page), then either one monkey is enough given an infinite time, or among infinite monkeys typing (for example) 400 pages each, one will type a particular 400-page text on the first try.

While they are part of the most common descriptions of this idea, versions involving "thousands" or "millions" of monkeys may confuse someone into thinking there is some kind of practical possibility of producing Shakespeare with monkeys, if we could only wait for a few million years. Some paraphrases of the problem even forget to mention the "eventually" or "infinite" part and say that you just need "a million monkeys for a million years". In fact, even if you replaced every atom in the universe with a monkey and a typewriter, and they all typed a thousand characters per second, the odds of their producing Hamlet (as well as the odds of any other specific text of the same length) within an octillion octillion years are still incomprehensibly low. However, such huge quantities of monkeys and time are no match for infinity, which is where the magic happens.

The point is that the monkeys are flailing at the keys without understanding the point of the machine. Given enough time or enough monkeys, or both, one of them will accidently hit the keys in the order "[shift]T-o[space]b-e[comma][space]o-r[space]n-o-t[space]t-o[space]b-e..." There is also some non-infinite yet unimaginably large number of years within which typing Hamlet has a probability of 99%, but the chance still doesn't reach 100% until infinity.

Robert Wilensky complemented this with the statement that "Now, thanks to the Internet, we know this is not true." See also The Other Wiki.

Comedy

 * Bob Newhart had a comedy routine where this experiment was actually being run, and he was one of the monkey handlers. It ended with, "To be, or not to be? That is the gzornnplat."

Literature

 * From The Hitchhiker's Guide to the Galaxy: After Arthur and Ford are rescued from virtually certain death from asphyxiation in interstellar space, there is a sequence of bizarrely improbable events on board the ship that rescued them-- because the ship is powered by the Infinite Improbability Generator. One of these events is Arthur and Ford being approached by "an infinite number of monkeys who want to talk to us about this script for Hamlet they've worked out."
 * Paper Towns. Q to Ben: "Getting you a date to prom is so hard that a thousand monkeys typing at a thousand typewriters for a thousand years would never once type I will go to prom with Ben.
 * In "Inflexible Logic" by Russell Maloney, the main character assembles six chimps and puts them to work; in defiance of the laws of probability, they instantly start writing out all the books in the British Museum and keep doing so until a scientist goes berserk and shoots all of them.
 * Alluded to in Matt Ruff's first novel, Fool On The Hill, which is otherwise chock full o' playing with trope.
 * The Red Pyramid does it using ibises instead of monkeys.
 * RA Lafferty once wrote a story referencing this idea. At the end of a vast span of time it seems that the monkeys have finally got it right, until someone notices a tiny error...
 * Done by the Goliath Corporation in the Thursday Next books, but they considerably improve the odds by using (imperfect) clones of Shakespeare instead of monkeys.
 * In Gulliver's Travels, one of the absurd inventions created by the Laputan intellectuals is a device for randomly combining words so that "the most ignorant person, at a reasonable charge, and with a little bodily labour, might write books in philosophy, poetry, politics, laws, mathematics, and theology, without the least assistance from genius or study".

Live Action TV
"Doctor: You and I both know, at the end of a millennium they'd still be tapping out gibberish.
 * In the Doctor Who episode "Mawdryn Undead", the Doctor and Tegan discuss this trope as it applies to "a treeful of monkeys".

Tegan: And you'd be right there tapping it out with them."

""Somewhere, those million chimps, with their million typewriters, must've written King Lear.""
 * In the That 70s Show episode "Battle of the Sexists", after Donna manages to score in a basketball game, Eric yells, "Pinciotti actually scores! Hell freezes over! A monkey types Hamlet!"
 * In Veronica Mars, Veronica gets hauled into the police station for questioning about the death of "Curly" Moran, who she thinks she's never heard of. When she realizes that she actually does know him -- in a seemingly totally different context -- she thinks:

"Kermit: I'll never know what they see in that thing."
 * The Colbert Report has a segment about how many different monkeys it takes to produce different authors' works. Apparently it's a million monkeys typing for all eternity to get Shakespeare, ten thousand drunk monkeys typing for ten thousand years to get Hemingway, and ten monkeys for three days to get Dan Brown.
 * In one episode of Muppets Tonight, we learn that the show's scripters are actual Muppet monkeys, mindlessly pounding at typewriters going "Ook-ack-ook!". Once they come up with a satisfactory script, Kermit lets them go touch the monolith.

""On Time Team tonight, we're in Stratford on Avon, where we've uncovered loads of monkey skeletons and some typewriters.""
 * Mock the Week - Unlikely Things to hear on a History Documentary

Music

 * The band Chumbawumba were supposedly named after a word typed by a monkey when somebody actually tried to do this in real life.

Newspaper Comics

 * Referenced in a FoxTrot strip where Peter gets a program to assemble random letters, his logic being that if you put enough monkeys on typewriters to produce Hamlet, then you can surely use a random letter generator to create a Hamlet book report. Paige then asks about one page which is even more nonsensical that turns out to have been Peter's attempt.
 * In Dilbert:
 * The title character writes a poem, and Dogbert says something along the lines of "You know, an infinite number of monkeys in an infinite amount of time could type out the complete works of Shakespeare. Your poem? Three monkeys, ten minutes."
 * Another joke was "if you take an infinite number of monkeys on typewriters and give them an infinite amount of time, sooner or later you'll have a room full of dead monkeys. Turns out monkeys need feeding."

Radio

 * The Ricky Gervais Show has a segment in which Karl refuses to believe that the monkeys can ever actually write anything, so stubbornly that Ricky ends up storming out on him.

Theater

 * The entire plot of the one-act play "Words, Words, Words", belonging to the collection All in The Timing, by David Ives, although for practical reasons it only uses three.

Web Comics

 * The "Infinite Monkeys" arc of Goats.
 * User Friendly: "These Terrans are sharp."
 * Schlock Mercenary, in the Big Haunted Battleship Arc, eventually leads to Kevin claiming to cite this trope, but with the "Great works of Howard Tayler." The narrator claims this can actually be done with 3 monkeys in 15 minutes.

Western Animation
"This is a thousand monkeys working at a thousand typewriters. Soon they will have written the greatest novel known to man. (takes paper) Let's see..." It was the best of times, it was the blurst of times!?!" You stupid monkey!"
 * In The Simpsons, C. Montgomery Burns has a bunch of monkeys at typewriters.

"Krusty: Now, every year we find one good Samaritan so deserving that not recognizing him would make Santa Claus himself vomit with rage... mmm... who writes this stuff?
 * Also from the episode, "Children of a Lesser Clod."

(Cut to Mr. Teeny on a typewriter.)

Mr. Teeny: (subtitles) I think it's remarkable I wrote anything."


 * The Histeria! episode "Super Writers" has a short sketch about this.
 * The I Am Weasel episode "A Troo Storee" has a scene where several monkeys with typewriters are trying to write a novel. Weasel manages to insult them by offering to pay them in bananas.
 * In the Family Guy episode "The King is Dead", Peter uses a monkeys-on-typewriters reference to belittle the importance of art. This is followed by a scene in which several monkeys argue over which flower would best fit in the "rose by any other name" line from Romeo and Juliet.
 * In Phineas and Ferb, "Cliptastic Countdown" combines this with Who Writes This Crap?. Major Monogram demands who wrote the lines, to which Carl the intern replies, "Agent M, sir." We then see a monkey in a fedora at a typewriter, causing Dr. Doofenshmirtz to complain how none of the kids watching will know what a typewriter is. Monogram tries to excuse it by say it was cheaper that way, but Doof just continues ranting on the point that they would have to find a typewriter from an antiques dealer.

Real Life

 * This was actually tried in the Paignton Zoo in Devon in 2002, where six macaques were given free access to a (protected) computer. Their initial reaction was to pee on it or bash it with a rock; but in time they did start to get the hang of typing. After several months the results were several pages of gibberish, but the letter S as in Shakespeare was more prominent than others.