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 text 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 dsafljcxzillion ancjlaeladhaclaketlillion 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 accidentally 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.
- The Mickey Mouse comic "Monkey in the Middle" begins with this: a statistician, for whatever reason, is trying to disprove the claim that a million monkeys could produce Shakespeare in a million years, so he buys a ten or so monkeys to have them pound on typewriters for a few months (not that it makes any sense.) Almost immediately, one of the monkeys actually does type out a legible Shakespearean drama. Later it turns out they were actually super-intelligent monkeys that escaped from a lab.
- In Grant Morrison's run on Animal Man, the title character meets a literal type-writing monkey in the metafictional realm of Limbo. Morrison would revisit Limbo in Final Crisis; the monkey appears to have vacated, but we get to see his life's work: an infinitely-long book containing every possible story in The Multiverse. Later in the same storyline, a mysterious monkeylike character, whose identity is never revealed, helps Monitor Nix Uotan regain his powers.
- One MAD article has a similar premise, saying that with an infinite number of people doing things under certain circumstances will produce one improbable result. For example, it suggests that with an infinite number of studies and Congressional hearings, the tobacco industry might admit that cigarettes aren't as good for babies as their mother's milk.
- The monkeys in the May 7th, 2010 Bizarro strip end up producing The Great Gatsby rather than a work of Shakespeare, much to their supervisor's frustration.
- 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."
- 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 Shadowchasers: Ascension, Jeb uses this as part of an analogy in his book to explain populations of Hell. (This reality has a Hell Is War afterlife, where one side has an overwhelming advantage in numbers, but a Chaotic Stupid attitude that keeps them from prevailing):
Well, assuming the demons are truly infinite in number (which I doubt) heres one way of looking at it. You may have heard the old parable that if you let an infinite number of monkeys type at an infinite number of typewriters, one of them would eventually write Hamlet.
Well, I suppose that's true. But theyd also type billions upon billions of pages of gibberish, and if by some chance a complete work came out, it would have as much chance of being a Shakespearean play as it would of being the screenplay for Howard the Duck or some equally terrible movie.
- R. A. Lafferty once wrote a story, "Been a Long, Long Time", 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...
- Brought up in Dinoverse when characters start wondering how Bertram accidentally made a time machine - he brings up this trope and says he must have stumbled on the right combination by pure chance.
- 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".
- 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."
- 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.
- The Kane Chronicles: The Red Pyramid does it using ibises instead of monkeys.
- Borges' short story "The Library of Babel" doesn't directly reference monkeys or typewriters, but does examine the underlying idea of meaningful language emerging from chaos. The story is set in a finite-but-still-unmeasurably-vast library, stocked with 410-page books containing every possible arrangement of letters, spaces, and punctuation that will fit. All the information in the world is in that Library, as is every pieces of literature ever published (albeit divided into 410 page excerpts)—but they're scattered amongst books of complete gibberish, or books full of lies that look real.
- Sort of inverted in The Neverending Story, where Bastian gets to see several mindless humans setting up heavy stones with letters on them repeatedly, as an entertainment for an intelligent monkey.
- 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."
- 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.
- 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.
- Doctor Who: In "Mawdryn Undead", the Doctor and Tegan discuss this trope as it applies to "a treeful of monkeys".
The Doctor: You and I both know, at the end of a millennium they'd still be tapping out gibberish.
Tegan: And you'd be right there tapping it out with them.
- Mock the Week - Unlikely Things to hear on a History Documentary
"On Time Team tonight, we're in Stratford on Avon, where we've uncovered loads of monkey skeletons and some typewriters."
- 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.
Kermit: I'll never know what they see in that thing.
- 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:
"Somewhere, those million chimps, with their million typewriters, must've written King Lear."
- Whose Line Is It Anyway?: Colin started off a game of Weird Newscasters this way:
Colin: Our top story, an infinite number of monkeys came up with the Fox fall line-up.
- The band Chumbawumba was supposedly named after a word typed by a monkey when somebody actually tried to do this in real life. (This was cited on Nevermind The Buzzcocks, but it later turned out it was only one of several false explanations the band would say in interviews to troll the interviewers).
- British band The Mekons released an album The Quality of Mercy is not Strnen. The cover shows one monkey sitting by one typewriter.
- Referenced in the They Might Be Giants song "We Live In a Dump", which opens with the line "Hanging out while the monkeys type away."
- 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.
- The Infinite Monkey Cage is named after this. If you have an infinite numbers of monkeys on an infinite number of typewriters in the hope that they'll eventually give you Shakespeare's works, you do need to keep them in a cage big enough for all of the monkeys: an infinite monkey cage. The metaphor is occasionally analysed on the show itself:
- One listener once wrote in to ask what the ACTUAL dimensions of the hypothetical cage were, since it'd still be an infinitely sized cage if two dimensions were fixed but smaller than a monkey and the final dimension infinitely big.
- The full lyrics to Eric Idle's theme tune also wonders about it:
If infinite monkeys typed every day,
They may accidentally write Hamlet the play,
But they'd probably just shit on it and throw it away,
In the infinite monkey cage!
- In The Hitch Hikers Guide To The Galaxy, the Infinite Improbability Drive throws Arthur Dent and Ford Prefect into a highly improbable but not impossible situation:
Ford? There are an infinite number of monkeys out here who want to talk to us about this script for Hamlet that they've just worked out.
- The one-act play "Words, Words, Words", belonging to the collection All in The Timing, by David Ives, is set in a laboratory where somebody is actually trying out the thought experiment. The only characters who appear on-stage are three of the monkeys, who are naturally rather bemused about the whole business.
- Twitch Plays Pokémon is described in its page quote on This Very Wiki as tens of thousands of monkeys fighting over one typewriter, half of them desperately trying to progress in the game and the other half throwing shit everywhere. They beat Pokemon Red in only sixteen days.
- Team Four Star explicitly described their Let's Play of Bloodborne like this. On top of the fact that they made it a Drinking Game, they tended to make decisions based more off of Rule of Funny than actual game logic (like spending most of the game with their character wearing nothing but a top hat and women's shoes) and just had fun with it. That said, they still beat the game (with DLC but not the Chalice Dungeons) in about 65 hoursnote , got the Golden Endingnote , pulled off a few feats that legitimately impressed their Bloodborne-loving friend Grant, and, again, did most of it while absolutely stinking drunk.
- An Encyclopedia Obscura article teaser references this when talking about Bastard Dark God Of Destruction.
"Give a million monkeys a million typewriters and infinite time, and you'll get the complete Shakespeare. Serve them piña coladas, and you get Bastard!!"
- Netflix had an April Fool's gag called Netflix Live, with Will Arnett narrating various boring scenes around the office. At one point, while watching somebody play a computer game:
"I bet if you did a reverse on the camera, you'd see there's a monkey at the keyboard, just pounding away random stuff. (Beat) Is there a chance that Netflix is run by monkeys just doing random stuff and somehow, because the universe so vast that somehow, you know, we just live in this part where they happen to be getting it right for all this time? If the universe is infinite, think about that, that's a possibility."
- There's a post on tumblr circulating that theorizes that, since the number π is an irrational number and thus has no end, somewhere in π's random and endless stream of decimals is a string of numbers that can be translated into the source code for a video game or movie.
- The Simpsons:
- In "Last Exit to Springfield", C. Montgomery Burns has a bunch of monkeys at typewriters.
Burns: 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! (crumbles the paper and throws it at the monkey, causing him to screech frantically) Oh shut up!
- Also from the episode "Children of a Lesser Clod."
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?
(Cut to Mr. Teeny on a typewriter.)
Mr. Teeny: (subtitles) I think it's remarkable I wrote anything.
- In "Last Exit to Springfield", C. Montgomery Burns has a bunch of monkeys at typewriters.
- 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, and only I.R. Baboon is left to finish the book.
- 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.
- 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.
- A popular Play-by-Post Game is to try randomly mashing on the keyboard and see if you get a pronounceable result, or else try to type a specific word with a specific external organ, such as your nose, chin, or elbow. Go on, try it. We won't tell anyone.
- A virtual monkey cage has been created by a programmer called Jesse Anderson. It's not strictly random, however, since the "monkeys" keep track of whether a given section is part of Shakespeare's works, and put the relevant ones together, thereby dramatically reducing the amount of time required.