# The infinitely typing monkey Everyone who is reading this article receives it through a code out of ones and zeros. An incomprehensible large numerical sequence with over 100 million places. It may sound incredible at first glance but in the number Pi there is a place which contains exactly this large numeric sequence out of ones and zeros. We talk about a trait of infinity here. You have certainly heard about the Infinite-Monkey-Theorem yet. The theorem states that a monkey hitting keys at random on a typewriter keyboard for an infinite amount of time will surely type a given text, such as the complete works of William Shakespeare. In fact, the monkey would even type every possible finite text an infinite number of times. Actually, the probability that monkeys filling the observable universe would type every book of the French National Library or even only one complete work of Shakespeare is so tiny that the chance of it occuring during a period of time hundreds and thousands of orders of magnitude longer than the age of the universe is extremely low. But we’ll get deeper into that soon.

This may seem astonishing at first, but this principle is merely based upon simple mathematics. Infinity has the property that all imaginable possibilities will occur at some point, no matter how unlikely they are. The consequence of this is that the irrational number Pi principally contains everything – since everything can be expressed in numbers. A name, a direction, a color, a sound. For instance, Pi contains the word “knowledge” after about 2.2 million decimal places, “power” after 3.6 million decimal places. In the first 10 trillion decimal places the sequence of numbers “1234567890” occurs 12 times and Pi also knows my date of birth, namely after 226 million decimal places. Pi is fascinating, infinity is fascinating.

But now let’s have a closer look at the infinitely typing monkey. How likely is it really that he typed Shakespeare’s works correctly? Well, in the following calculations we assume that there are only 26 possibilities of events, namely the alphabet. We ignore punctuation, spacing and capitalization for the sake of simplicity.

The probability of typing the first letter of the drama Hamlet is therefore 1 in 26. All calculations are based on the first trial of the monkey. Thus the probability for the first two letters is already 1 in 676. The probability for the result decreases exponentially. With just 20 letters it is only 1 to 20 octillions. That is a 2 with 28 zeros. This corresponds to winning the jackpot about four times in a row with four lottery tickets.

If we expect the monkey to type in the entire text of Hamlet, the probabilities are utopian low. In fact, they are so vanishingly small as to be inconceivable. The text of Hamlet includes approximately more than 130,000 letters. In the ideal case the probability would therefore be  1 in 26130 000. That is more than a millillion (no, not a million. A millillion, that equals 30 googol millions) to the power 61 or in other words equal to the number 10 billion quattuorcentillions to the power of 100 septuagintillion untrigintillion quinquagintillion gogols ( 261 300 gogols or 11 * 105000!). In a concrete comparison this would be a probability of 1 to a quintillion to the power of a quintillion to the power of a quintillion to the power of a quintillion to the power of a quintillion.

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 a single page of Shakespeare is unfathomably small.

Even if every proton in the observable universe were a monkey with a typewriter, typing from the Big Bang until the end of the universe, they would still need a far greater amount of time – more than 36.000 orders of the magnitude longer – to have even a 1 in 10500 chance of success. To put it in another way, for a one in a trillion chance of success, there would need to be 5 vigintillion universes made of atomic monkeys – oh, did I say 5? … I meant a billion billion trillion quadrillion.

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.

Nonetheless, the infinitely typing monkey would have finished Hamlet at some point of time. And at some point of time he would have also typed exactly the numbers mentioned above with all their places. This fascinating phenomenon is called infinity!