The Infinite Monkey Theorem
The Infinite Monkey Theorem
The Infinite Monkey Theorem
Theorem
2010 (2-3)
Group members:
Joshua Lim
Willy Tan
Tan Wei Xiang
Tow Ying Xiang
Teacher mentor:
Madam Ee Ah Hong
Applications Pg 8
Group reflection Pg 14
Personal reflections Pg 15
Bibliography Pg
Page 2 of 19
About the Infinite Monkey Theorem
The infinite monkey theorem states that if a monkey hits a typewriter at random
for an infinite amount of time, it is almost surely for the monkey to type out a readable
text. There is a chance it may also type out whole books like Lord of the Rings or
Animal Farm. However, the chance is very small.
However, the probability of other events besides the one that is almost surely
happening go closer and closer to zero as the sample space’s size gets bigger.
Page 3 of 19
The ‘monkey’ in this context refers to a random generator that does not need
daily necessities like eating or drinking. In fact, the random generator will continue to
type for an eternity without stopping to rest.
Please also note that the monkey stated in the theorem is brainless. Without the
ability to think, it is basically just a random generator since it cannot decide what the
next letter it types will be.
Page 4 of 19
Proving the theory
The infinite monkey theorem is all about probability. Let’s start simple.
For example, the chance of Bob falling sick is 0.5. The chance of a storm
happening in Bob’s town is 0.2. These two events are independent. So, to find the
chance of Bob falling sick AND a storm happening in his town is:
Now let’s start the main thing. Suppose a typewriter has 100 keys. The word to
be typed is durian. Typing at random, the chance that the first letter typed is 'd’ is 0.01
and the chance of the second letter ‘u’ being typed out is 0.01 and so on. Since each of
the letters have a chance of 0.01 to be typed out and there are 6 letters, we can form
this expression:
From the above expression, let’s put the chance of not typing durian is
Where
As grows bigger, the chance of not typing out durian grows smaller and
smaller. Let’s see a few sums to show this. By calculating after substituting with 1
million, we will get 0.999999 for the chance of not typing out durian. Then, if you
substitute with 1 billion, we will get 0.9990004998. Then, if you substitute with 1
trillion, we will get 0.3678794412. As you can see, the chance of typing out durian
grows smaller and smaller as gets larger.
Page 5 of 19
However, there is a very low chance of allowing the chance of typing out ‘durian’
to reach 100% happening realistically. If there are as many monkeys as there are as
many particles in the universe that can currently be seen (which is 1080) and each
monkey types at a super fast speed of 1000 keystrokes per second for 100 times the life
of the universe (which is 1020 seconds) without any rest, it is still highly unlikely that they
will even copy a short book perfectly.
Page 6 of 19
Concerning the probabilities
In the case of the entire text of the book, the chances are inhumanly small. An
average book has 400 pages and each page has about 200 words. Thus there is a
probability of one in 3.4 × 10183,946 to get the text right at the first trial. This is if we do not
include punctuation. If we do it will be a one in 4.4 × 10360,783 chance to get it right at the
first time.
Even if the observable universe were filled with monkeys typing for all time, their
total probability to produce a single accurate version of Hamlet would still be less than
one in 10183,800. As Charles Kittel and Herbert Kroemer put it, "The probability of Hamlet
is 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." This is retrieved their textbook on thermodynamics, the field whose statistical
foundations motivated the first known expositions of typing monkeys.
Thus it is highly unlikely that they will even copy a short book perfectly.
Page 7 of 19
Applications
There are many ways you can apply the infinite monkey theorem.
Image from:
https://www.asphaltandrubber.com/news/asphalt-rubber-welcomes-john-boyed-writing-
mix/
Example 1
Let’s say the phrase to be typed out is ‘Mr. Bean’. This also includes
capitalization and spacing. There are altogether 105 keys on a typical keyboard. So, to
type ‘Mr. Bean’, what the monkey has to press is:
Page 8 of 19
There are 11 keys to be pressed altogether. The chance of each key being
pressed is one in 105, so the probability of typing out ‘Mr. Bean’ is 0.0008658008658.
With all keys used, the probability of ‘Mr. Bean’ being typed out is smaller than
with only the letter keys used.
Example 2
The size of the keys on the keyboard also affects the probability of the word
being typed out. Take the space bar, for example. It is the size of approximately 6 letter
keys. Let’s say the phrase to be typed is ‘go catch the eagle’. In this case, there are 105
keys but let’s assume that there are 110 keys since the space bar is the size of 6 letter
keys. There are 15 letters and 4 spaces.
This has a much higher probability when compared to a space bar that is the size
of the regular letter key.
Thus, from the examples shown above, we can say that there is a higher
probability of typing out a phrase using a keyboard where the space bar is of its regular
size (which is 6 letter keys).
Example 3
The number of hands used on the keyboard is also a factor that affects the
probability of the word being typed out. We cannot assume that monkeys are civilized in
the way that they type. Monkeys may whack the keyboard with both of their hands at
the same time. Let’s say that the word to be typed out is ‘donkey’. Here is the
expression to show the probability of ‘donkey’ being typed out, but only with one finger
used.
If a monkey hits two keys at the same time, the probability of getting ‘donkey’ is
actually the same since 6 keys are supposed to be hit. However, the problem lies in
when the monkey hits both keys at the same time, which will come first? This is a 50-50
chance.
Page 9 of 19
Let’s assume that the chance of getting ‘d’ and ‘o’ really happened. To make sure
‘d’ comes before ‘o’, the chance of 0.5 must happen. Let’s put it in this expression.
This expression represents the chance of getting ‘d’ and ‘o’ at the shot of hitting
both keys at the same time. Now, there are 2 paths for chance to take. Getting ‘do’ or
‘od’. This is a 50-50 chance. To get ‘do’, we need to divide the expression by half.
Remember, this is only ‘do’. There are 3 pairs altogether, so multiply the chance
to get ‘do’ by itself 3 times.
So, to conclude, the chance of getting ‘donkey’ through the use of two fingers
hitting at the same time is smaller than when regular typing is used.
This application can also be modified to a monkey smashing its hand onto
several keys at once. This is explored in example 4.
Example 4
A monkey, as said in example 3, may not type in a civilized way. Just now, we
explored the use of both hands hitting at the same time. Now we will apply the use of a
monkey using a whole hand to smash onto the keyboard. This may seem as a
modification to example 3, but this is actually different. Hitting a keyboard with a whole
hand may vary the number of keys hit.
0 1 2 3 4
33 11 2 3 1
Page 10 of 19
For the next few expressions, we will follow this table as a guide since the
probabilities in real-life require very long testing in order to get the results. Let’s assume
the word to be typed is ‘hold’. To get each letter, the probability is:
However, there is a chance that no letter will appear. Thus, the probability to
get ‘hold’ will be smaller when typing with the whole palm. There is only a chance that
something will be typed out. If only one letter is typed out per hit, the probability of
typing out one letter of the word to be typed will be
However, the probability of typing out two letters from the word to be typed out
will be
The probability of typing out three letters from the word to be typed will be
The probability of typing out four letters from the word to be typed will be
Page 11 of 19
Hitting out 2 letters 2 times
This is much the same as example 3. From the above expressions, the
probability to type out ‘h’ and ‘o’ will be . What matters now is the order of the letters.
As said in example 3, to get the desired order, we will have to multiply the probability by
0.5.
Then, we get . Remember, that is only the first two letters of ‘hold’. Multiply the
two probabilities of getting the two pairs of letters from ‘hold’ to get the probability of
typing out hold through hitting the keyboard twice with two letters typed out.
Now what’s tricky is doing the sums for the 3 being hit out. The probability of 3
letters getting typed out is . To get the desired order, which in this case is either
‘hol’ or ‘old’, we need to multiply the probability by since there are 6 different orders
for any word of 3 letters.
Page 12 of 19
Now, we will finish the problem by multiplying the probabilities of hitting out 1
letter from the word to be typed and hitting out 3 letters from the word to be typed
together. The final probability is stated below.
Page 13 of 19
Group Reflection
We have learnt many things and encountered many challenges in our project
work.
Firstly, our idea was related to service learning, but since our mentor was Madam
Ee, the HOD of math, we had the chance to do a special project: math project. At first,
we thought it was going to be much easier than the usual project on service learning
since we did not have to do anything like surveys, which take up a lot of time. However,
we were wrong. There were many math theories to research on and we did not know
where to start. It was only at the end of term 2 when we came up with an idea, which
was the Chebyshev's Sum Inequality theorem. We worked on it through the June
holidays but then realized that we could not think of any way to apply the theorem since
it is too difficult. So, during the last week of the June Holidays, we had to rush our new
idea: The Infinite Monkey Theorem. It was a challenge to finish the project since we had
to juggle project work with other projects such as the science bio-journal. Nevertheless,
we have learnt much about the infinite monkey theorem and probability. Project work
has been a very challenging struggle for us but we have still managed to make it
memorable by producing the satisfactory fruits of our labour.
Page 14 of 19
Tow Ying Xiang
Page 15 of 19
Joshua Lim
Firstly, our idea was related to service learning, but since our
mentor Mdm Ee, the HOD of mathematics, suggested for us to
do a mathematics project instead. At first, we thought it was
going to be much easier than the usual project on service
learning since we did not have to do anything like surveys,
which take up a lot of time. However, we were wrong.
Mathematics was a very broad subject and we had many
difficulties finding a suitable topic to work on. We tried
researching on many topic such as the Chebeshev's inequality
theorem and napoleons theorem until we finally decided to
work on the in finite monkey theorem however, when that
decision was made, the June holidays were about to be over.
We had a hard time arranging discussion times and all of us
panicked. Moreover, we were also given other new projects
such as the bio journal and so, all of us struggled to cope
Thus I think that this project work has been very fruitful.
Page 16 of 19
Willy Tan
Page 17 of 19
Tan Wei Xiang
This project was difficult due to the lack of time and CCAs and
other commitments. Though this project has noting much to do
with service learning, it plays a significant role in society and is
applied in daily life
Page 18 of 19
Bibliography
1) https://www.junkworthknowing.com/technology/the_infinite_monkey_theorem
2) https://en.wikipedia.org/wiki/Infinite_monkey_theorem
3) https://www.greatplay.net/?p=1825
4) https://www.mathgoodies.com/lessons/vol6/intro_probability.html
Page 19 of 19