Infinite monkeys theorem

created by Reptile
(idea) by neil (5.8 d) (print)   (I like it!) 1 C! Tue Jan 16 2001 at 6:32:59

See also Jorge Luis Borges's short story The Library of Babel. It is about a library which not only comprises the entire Universe, but which also contains every possible book, including all the books of pure nonsense, etc.

Something that's been in my fortune list for a few years:

I'm not really this much of an OS bigot. This list was compiled based on of the common stereotypes. Yet I suspect that a lot of people are voting this up because they like having their prejudices reaffirmed.

(thing) by rp (2 d) (print)   (I like it!) 1 C! Mon Feb 26 2001 at 15:44:16
Here is what - despite the writeups below - I consider the definitive article on the subject. I hope the original author, whom I haven't attempted to contact, doesn't object to this redistribution in a different medium.


From: dsfergem@fas.harvard.edu (David Fergemann)
Newsgroups: harvard.general
Subject: Re: Power Putty: Info Wanted
Date: Jan, 1996

jhliu@scunix4.harvard.edu (Jonathan Liu) wrote:

> Cindy Alvarez wrote:
> :       "If an infinite number of monkeys typed at an infinite number
> :       of computers for an infinite length of time, they'd produce
> :       a paper which would get a B+ at Harvard."  -me
>
> I'm looking for an infinite number of monkeys and an infinite number of
> computers to type a paper for me.  Anyone know where I can find one?
                                                                  ^^^^
One isn't going to do you any good.  The "infinite number" part was
important.  I've never believed the "infinite number of monkeys" idea
anyway.  If you said instead, "an infinite number of truly-random
character generators running on an infinite number of computers for an
infinite length of time," I'd believe it.
(Your typical pseudorandom function won't work; it repeats after a few
billion numbers or so).  The monkeys won't work for a number of reasons.

1) Monkeys will get bored, and won't type one character at a time.
Instead, you'll get stuff like:

X-IO432, .CXZX
 CZV ;ASskjzx c
[\W.,/KJ23\
X C. /ZX-=1
'C/XC0-WQ  \WE
?VC VB45A432we
?D;[2e   \[]c?x ;mpioqw\4352?GH';l[bvx-=trw123?!
';\]zx[  awre 3241;1-=sd?>Fg;lk230-=AS
';ZX C.,/WEQ[]
SDKLJ;FJ;KL32490CD,. AS/
"}aSDKLRE.'
;C KJQW
\rds;l'4iopczx/.,zx;"
|sfd]wA,CVZX[]XVC[PSO0-XCZ,.VSD09-=123\
SA
?:vzc;odssa\q  [\]vc,.mldf;':i690-hgfdc
\';asdl]aS
Z

(I typed that with my knuckles).

2) As you can see in the above example, knuckle-typing leads to serious
problems, including:
   a) high frequency of the semi-colon and other punctuation
   b) Rather than single capital letters followed by strings of lower case
letters, you wind up with strings of capital letters, due to the caps-lock
key.
   c) Extremely redundant.  In particular, notice the digraph frequencies
(count the number of times you see "zx", "jk", "23" and "kl".  Notice also
how frequently a line begins with ' " ? or / due to their proximity to the
return key.)
   d) A typical paper includes only one carriage return per paragraph.  It
looks like I'm averaging about one per 15 letters in the above.

3) Various other problems:
   a) Monkeys don't know how to adjust fonts and margins to make the paper
fit into the right number of pages.
   b) Monkeys might have a tendency to throw feces at the computer.
   c) The sun is scheduled to burn out within a few billion years, which
will put an end to the monkey typists.
   d) Your paper is probably due before then anyway.

--
Dave Fergemann
   
(idea) by Professor Pi (1.1 mon) (print)   (I like it!) 4 C!s Thu Nov 15 2001 at 6:31:38

"Ford!" he said, "there's an infinite number of monkeys outside who want to talk to us about this script for Hamlet they've worked out."
Douglas Adams, The Hitchhiker's Guide to the Galaxy (1979).

This quote is perhaps the most famous reference to the Infinite Monkeys Theorem. This theorem states that if you put an infinite number of monkeys behind typewriters, eventually one will write the script for Hamlet. Alternatively a finite number of monkeys with infinite time will also accomplish this. The implication is that a problem or task of any complexity can be solved using brute force trial-and-error, even without intrinsic knowledge of a system, nor the intelligence to adapt to a situation.

The infinite monkeys theorem applies to (generally large) systems where the dataset is either sampled entirely in a systematic manner, or completely at random.

An example of sampling the entire dataset is finding a computer password or cryptographic key by brute force; one would simply try all possible character combinations (e.g.: aaaa,aaab, aaac...) until the proper solution is found. This would take a very long time, especially if there is no additional information about the length of the password, or the characters that are allowed. Nevertheless, this technique can be quite effective for smaller datasets. For instance, if the Coca Cola company wants to introduce a new beverage, they may survey people about a few of the properties of the drink, such as color, flavor, and carbonation. If each property has two options, they could do a market survey on the entire dataset, and serve the survey group a total of 8 drinks:

  1. Lemon / Yellow / Carbonated
  2. Lemon / Yellow / Non-Carbonated
  3. Lemon / Red / Carbonated
  4. Lemon / Red / Non-Carbonated
  5. Raspberry / Yellow / Carbonated
  6. Raspberry / Yellow / Non-Carbonated
  7. Raspberry / Red / Carbonated
  8. Raspberry / Red / Non-Carbonated

Using common sense, a researcher would only consider yellow lemon or red raspberry drinks, but the general idea is clear. For larger numbers of combinations in the dataset, this method becomes impractical very quickly. If we want to survey another property, the number of drinks doubles (24 = 16). If there are three choices for each category, the number of possibilities increases to 33=27.

An example of random sampling of a large dataset is (to a certain degree) evolution. The combination of different genetic material, and mutations allow for a seemingly infinite number of genotypes, each of which are more or less adjusted to a dynamic environment (not taking into account the factors that make up natural selection). Another example in this category is the mathematics of irrational numbers such as e, and pi. It is often assumed that pi is a normal number, i.e. any arbitrary, finite string of digits is represented somewhere in the digits of pi. The string of digits could be your phone number, social security number, or even Hamlet in ASCII values. However, there is no formal proof of this yet.

One final example in the time domain is the prophecies of Nostradamus. Given a final number of arbitrary, vague prophecies, and an infinite amount of time, each and every prophecy will prove to be true.

The history of the infinite monkeys theorem is not entirely known. Most certainly, Douglas Adams is not the source of the theorem, as it was reported much earlier than that. It may be as old as the typewriter itself. Or perhaps one of the infinite monkeys scribbled it into the soil with a stick a few thousand years ago. However, the first historical notion of the infinite monkeys theorem is in French, by Emile Borel1 (1913):

... Concevons qu'on ait dressé un million de singes à frapper au hasard sur les touches d'une machine à écrire et que, sous la surveillance de contremaîtres illettrés, ces singes dactylographes travaillent avec ardeur dix heures par jour avec un million de machines à écrire de types variés. Les contremaîtres illettrés rassembleraient les feuilles noircies et les relieraient en volumes. Et au bout d'un an, ces 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. Telle est la probabilité pour qu'il se produise pendant un instant très court, dans un espace de quelque étendue, un écart notable de ce que la mécanique statistique considère comme la phénomène le plus probable...
Let's consider that we trained one million monkeys to randomly strike the keys of a typewriter, and that under surveillance of illiterate foremen the monkey typists ardently work for ten hours per day on one million typewriters. The illiterate foremen would collect the blackened sheets and compile them into volumes. And after one year, those volumes would contain the exact copy of books on any subject, in any language, in the largest libraries around the world. This is the probability that occurs during one very short moment, at some place, a remarkable event that statistical mechanics considers to be the event with the highest probability

The first mention of the infinite monkeys theorem in English is attributed to Sir Arthur Eddington2 (1929):

...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.

There are numerous other mentions of the infinite monkeys theorem; too many to sum up. Although one of them I found particularly interesting: L. H. C. Tippett was a statistician who was the first to produce a large table with random numbers for statistical purposes (in fact, the table consisted of 41 600) numbers. On one occasion, Tippet was introduced by Edward Condon, the director of the Bureau of Standards. Condon illustrated the idea that random events by chance may lead to a meaningful sequence, such as the possibility that a monkey may write a Shakespeare play. Referring to the book of random numbers, he then remarks that in fact Tippett had written a book that could have been produced by a monkey.

Another interesting writing on the infinite monkeys theorem is by the poet Lucio3, regarding an address at the British Association for the Advancement of Science (a.k.a. the British Ass.). The second two stanzas are:

Give me half a dozen monkeys
Set them to the lettered keys
And instruct these simian flunkies
Just to hit them as they please
Lo! The anthropoid plebians
Toiling at their careless plan
Would in course of countless aeons
Duplicate the lore of man

Thank you, thank you, men of science
Thank you, thank you British Ass!
I for long have placed reliance
On the tidbits that you pass
And this season's nicest chunk is
Just to sit and think of those
Six imperishable monkeys
Typing in eternal rows

And since we're on the topic of poetry, allow me to close by quoting a Dilbert comic strip4, where Dilbert writes a poem and presents it to Dogbert.

DOGBERT: I once read that given infinite time, a thousand monkeys with typewriters would eventually write the complete works of Shakespeare.
DILBERT: But what about my poem?
DOGBERT: Three monkeys, ten minutes.

Factual Sources:

1: Émile Borel, ``Mécanique Statistique et Irréversibilité,'' J. Phys. 5e série, vol. 3, 1913, pp.189-196.

2: A. S. Eddington, The Nature of the Physical World: The Gifford Lectures, 1927. New York: Macmillan, 1929, page 72.

3: Warren Weaver, Lady Luck, Anchor Books, Garden City, NY, 1963, 239-240

4: Scott Adams, Dilbert comic strip, 15 May 1989.

http://www.research.att.com/~reeds/monkeys.html (many more examples of the infinite monkeys theorem)

William S. Peters, Counting for Something - Statistical Principles and Personalities, Springer Verlag, 1986
(idea) by aaronin (3.8 mon) (print)   (I like it!) Wed Jun 11 2003 at 0:17:25
The Infinite Monkey from a Duration of the Universe Perspective (as well as a recent experiment)

Yes, We've all heard it and we'll all hear it again. You know the story- get some monkeys together and give them all some typewriters or some computers and they'll eventually type out every masterpiece man has ever written (and then some!). Of course, infinite time is given and some people insist upon an infinite amount of monkeys too. It is a nice idea but in reality, this is impossible and I am going to run off a list of the real reasons why this would never happen...

Many attribute the source of the Monkey Myth to Arthur Eddington. He claimed that six monkeys on six typewriters, set to type for the duration of time would eventually produce all the books in the British Museum. It has been stated in many different ways, all with the same intention- Proving that what seems impossible is possible; however, what is Impossible is such for a reason- Because it is.

Firstly, for the sake of this we must make a basic assumption: that reality as we know it will hold for an infinite period of time. (i.e. - the monkey population will never be infinite, a monkey will never be able to type an infinite amount of letters/words per second etc.) These are all distinct components of the world as we perceive it. If you want to debate these statements, try Philosophy.

  • The time span it would take a monkey to type any work is much greater than the duration of the universe. The Universe may never reach a definite end; it may extend onwards forever; however, there is one aspect of physics that scientists are (fairly) certain of. Protons will decay in about 10 to the 25th power years (10^25). There won't be an monkeys or typewriters if there aren't any protons to make up the objects. Proton Decay will only be a problem if these monkeys can somehow survive without light. All the stars in the universe will burn out long before they ever get to the stage of proton decay. The Stars will be dead by the time the universe reaches the age of 10^15. (Also known to many as the 15th cosmological decade). This is only a problem if these monkeys can survive the red giant phase of our sun in about five billion years. There are a lot of obstacles between the monkeys and their literary accomplishment; however the remaining 4.5-5 billion years of life on Earth should surely be plenty of time for something of worth to arise...?

    The probability of six monkeys producing a single work within any period of meaningful time is zero. Calculations have shown that it would take six monkeys approximately 500,000 cosmological decades (10^ 500,000) years to produce a single workThose are pretty long odds.

  • Another wrench (maybe a Monkey Wrench) in the cogs of this argument is the fact that Monkeys are not mindless. Monkeys respond to stimuli and can formulate, at the very least, basic ideas. This means that a group of monkeys would never be able to truly achieve a random distribution of letters. When a monkey strikes the keyboard there is not necessarily a 1/26 chance that the monkey will hit that letter.

    The University of Plymouth in England in the Spring of 2003 conducted an experiment on six monkeys where the monkeys were given a computer with which they could mindlessly type; however the results were not mindless- nor anywhere near random. The monkeys demonstrated a fondness for the letter S (which filled most of the pages) and a tendency towards pushing J, A, L, and M towards the end of the four week experiment. This is not a random distribution of letters by any means, nor is it anywhere near close. This experiment proves that a monkey is too intelligent a subject for the infinite time typing. The monkeys noted that when they pushed a key, something happened on the computer screen.

    Time and Intelligence stand as major obstacles to the monkey idea. It is just as likely that you would be able to walk through a wall (a near infinite number of Particles undergoing Quantum Tunneling at the same instant) than a group of monkeys composing a single work of literature.

  • There are other logical impossibilities with this:
    • We would need an infinite amount of paper
    • an infinite amount of ink (and at these prices!)
    • An Infinite amount of typewriter parts (or an adequate supply of nev-R-break typewriters).
    • An infinite amount of either monkeys or time.
    • And even if we did have all these supplies would probably form a ball of mass so great that it would probably degenerate into a black hole and eventually end up crushing all of the monkeys, typewriters and office supplies into an infinitely small and ironic point.


Sources
http://education.jlab.org/qa/radelement_03.html
General Wesc who also mentioned the Black Hole Point before me; therefore, the credit belongs to him...
http://www.arn.org/docs2/news/monkeysandtypewriters051103.htm
http://www.cnn.com/TECH/9701/15/end.universe/
For more on the duration of the universe I recommend "The Five Ages of The Universe" by Fred Adams
More on Quantum Tunneling can be seen in "The Elegant Universe" by Brian Greene
No more writeups are being accepted for this node. All your good effort has produced Coriolanus. Thank you, you can stop now. If you feel you have something to add to this node, post it on your Scratch Pad and contact an editor.