# Infinite monkey theorem

Given enough time, a chimpanzee punching at random on a typewriter would almost surely type out all of Shakespeare's plays.
Photo: Chimpanzee Typing (1907) - New York Zoological Society
 Related e Google Wikipedia Wiktionary Wiki Commons Wikiquote Wikisource YouTube Shop Featured: Train wreck at Montparnasse (October 22, 1895) by Studio Lévy and Sons.

The infinite monkey theorem is a theorem states that a monkey hitting keys at random on a typewriter keyboard for an infinite amount of time will almost surely type a given text, such as the complete works of William Shakespeare.

In this context, "almost surely" is a mathematical term with a precise meaning, and the "monkey" is not an actual monkey, but a metaphor for an abstract device that produces a random sequence of letters ad infinitum. The theorem illustrates the perils of reasoning about infinity by imagining a vast but finite number, and vice versa. The probability of a monkey exactly typing a complete work such as Shakespeare's Hamlet is so tiny that the chance of it occurring during a period of time of the order of the age of the universe is minuscule, but not zero.

Variants of the theorem include multiple and even infinitely many typists, and the target text varies between an entire library and a single sentence. The history of these statements can be traced back to Aristotle's On Generation and Corruption and Cicero's De natura deorum, through Blaise Pascal and Jonathan Swift, and finally to modern statements with their iconic typewriters. In the early 20th century, Émile Borel and Arthur Eddington used the theorem to illustrate the timescales implicit in the foundations of statistical mechanics. Various Christian apologists on the one hand, and Richard Dawkins on the other, have argued about the appropriateness of the monkeys as a metaphor for evolution.

Popular interest in the typing monkeys is sustained by numerous appearances in literature, television, radio, music, and the Internet. In 2003, an experiment was performed with six Celebes Crested Macaques, but their literary contribution was five pages consisting largely of the letter 'S'.