Infinite monkey theorem
The infinite monkey theorem is a popular misnomer for an idea from Emile Borel's book on probability, published in 1909. The book introduced the concept of "dactylographic1 monkeys" seated in front of typewriter keyboards and hitting keys at random. Borel exemplified a proposition in the theory of probability called Kolmogorov's zero-one law by saying that the probability is 1 that such a monkey will eventually type every book in France's National Library. There need not be infinitely many monkeys; a single monkey who executes infinitely many keystrokes suffices. Strictly speaking, what Borel was illustrating was only a special case of Kolmogorov's zero-one law, the more general statement of which had not yet been given (Kolmogorov's famous monograph on probability theory was not published until 1933).
Subsequent restatements by other people have replaced the National Library not only with the British Museum but also with the Library of Congress; a popular retelling says that the monkeys would eventually type Shakespeare's plays.
The literary notion may have its origin in Jonathan Swift's Gulliver's Travels (1782), part three, chapter five, in which a professor of the Grand Academy of Lagado is attempting to create a complete list of all knowledge of science by having his students constantly create random strings of letters by turning cranks on a mechanism.
Probabilities
Ignoring punctuation, spacing, and capitalization, and assuming an uniform distribution of letters, a monkey has one chance in 26 of correctly typing the first letter of Hamlet. He has one chance in 676 (26 times 26) of typing the first two letters. Because the probability grows exponentially smaller, at 20 letters he already has only one chance in 19928148895209409152340197376, roughly equivalent to the probability of buying 4 lottery tickets consecutively and winning each time. In the case of the entire text of Hamlet, the probabilities are so vanishingly small they can barely be conceived in human terms.
The mere fact that there is a chance, however unlikely, is the key to the "Infinite monkey theorem", because Kolmogorov's zero-one law says that such an infinite series of independent events must have a probability of zero or one. Since we have shown above that the chance is not zero, it must be one. To consider that an event this unlikely is guaranteed to occur given infinite time can give a sense of the vastness of infinity.
Gian-Carlo Rota wrote in a textbook on probability (unfinished when he died):
- "If the monkey could type one keystroke every nanosecond, the expected waiting time until the monkey types out Hamlet is so long that the estimated age of the universe is insignificant by comparison ... this is not a practical method for writing plays. (We cannot resist the temptation to quote from A.N. Whitehead, 'I will not go to infinity'.)"
In The Nature of the Physical World: The Gifford Lectures (Macmillan, New York, 1929, page 72) the physicist Arthur Eddington wrote:
- "If I let my fingers wander idly over the keys of a typewriter it might happen that my screed made an intelligible sentence. If an army of monkeys were strumming on typewriters they might write all the books in the British Museum. The chance of their doing so is decidedly more favourable than the chance of the molecules returning to one half of the vessel."
Myth about origins
It is often reported, though highly improbable, that Emile Borel's use of monkeys and typewriters in his theorem was inspired by an argument used by Thomas Huxley on June 30, 1860. Huxley was involved in a debate with the Anglican Bishop of Oxford, Samuel Wilberforce, held at a meeting of the British Association for the Advancement of Science at Oxford, of which Wilberforce was a vice-president, and was sparked by the publication of Charles Darwin’s Origin of Species seven months earlier, in November 1859. No transcript of the debate exists, but neither contemporary accounts of it nor Huxley's later recollections include any reference to the infinite monkey theorem. The association of the debate with the infinite monkey theorem is probably an urban myth triggered by the fact that the debate certainly did include some byplay about apes: the bishop asked whether Huxley was descended from an ape on his grandmother's or his grandfather's side, and Huxley responded, in effect, that he would rather be descended from an ape than the bishop. It is most unlikely that Huxley would have referred to a typewriter. Although patents for machines resembling modern typewriters were granted as early as 1714, commercial production of typewriters did not begin until 1870, and a skilled debater like Huxley would hardly have let his point depend on a device whose existence would have been unknown to most of his audience.
Literature and popular culture
In "Inflexible Logic" by Russell Maloney, a short story that appeared in the New Yorker in 1940, the protagonist felt that his wealth put him under an obligation to support the sciences, and so he tested that theory. (He had heard the British Museum version of the story.) His monkeys immediately set to work typing classics of fiction and nonfiction. The rich man was amused to see unexpurgated versions of Samuel Pepys' diaries, of which he owned only a copy of a bowdlerized edition.
A similar theme was struck in the story "The Library of Babel" by Jorge Luis Borges, which contains billions of volumes filled with random strings of characters.
Popular culture references to this theorem include The Simpsons (in one episode, Montgomery Burns has his own room with 1000 dactylographic monkeys, one of which is chastised for mistyping a word in the opening sentence of A Tale of Two Cities), Family Guy (A group of monkeys is shown collaborating on a line from Shakespeare's Romeo and Juliet in a cut scene) and The Hitchhiker's Guide to the Galaxy (Ford Prefect and Arthur Dent, under the influence of a device that makes highly improbable events occur, are ambushed by an infinite number of monkeys who want their opinion on the monkeys' script for Hamlet). The theorem is also the basis of a one-act play by playwright David Ives called "Words, Words, Words", which appears in his collection All in the Timing. There is an amusing short story by R.A. Lafferty entitled "Been a Long, Long Time", in which an angel is punished by having to proofread all the output text until some future time (after trillions of Universes have been created and died) when the monkeys produce a perfect copy of Shakespeare's works.
In 2000, a paper was submitted to the IETF Internet standards committee as an April Fool's joke proposing an "Infinite Monkey Protocol Suite (IMPS)", a method of directing a farm of infinite monkeys over the Internet.
Attempts at simulation
"The Monkey Shakespeare Simulator" web site, launched on July 1, 2003, contains a Java applet that simulates a large population of monkeys typing randomly, with the stated intention of seeing how long it takes the virtual monkeys to produce a complete Shakespearean play from beginning to end. As of 31 August 2004, matches as long as 20 consecutive letters, 2 words (or 19 letters, three words) have been recorded ("Coriolanus" "1. Citizen. Before wZgJ ...") (Due to processing power limitations, the program uses a probabilistic model instead of actually generating random text and comparing it to Shakespeare. Only matches with the opening of each play are reported.)
In 2003, scientists at Paignton Zoo and the University of Plymouth, in Devon, England, reported that they had left a computer keyboard in the enclosure of six Sulawesi Crested Macaques for a month; not only did the monkeys produce nothing but five pages consisting largely of the letter S, they started by attacking the keyboard with a stone, and continued by urinating and defecating on it.
Usage note
To some lay persons, "infinite monkeys" and "infinitely many monkeys" may be synonymous; to mathematicians, the former is incorrect because each monkey individually is finite.
References
- No words to describe monkeys' play] (9 May 2003) BBC News
- Monkey Theory Proven Wrong (9 May 2003) CBS News
- RFC 2795 - The Infinite Monkey Protocol Suite (IMPS)
External links
- Monkey Shakespeare Simulator
- Real Life Parody of the Keyboard/Monkey Concept
- Monkeys Don't Write Shakespeare
Footnote
1 The word dactylographic appears in the English translation of Borel's book, and seems to be an Anglicization of a French word for typewriting, but in English, dactylography means the study of fingerprints.