ELI5: Infinite monkey theorem, how is it possible

The theorem is a thought experiment on chance and probability.

The assumption is that monkeys that are given typewriters will hit letters at random. If they hit letters at random there's a slight chance that they will at random hit the right keys to form a word, for example K - E - Y to form the word "key". The longer a word is, the more keys they have to hit right at random and therefore the lower is the chance that it will be typed. By adding more monkeys, more letters will be typed and the chance that at least one of them will type the desired word will increase. Now, if you have an infinite amount of monkeys and an infinite amount of time, at some point one of them will hit the right keys to form longer words or even entire sentences that make sense. More than that, at some point, even if it takes a billion years or so, one of them should type out the entire script of a work of Shakespear. After all, even that is only a series of letters and other symbols.

The theorem fails in reality though, not just from a lack of time and monkeys, but also from the fact that monkeys don't really type at random. They tend to just repeatedly hit the same key all over again.

A better version of the infinite monkey theorem is "The Library of Babel". It's a computer algorithm that will generate random letters depending on which "book" you choose in it.

It has a total of 3.5*10^5073 "rooms" (the amount of atoms in the observable universe is estimated to be a pitiful 10^82). By typing in any string of numbers and lower letters you will choose one of those rooms. Each room has 640 books, each book has 400 pages and each page has 3200 symbols. This is probably as close as we're going to get to the infinite monkey theorem.

There is a good chance that somewhere in that "library" a work of Shakespear exists, however, finding it is another matter.

/r/explainlikeimfive Thread