Theinfinite monkey theoremstates that amonkeyhitting keys atrandomon atypewriterkeyboard for aninfiniteamount of time willalmost surelytype any given text, including the complete works ofWilliam Shakespeare.[a]In fact, the monkey would almost surely type every possible finite text an infinite number of times. The theorem can be generalized to state that any sequence of events that has a non-zeroprobabilityof happening will almost certainly occur an infinite number of times, given an infinite amount oftimeor auniversethat isinfinite in size.

While a monkey is used as a mechanism for the thought experiment, it would be unlikely to ever writeHamlet,according to researchers.

In this context, "almost surely" is a mathematical term meaning the event happens with probability 1, and the "monkey" is not an actual monkey, but ametaphorfor anabstractdevice that produces an endlessrandom sequenceof letters and symbols. Variants of the theorem include multiple and even infinitely many typists, and the target text varies between an entire library and a single sentence.

One of the earliest instances of the use of the "monkey metaphor" is that of French mathematicianÉmile Borelin 1913,[1]but the first instance may have been even earlier.Jorge Luis Borgestraced the history of this idea fromAristotle'sOn Generation and CorruptionandCicero'sDe Natura Deorum(On the Nature of the Gods), throughBlaise PascalandJonathan Swift,up to modern statements with their iconic simians and typewriters.[2]In the early 20th century, Borel andArthur Eddingtonused the theorem to illustrate the timescales implicit in the foundations ofstatistical mechanics.

Solution

Direct proof

There is a straightforward proof of this theorem. As an introduction, recall that if two events arestatistically independent,then the probability of both happening equals the product of the probabilities of each one happening independently. For example, if the chance of rain inMoscowon a particular day in the future is 0.4 and the chance of anearthquakeinSan Franciscoon any particular day is 0.00003, then the chance of both happening on the same day is0.4 × 0.00003 = 0.000012,assumingthat they are indeed independent.

Consider the probability of typing the wordbananaon a typewriter with 50 keys. Suppose that the keys are pressed independently and uniformly at random, meaning that each key has an equal chance of being pressed regardless of what keys had been pressed previously. The chance that the first letter typed is 'b' is 1/50, and the chance that the second letter typed is 'a' is also 1/50, and so on. Therefore, the probability of the first six letters spellingbananais:

(1/50) × (1/50) × (1/50) × (1/50) × (1/50) × (1/50) = (1/50)6= 1/15,625,000,000.

The result is less than one in 15 billion, butnotzero.

From the above, the chance ofnottypingbananain a given block of 6 letters is 1 − (1/50)6.Because each block is typed independently, the chanceXnof not typingbananain any of the firstnblocks of 6 letters is:

Asngrows,Xngets smaller. Forn= 1 million,Xnis roughly 0.9999, but forn= 10 billionXnis roughly 0.53 and forn= 100 billion it is roughly 0.0017. Asnapproaches infinity, the probabilityXnapproacheszero; that is, by makingnlarge enough,Xncan be made as small as is desired,[3]and the chance of typingbananaapproaches 100%.[b]Thus, the probability of the wordbananaappearing at some point in an infinite sequence of keystrokes is equal to one.

The same argument applies if we replace one monkey typingnconsecutive blocks of text withnmonkeys each typing one block (simultaneously and independently). In this case,Xn= (1 − (1/50)6)nis the probability that none of the firstnmonkeys typesbananacorrectly on their first try. Therefore, at least one of infinitely many monkeys will (with probability equal to one) produce a text using the same number of keystrokes as a perfectly accurate human typist copying it from the original.

Infinite strings

This can be stated more generally and compactly in terms ofstrings,which are sequences of characters chosen from some finitealphabet:

  • Given an infinite string where each character is chosenuniformly at random,any given finite string almost surely occurs as asubstringat some position.
  • Given an infinite sequence of infinite strings, where each character of each string is chosen uniformly at random, any given finite string almost surely occurs as a prefix of one of these strings.

Both follow easily from the secondBorel–Cantelli lemma.For the second theorem, letEkbe theeventthat thekth string begins with the given text. Because this has some fixed nonzero probabilitypof occurring, theEkare independent, and the below sum diverges,

the probability that infinitely many of theEkoccur is 1. The first theorem is shown similarly; one can divide the random string into nonoverlapping blocks matching the size of the desired text and makeEkthe event where thekth block equals the desired string.[c]

Probabilities

However, for physically meaningful numbers of monkeys typing for physically meaningful lengths of time the results are reversed. If there were as many monkeys as there are atoms in the observable universe typing extremely fast for trillions of times the life of the universe, the probability of the monkeys replicating even asingle pageof Shakespeare is unfathomably small.

Ignoring punctuation, spacing, and capitalization, a monkey typing letters uniformly at random has a chance of one in 26 of correctly typing the first letter ofHamlet.It has a chance of one in 676 (26 × 26) of typing the first two letters. Because the probability shrinksexponentially,at 20 letters it already has only a chance of one in 2620= 19,928,148,895,209,409,152,340,197,376[d](almost 2 × 1028). In the case of the entire text ofHamlet,the probabilities are so vanishingly small as to be inconceivable. The text ofHamletcontains approximately 130,000 letters.[e]Thus, there is a probability of one in 3.4 × 10183,946to get the text right at the first trial. The average number of letters that needs to be typed until the text appears is also 3.4 × 10183,946,[f]or including punctuation, 4.4 × 10360,783.[g]

Even if every proton in the observable universe (which isestimatedat roughly 1080) were a monkey with a typewriter, typing from theBig Banguntil theend of the universe(when protonsmight no longer exist), they would still need a far greater amount of time – more than three hundred and sixty thousandorders of magnitudelonger – to have even a 1 in 10500chance of success. To put it another way, for a one in a trillion chance of success, there would need to be 10360,641observable universes made of protonic monkeys.[h]AsKittelandKroemerput it in their textbook onthermodynamics,the field whose statistical foundations motivated the first known expositions of typing monkeys,[5]"The probability ofHamletis therefore zero in any operational sense of an event... ", and the statement that the monkeys must eventually succeed" gives a misleading conclusion about very, very large numbers. "

In fact, there is less than a one in a trillion chance of success that such a universe made of monkeys could type any particular document a mere 79 characters long.[i]

An online demonstration showed that short random programs can produce highly structured outputs more often than classical probability suggests, aligning withGregory Chaitin's modern theorem and building onAlgorithmic Information TheoryandAlgorithmic probabilitybyRay SolomonoffandLeonid Levin.[6]The demonstration illustrates that the chance of producing a specific binary sequence is not shorter than the base-2 logarithm of the sequence length, showing the difference betweenAlgorithmic probabilityandclassical probability,as well as between random programs and random letters or digits.

Almost surely

The probability that an infinite randomly generated string of text will contain a particular finite substring is 1. However, this does not mean the substring's absence is "impossible", despite the absence having a prior probability of 0. For example, the immortal monkeycouldrandomly type G as its first letter, G as its second, and G as every single letter, thereafter, producing an infinite string of Gs; at no point must the monkey be "compelled" to type anything else. (To assume otherwise implies thegambler's fallacy.) However long a randomly generated finite string is, there is a small but nonzero chance that it will turn out to consist of the same character repeated throughout; this chance approaches zero as the string's length approaches infinity. There is nothing special about such a monotonous sequence except that it is easy to describe; the same fact applies to any nameable specific sequence, such as "RGRGRG" repeated forever, or "a-b-aa-bb-aaa-bbb-...", or "Three, Six, Nine, Twelve…".

If the hypothetical monkey has a typewriter with 90 equally likely keys that include numerals and punctuation, then the first typed keys might be "3.14" (the first threedigits of pi) with a probability of (1/90)4,which is 1/65,610,000. Equally probable is any other string of four characters allowed by the typewriter, such as "GGGG", "mATh", or "q%8e". The probability that 100 randomly typed keys will consist of the first 99 digits of pi (including the separator key), or any otherparticularsequence of that length, is much lower: (1/90)100.If the monkey's allotted length of text is infinite, the chance of typing only the digit of pi is 0, which is just aspossible(mathematically probable) as typing nothing but Gs (also probability 0).

The same applies to the event of typing a particular version ofHamletfollowed by endless copies of itself; orHamletimmediately followed by all the digits of pi; these specific strings areequally infinitein length, they are not prohibited by the terms of the thought problem, and they each have a prior probability of 0. In fact,anyparticular infinite sequence the immortal monkey types will havehada prior probability of 0, even though the monkey must type something.

This is an extension of the principle that a finite string of random text has a lower and lower probability ofbeinga particular string the longer it is (though all specific strings are equally unlikely). This probability approaches 0 as the string approaches infinity. Thus, the probability of the monkey typing an endlessly long string, such as all of the digits of pi in order, on a 90-key keyboard is (1/90)which equals (1/∞) which is essentially 0. At the same time, the probability that the sequencecontainsa particular subsequence (such as the word MONKEY, or the 12th through 999th digits of pi, or a version of the King James Bible) increases as the total string increases. This probability approaches 1 as the total string approaches infinity, and thus the original theorem is correct.

Correspondence between strings and numbers

In a simplification of the thought experiment, the monkey could have a typewriter with just two keys: 1 and 0. The infinitely long string thusly produced would correspond to thebinarydigits of a particularreal numberbetween 0 and 1. A countably infinite set of possible strings end in infinite repetitions, which means the corresponding real number isrational.Examples include the strings corresponding to one-third (010101...), five-sixths (11010101...) and five-eighths (1010000...). Only a subset of such real number strings (albeit a countably infinite subset) contains the entirety ofHamlet(assuming that the text is subjected to a numerical encoding, such asASCII).

Meanwhile, there is anuncountablyinfinite set of strings which do not end in such repetition; these correspond to theirrational numbers.These can be sorted into two uncountably infinite subsets: those which containHamletand those which do not. However, the "largest" subset of all the real numbers is those which not only containHamlet,but which contain every other possible string of any length, and with equal distribution of such strings. These irrational numbers are callednormal.Because almost all numbers are normal, almost all possible strings contain all possible finite substrings. Hence, the probability of the monkey typing a normal number is 1. The same principles apply regardless of the number of keys from which the monkey can choose; a 90-key keyboard can be seen as a generator of numbers written in base 90.

History

Statistical mechanics

In one of the forms in which probabilists now know this theorem, with its "dactylographic" [i.e., typewriting] monkeys (French:singes dactylographes;the French wordsingecovers both the monkeys and the apes), appeared inÉmile Borel's 1913 article "Mécanique Statique et Irréversibilité"(Static mechanics and irreversibility),[1]and in his book "Le Hasard" in 1914.[7]His "monkeys" are not actual monkeys; rather, they are a metaphor for an imaginary way to produce a large, random sequence of letters. Borel said that if a million monkeys typed ten hours a day, it was extremely unlikely that their output would exactly equal all the books of the richest libraries of the world; and yet, in comparison, it was even more unlikely that the laws of statistical mechanics would ever be violated, even briefly.

The physicistArthur Eddingtondrew on Borel's image further inThe Nature of the Physical World(1928), writing:

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.[8][9]

These images invite the reader to consider the incredible improbability of a large but finite number of monkeys working for a large but finite amount of time producing a significant work and compare this with the even greater improbability of certain physical events. Any physical process that is even less likely than such monkeys' success is effectively impossible, and it may safely be said that such a process will never happen.[5]It is clear from the context that Eddington is not suggesting that the probability of this happening is worthy of serious consideration. On the contrary, it was a rhetorical illustration of the fact that below certain levels of probability, the termimprobableis functionally equivalent toimpossible.

Origins and "The Total Library"

In a 1939 essay entitled "The Total Library", Argentine writerJorge Luis Borgestraced the infinite-monkey concept back toAristotle'sMetaphysics.Explaining the views ofLeucippus,who held that the world arose through the random combination of atoms, Aristotle notes that the atoms themselves are homogeneous and their possible arrangements only differ in shape, position and ordering. InOn Generation and Corruption,the Greek philosopher compares this to the way that a tragedy and a comedy consist of the same "atoms",i.e.,alphabetic characters.[10]Three centuries later,Cicero'sDe natura deorum(On the Nature of the Gods) argued against theEpicurean atomistworldview:

Is it possible for any man to behold these things, and yet imagine that certain solid and individual bodies move by their natural force and gravitation, and that a world so beautifully adorned was made by their fortuitous concourse? He who believes this may as well believe that if a great quantity of the one-and-twenty letters, composed either of gold or any other matter, were thrown upon the ground, they would fall into such order as legibly to form theAnnalsof Ennius.I doubt whether fortune could make a single verse of them.[11]

Borges follows the history of this argument throughBlaise PascalandJonathan Swift,[12]then observes that in his own time, the vocabulary had changed. By 1939, the idiom was "that a half-dozen monkeys provided with typewriters would, in a few eternities, produce all the books in the British Museum." (To which Borges adds, "Strictly speaking, one immortal monkey would suffice." ) Borges then imagines the contents of the Total Library which this enterprise would produce if carried to its fullest extreme:

Everything would be in its blind volumes. Everything: the detailed history of the future,Aeschylus'The Egyptians,the exact number of times that the waters ofthe Gangeshave reflected the flight of a falcon,the secret and true name of Rome,the encyclopediaNovaliswould have constructed, my dreams and half-dreams at dawn on August 14, 1934, the proof ofPierre Fermat'stheorem,the unwritten chapters ofEdwin Drood,those same chapters translated into the language spoken by theGaramantes,the paradoxesBerkeleyinvented concerning Time but didn't publish,Urizen's books of iron, the premature epiphanies ofStephen Dedalus,which would be meaningless before a cycle of a thousand years, the GnosticGospel of Basilides,the songthe sirenssang, the complete catalog of the Library, the proof of the inaccuracy of that catalog. Everything: but for every sensible line or accurate fact there would be millions of meaningless cacophonies, verbal farragoes, and babblings. Everything: but all the generations of mankind could pass before the dizzying shelves – shelves that obliterate the day and on which chaos lies – ever reward them with a tolerable page.[13]

Borges' total library concept was the main theme of his widely read 1941 short story "The Library of Babel",which describes an unimaginably vast library consisting of interlocking hexagonal chambers, together containing every possible volume that could be composed from the letters of the alphabet and some punctuation characters.

Actual monkeys

In 2002,[14]lecturers and students from theUniversity of PlymouthMediaLab Arts course used a £2,000 grant from theArts Councilto study the literary output of real monkeys. They left a computer keyboard in the enclosure of sixCelebes crested macaquesinPaignton Zooin Devon, England from May 1 to June 22, with a radio link to broadcast the results on a website.[15]

Not only did the monkeys produce nothing but five total pages[16]largely consisting of the letter "S",[14]the lead male began striking the keyboard with a stone, and other monkeys followed by urinating and defecating on the machine.[17]Mike Phillips, director of the university's Institute of Digital Arts and Technology (i-DAT), said that the artist-funded project was primarilyperformance art,and they had learned "an awful lot" from it. He concluded that monkeys "are not random generators. They're more complex than that.... They were quite interested in the screen, and they saw that when they typed a letter, something happened. There was a level of intention there."[15][18]

Applications and criticisms

Evolution

Thomas Huxleyis sometimes misattributed with proposing a variant of the theory in his debates withSamuel Wilberforce.

In his 1931 bookThe Mysterious Universe,Eddington's rivalJames Jeansattributed the monkey parable to a "Huxley", presumably meaningThomas Henry Huxley.This attribution is incorrect.[19]Today, it is sometimes further reported that Huxley applied the example in anow-legendary debateoverCharles Darwin'sOn the Origin of Specieswith the Anglican Bishop of Oxford, Samuel Wilberforce, held at a meeting of theBritish Association for the Advancement of Scienceat Oxford on 30 June 1860. This story suffers not only from a lack of evidence, but the fact that in 1860 the typewriter wasnot yet commercially available.[20]

Despite the original mix-up, monkey-and-typewriter arguments are now common in arguments over evolution. As an example ofChristian apologeticsDoug Powell argued that even if a monkey accidentally types the letters ofHamlet,it has failed to produceHamletbecause it lacked the intention to communicate. His parallel implication is that natural laws could not produce the information content inDNA.[21]A more common argument is represented by ReverendJohn F. MacArthur,who claimed that the genetic mutations necessary to produce a tapeworm from an amoeba are as unlikely as a monkey typing Hamlet's soliloquy, and hence the odds against the evolution of all life are impossible to overcome.[22]

Evolutionary biologistRichard Dawkinsemploys the typing monkey concept in his bookThe Blind Watchmakerto demonstrate the ability ofnatural selectionto produce biologicalcomplexityout of randommutations.In a simulation experiment Dawkins has hisweasel programproduce the Hamlet phraseMETHINKS IT IS LIKE A WEASEL,starting from a randomly typed parent, by "breeding" subsequent generations and always choosing the closest match from progeny that are copies of the parent with random mutations. The chance of the target phrase appearing in a single step is extremely small, yet Dawkins showed that it could be produced rapidly (in about 40 generations) using cumulative selection of phrases. The random choices furnish raw material, while cumulative selection imparts information. As Dawkins acknowledges, however, the weasel program is an imperfect analogy for evolution, as "offspring" phrases were selected "according to the criterion of resemblance to adistant idealtarget. "In contrast, Dawkins affirms, evolution has no long-term plans and does not progress toward some distant goal (such as humans). The weasel program is instead meant to illustrate the difference betweennon-randomcumulative selection, andrandomsingle-step selection.[23]In terms of the typing monkey analogy, this means thatRomeo and Julietcould be produced relatively quickly if placed under the constraints of a nonrandom, Darwinian-type selection because thefitness functionwill tend to preserve in place any letters that happen to match the target text, improving each successive generation of typing monkeys.

A different avenue for exploring the analogy between evolution and an unconstrained monkey lies in the problem that the monkey types only one letter at a time, independently of the other letters. Hugh Petrie argues that a more sophisticated setup is required, in his case not for biological evolution but the evolution of ideas:

In order to get the proper analogy, we would have to equip the monkey with a more complex typewriter. It would have to include whole Elizabethan sentences and thoughts. It would have to include Elizabethan beliefs about human action patterns and the causes, Elizabethan morality and science, and linguistic patterns for expressing these. It would probably even have to include an account of the sorts of experiences which shaped Shakespeare's belief structure as a particular example of an Elizabethan. Then, perhaps, we might allow the monkey to play with such a typewriter and produce variants, but the impossibility of obtaining a Shakespearean play is no longer obvious. What is varied really does encapsulate a great deal of already-achieved knowledge.[24]

James W. Valentine,while admitting that the classic monkey's task is impossible, finds that there is a worthwhile analogy between written English and themetazoangenome in this other sense: both have "combinatorial, hierarchical structures" that greatly constrain the immense number of combinations at the alphabet level.[25]

Zipf's law

Zipf's lawstates that the frequency of words is a power law function of its frequency rank:whereare real numbers. Assuming that a monkey is typing randomly, with fixed and nonzero probability of hitting each letter key or white space, then the text produced by the monkey follows Zipf's law.[26]

Literary theory

R. G. Collingwoodargued in 1938 that art cannot be produced by accident, and wrote as a sarcastic aside to his critics,

... some... have denied this proposition, pointing out that if a monkey played with a typewriter... he would produce... the complete text of Shakespeare. Any reader who has nothing to do can amuse himself by calculating how long it would take for the probability to be worth betting on. But the interest of the suggestion lies in the revelation of the mental state of a person who can identify the 'works' of Shakespeare with the series of letters printed on the pages of a book...[27]

Nelson Goodmantook the contrary position, illustrating his point along with Catherine Elgin by the example of Borges' "Pierre Menard, Author of the Quixote",

What Menard wrote is simply another inscription of the text. Any of us can do the same, as can printing presses and photocopiers. Indeed, we are told, if infinitely many monkeys... one would eventually produce a replica of the text. That replica, we maintain, would be as much an instance of the work,Don Quixote,as Cervantes' manuscript, Menard's manuscript, and each copy of the book that ever has been or will be printed.[28]

In another writing, Goodman elaborates, "That the monkey may be supposed to have produced his copy randomly makes no difference. It is the same text, and it is open to all the same interpretations...."Gérard Genettedismisses Goodman's argument asbegging the question.[29]

ForJorge J. E. Gracia,the question of the identity of texts leads to a different question, that of author. If a monkey is capable of typingHamlet,despite having no intention of meaning and therefore disqualifying itself as an author, then it appears that texts do not require authors. Possible solutions include saying that whoever finds the text and identifies it asHamletis the author; or that Shakespeare is the author, the monkey his agent, and the finder merely a user of the text. These solutions have their own difficulties, in that the text appears to have a meaning separate from the other agents: What if the monkey operates before Shakespeare is born, or if Shakespeare is never born, or if no one ever finds the monkey's typescript?[30]

Simulated and limited conditions

In 1979,William R. Bennett Jr.,a profesor ofphysicsatYale University,brought fresh attention to the theorem by applying a series of computer programs. Dr. Bennett simulated varying conditions under which an imaginary monkey, given a keyboard consisting of twenty-eight characters, and typing ten keys per second, might attempt to reproduce the sentence, "To be or not to be, that is the question." Although his experiments agreed with the overall conclusion that even such a short string of words would require many times the current age of the universe to reproduce, he noted that by modifying the statistical probability of certain letters to match the ordinary patterns of various languages and of Shakespeare in particular, seemingly random strings of words could be made to appear. But even with several refinements, the English sentence closest to the target phrase remained gibberish: "TO DEA NOW NAT TO BE WILL AND THEM BE DOES DOESORNS CAI AWROUTROULD."[31]

Random document generation

The theorem concerns athought experimentwhich cannot be fully carried out in practice, since it is predicted to require prohibitive amounts of time and resources. Nonetheless, it has inspired efforts in finite random text generation.

One computer program run by Dan Oliver of Scottsdale, Arizona, according to an article inThe New Yorker,came up with a result on 4 August 2004: After the group had worked for 42,162,500,000 billion billion monkey-years, one of the "monkeys" typed, "VALENTINE. Cease toIdor:eFLP0FRjWK78aXzVOwm)-‘;8.t"The first 19 letters of this sequence can be found in" The Two Gentlemen of Verona ". Other teams have reproduced 18 characters from" Timon of Athens ", 17 from" Troilus and Cressida ", and 16 from" Richard II ".[32]

A website entitledThe Monkey Shakespeare Simulator,launched on 1 July 2003, contained aJava appletthat simulated 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. For example, it produced this partial line fromHenry IV, Part 2,reporting that it took "2,737,850 million billion billion billion monkey-years" to reach 24 matching characters:

RUMOUR. Open your ears; 9r "5j5&?OWTY Z0d

Due to processing power limitations, the program used a probabilistic model (by using arandom number generatoror RNG) instead of actually generating random text and comparing it to Shakespeare. When the simulator "detected a match" (that is, the RNG generated a certain value or a value within a certain range), the simulator simulated the match by generating matched text.[33]

Testing of random-number generators

Questions about the statistics describing how often an ideal monkey isexpectedto type certain strings translate intopractical tests for random-number generators;these range from the simple to the "quite sophisticated". Computer-science professorsGeorge MarsagliaandArif Zamanreport that they used to call one such category of tests "overlapping m-tupletests "in lectures, since they concern overlapping m-tuples of successive elements in a random sequence. But they found that calling them" monkey tests "helped to motivate the idea with students. They published a report on the class of tests and their results for various RNGs in 1993.[34]

The infinite monkey theorem and its associated imagery is considered a popular and proverbial illustration of the mathematics of probability, widely known to the general public because of its transmission through popular culture rather than through formal education.[j]This is helped by the innate humor stemming from the image of literal monkeys rattling away on a set of typewriters, and is a popular visual gag.

A quotation attributed[35][36]to a 1996 speech by Robert Wilensky stated, "We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true."

The enduring, widespread popularity of the theorem was noted in the introduction to a 2001 paper, "Monkeys, Typewriters and Networks: The Internet in the Light of the Theory of Accidental Excellence".[37]In 2002, an article inThe Washington Postsaid, "Plenty of people have had fun with the famous notion that an infinite number of monkeys with an infinite number of typewriters and an infinite amount of time could eventually write the works of Shakespeare".[38]In 2003, the previously mentionedArts Council−funded experiment involving real monkeys and a computer keyboard received widespread press coverage.[14]In 2007, the theorem was listed byWiredmagazine in a list of eight classicthought experiments.[39]

American playwrightDavid Ives' shortone-act playWords, Words, Words,from the collectionAll in the Timing,pokes fun of the concept of the infinite monkey theorem.

In 2015 Balanced Software released Monkey Typewriter on the Microsoft Store.[40]The software generates random text using the Infinite Monkey theorem string formula. The software queries the generated text for user inputted phrases. However the software should not be considered true to life representation of the theory. This is a more of a practical presentation of the theory rather than scientific model on how to randomly generate text.

See also

Notes

  1. ^In practice, for any realisticfiniteattempt, the probability of a monkey generating even a small part of a Shakespeare work is negligible.
  2. ^This shows that the probability of typing "banana" in one of the predefined non-overlapping blocks of six letters tends to 1. In addition the word may appear across two blocks, so the estimate given is conservative.
  3. ^The first theorem is proven by a similar if more indirect route in Gut (2005).[4]
  4. ^Nearly 20 octillion
  5. ^Using the Hamlet text"from gutenberg.org".,there are 132680 alphabetical letters and 199749 characters overall
  6. ^For any required string of 130,000 letters from the set 'a'-'z', the average number of letters that needs to be typed until the string appears is (rounded) 3.4 × 10183,946,except in the case that all letters of the required string are equal, in which case the value is about 4% more, 3.6 × 10183,946.In that case failure to have the correct string starting from a particular position reduces with about 4% the probability of a correct string starting from the next position (i.e., for overlapping positions the events of having the correct string are not independent; in this case there is a positive correlation between the two successes, so the chance of success after a failure is smaller than the chance of success in general). The figure 3.4 × 10183,946is derived fromn= 26130000by taking the logarithm of both sides: log10(n) = 1300000×log10(26) = 183946.5352, thereforen= 100.5352× 10183946= 3.429 × 10183946.
  7. ^26 letters ×2 for capitalisation, 12 for punctuation characters = 64, 199749×log10(64) = 4.4 × 10360,783(this is generous as it assumes capital letters are separate keys, as opposed to a key combination, which makes the problem vastly harder).
  8. ^There are ≈1080protons in the observable universe. Assume the monkeys write for 1038years (1020years is whenall stellar remnants will have either been ejected from their galaxies or fallen into black holes,1038years is when all but 0.1% ofprotons have decayed). Assuming the monkeys type non-stop at a ridiculous 400words per minute(the world record is 216WPMfor a single minute), that is about 2,000 characters per minute (Shakespeare's average word length is a bit under 5 letters). There are about half a million minutes in a year, this means each monkey types half a billion characters per year. This gives a total of 1080×1038×109= 10127letters typed – which is still zero in comparison to 10360,783.For a one in a trillion chance, multiply the letters typed by a trillion: 10127×1015= 10145.10360,783/10145= 10360,641.
  9. ^As explained at"More monkeys".Archived fromthe originalon 18 April 2015.Retrieved4 December2013.The problem can be approximated further: 10145/log10(64) = 78.9 characters.
  10. ^Examples of the theorem being referred to as proverbial include:Schooler, Jonathan W.; Dougal, Sonya (1999). "Why creativity is not like the proverbial typing monkey".Psychological Inquiry.10(4).;andKoestler, Arthur(1972).The Case of the Midwife Toad.New York. p. 30.Neo-Darwinism does indeed carry the nineteenth-century brand of materialism to its extreme limits – to the proverbial monkey at the typewriter, hitting by pure chance on the proper keys to produce a Shakespeare sonnet.{{cite book}}:CS1 maint: location missing publisher (link)The latter is sourced from"Parable of the Monkeys".,a collection of historical references to the theorem in various formats.

References

  1. ^abBorel, Émile (1913)."La mécanique statique et l'irréversibilité".Journal de Physique Théorique et Appliquée(in French).3(1):189–196.doi:10.1051/jphystap:019130030018900.ISSN0368-3893.Concevons qu'on ait dressé un million de singes à frapper au hasard sur les touches d'une machine à écrire et que […] ces singes dactylographes travaillent avec ardeur dix heures par jour avec un million de machines à écrire de types variés. […] Au bout d'un an, [leurs] volumes se trouveraient renfermer la copie exacte des livres de toute nature et de toutes langues conservés dans les plus riches bibliothèques du monde.
  2. ^Jorge Luis Borges, "The Total Library", 1939.Anthologized in Selected Non-fictions (1999). Edited by Eliot Weinberger. New York: Viking
  3. ^Isaac, Richard E. (1995).The Pleasures of Probability.New York: Springer. pp.48–50.ISBN0-387-94415-X.OCLC610945749– Isaac generalizes this argument immediately to variable text and alphabet size; the common main conclusion is on page 50.{{cite book}}:CS1 maint: postscript (link)
  4. ^Gut, Allan (2005).Probability: A Graduate Course.Springer. pp.97–100.ISBN0-387-22833-0.
  5. ^abKittel, Charles;Kroemer, Herbert(1980).Thermal Physics(2nd ed.). San Francisco: W.H. Freeman Company. p. 53.ISBN0-7167-1088-9.OCLC5171399.
  6. ^Zenil, Hector and Soler-Toscano, Fernando (October 2013)."Infinite Monkey Theorem".Wolfram Demonstrations Project.RetrievedMay 24,2024.{{cite web}}:CS1 maint: multiple names: authors list (link)
  7. ^Borel, Émile (1914).La hasard(in French). Paris: Félix Alcan. p. 164.Alt URL
  8. ^Arthur Eddington (1928).The Nature of the Physical World: The Gifford Lectures.New York: Macmillan. p.72.ISBN0-8414-3885-4.
  9. ^Eddington, Arthur."Chapter IV: The Running-Down of the Universe".The Nature of the Physical World 1926–1927: TheGifford Lectures.Archived fromthe originalon 2009-03-08.Retrieved2012-01-22.
  10. ^Aristotle,Περὶ γενέσεως καὶ φθορᾶς(On Generation and Corruption), 315b14.
  11. ^Marcus Tullius Cicero,De natura deorum,2.37. Translation fromCicero's Tusculan Disputations; Also, Treatises On The Nature Of The Gods, And On The Commonwealth,C. D. Yonge, principal translator, New York, Harper & Brothers Publishers, Franklin Square. (1877).Downloadable text.
  12. ^The English translation of "The Total Library" lists the title of Swift's essay as "Trivial Essay on the Faculties of the Soul". The appropriate reference is, instead: Swift, Jonathan, Temple Scott et al. "A Tritical Essay upon the Faculties of the Mind." The Prose Works of Jonathan Swift, Volume 1. London: G. Bell, 1897, pp. 291-296.Internet Archive
  13. ^Borges, Jorge Luis(August 1939). "La biblioteca total" [The Total Library].Sur.No. 59.republished inSelected Non-Fictions.Translated byWeinberger, Eliot.Penguin. 1999.ISBN0-670-84947-2.
  14. ^abc"Notes towards the complete works of Shakespeare".vivaria.net.2002. Archived fromthe originalon 2007-07-16.– some press clippings.
  15. ^ab"No words to describe monkeys' play".BBC News.2003-05-09.Retrieved2009-07-25.
  16. ^"Notes Towards the Complete Works of Shakespeare"(PDF).Archived fromthe original(PDF)on 2009-03-18.
  17. ^K., Alfred (April 2013)."Finite Monkeys Don't Type: A story about the interpretations of probability".Alfred K.Archivedfrom the original on 2022-03-31.Retrieved2023-05-11.
  18. ^"Monkeys don't write Shakespeare".Wired News.2003-05-09. Archived fromthe originalon 2004-02-01.Retrieved2007-03-02.
  19. ^Padmanabhan, Thanu (2005)."The dark side of astronomy".Nature.435(7038):20–21.Bibcode:2005Natur.435...20P.doi:10.1038/435020a.Platt, Suzy (1993).Respectfully quoted: a dictionary of quotations.Barnes & Noble. pp.388–389.ISBN0-88029-768-9.
  20. ^Rescher, Nicholas (2006).Studies in the Philosophy of Science: A Counterfactual Perspective on Quantum Entanglement.Ontos Verlag. p. 103.ISBN978-3-11-032646-8.
  21. ^Powell, Doug (2006).Holman Quicksource Guide to Christian Apologetics.Broadman & Holman. pp. 60, 63.ISBN0-8054-9460-X.
  22. ^MacArthur, John (2003).Think Biblically!: Recovering a Christian Worldview.Crossway Books. pp.78–79.ISBN1-58134-412-0.
  23. ^Dawkins, Richard (1996).The Blind Watchmaker.W.W. Norton & Co. pp.46–50.ISBN0-393-31570-3.
  24. ^As quoted inBlachowicz, James (1998).Of Two Minds: Nature of Inquiry.SUNY Press. p. 109.ISBN0-7914-3641-1.
  25. ^Valentine, James (2004).On the Origin of Phyla.University of Chicago Press. pp.77–80.ISBN0-226-84548-6.
  26. ^Conrad, B.; Mitzenmacher, M. (July 2004)."Power laws for monkeys typing randomly: the case of unequal probabilities".IEEE Transactions on Information Theory.50(7):1403–1414.doi:10.1109/TIT.2004.830752.ISSN1557-9654.S2CID8913575.
  27. ^p. 126 ofThe Principles of Art,as summarized and quoted bySclafani, Richard J. (1975). "The logical primitiveness of the concept of a work of art".British Journal of Aesthetics.15(1): 14.doi:10.1093/bjaesthetics/15.1.14.
  28. ^John, Eileen; Dominic Lopes, eds. (2004).The Philosophy of Literature: Contemporary and Classic Readings: An Anthology.Blackwell. p. 96.ISBN1-4051-1208-5.
  29. ^Genette, Gérard (1997).The Work of Art: Immanence and Transcendence.Cornell UP.ISBN0-8014-8272-0.
  30. ^Gracia, Jorge (1996).Texts: Ontological Status, Identity, Author, Audience.SUNY Press. pp.1–2,122–125.ISBN0-7914-2901-6.
  31. ^Boyce Rensberger (March 6, 1979)."Computer Says Monkeys Couldn't Write 'Hamlet'—At Least Not So Far".The New York Times.
  32. ^Acocella, Joan (9 April 2007)."The typing life: How writers used to write".The New Yorker.– a review ofWershler-Henry, Darren (2007).The Iron Whim: A fragmented history of typewriting.Cornell University Press.
  33. ^Inglis-Arkell, Esther (June 9, 2011)."The story of the Monkey Shakespeare Simulator Project".io9.gizmodo.Retrieved24 February2016.
  34. ^ Marsaglia, George; Zaman, Arif (1993)."Monkey tests for random number generators".Computers & Mathematics with Applications.26(9). Elsevier, Oxford:1–10.doi:10.1016/0898-1221(93)90001-C.ISSN0898-1221.
  35. ^Susan Ratcliffe, ed. (2016),"Robert Wilensky 1951–American academic",Oxford Essential Quotations,Oxford University Press,in Mail on Sunday 16 February 1997 'Quotes of the Week'
  36. ^Lewis, Bob (1997-06-02)."It's time for some zoning laws in today's version of the Old West: the Web".Enterprise Computing, IS Survival Guide.InfoWorld.Vol. 19, no. 22. InfoWorld Media Group, Inc. p. 84.ISSN0199-6649.May also be in "Bob Lewis's IS Survival Guide", published March 19, 1999, ISBN 978-0672314377{{cite news}}:CS1 maint: postscript (link)
  37. ^Hoffmann, Ute; Hofmann, Jeanette (2001)."Monkeys, Typewriters and Networks"(PDF).Wissenschaftszentrum Berlin für Sozialforschung gGmbH (WZB). Archived fromthe original(PDF)on 2008-05-13.
  38. ^Ringle, Ken (28 October 2002)."Hello? This is Bob".The Washington Post.p. C01. Archived fromthe originalon 15 November 2002.
  39. ^Lorge, Greta (May 2007)."The best thought experiments: Schrödinger's cat, Borel's monkeys".Wired.Vol. 15, no. 6.
  40. ^"Monkey Typewriter".Microsoft Store Apps.Balanced Software. 2015-11-16. 9NBLGGH69FC8.Retrieved2022-02-14.