# Proof of infinite monkey theorem. [duplicate]

I was just wondering, does the infinite monkey theorem also has a proof? And why is this called a theorem? It is sheer common sense. And what are its applications. I have heard about PHP and IEP and I also know that they are pretty useful. But what is the use of this and what is its proof?

## marked as duplicate by Did probability StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Apr 25 '15 at 20:38

• A theorem does not need to be profound. It's also true that a number of things that are sheer common sense turn out to be false (especially, though not only, in mathematics). – Brian Tung Apr 24 '15 at 17:06

Let $A_n$ be the event that the $n^{th}$ monkey types the complete works of Shakespeare. Then if there are $m$ characters on the keyboard and $N$ characters in the complete works of Shakespeare, $\mathsf{P}(A_n) = m^{-N}$ for each $n$. Furthermore the $A_n$ are mutually independent. Hence, by the second Borel-Cantelli Lemma, since $$\sum_{n=1}^{\infty} \mathsf{P}(A_n) = \sum_{n=1}^{\infty} m^{-N} = \infty,$$ infinitely many of the events $A_n$ occur i.e. infinitely many monkeys will type the complete works of Shakespeare.
• @Tomek: This seems to be confusing: if they type for an unlimited time, then you only need one monkey. The probability $m^{-N}$ seems to refer to the event that a monkey writes the given work "at the beginning". Also, in your conclusion, I miss some kind of "with probability 1" statement or so. Last but not least, isn't that Canetelli Lemma an overkill? – Peter Franek Apr 24 '15 at 9:53
• @AdityaAgarwal it is a theorem about a probability hence probabilty theory is the tool to use. Also, Borel-Cantelli is more or less equivalent to the infinite monkey theorem. The idea is to compare convergence of $1-\prod(1-p)$ with that of $\sum p$ – Hagen von Eitzen Apr 24 '15 at 9:55
• @Aditya: If you prefer, more intuitively, you can complete the demonstration as follows: One monkey fails to type the CWOS (from the beginning) with probability $1-1/m^N$. Two monkeys fail to type it with probability $(1-1/m^N)^2$. In general, $k$ monkeys fail to type it with probability $(1-1/m^N)^k$. Since $1-1/m^N < 1$, you can always set $k$ arbitrarily large to make the probability of failure arbitrarily small. Thus, out of an infinite number of monkeys, at least one (in fact, an infinite number) will succeed in typing CWOS. – Brian Tung Apr 24 '15 at 17:00