The Infinite Monkey Theorem

You might also like

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 19

The Infinite Monkey

Theorem
2010 (2-3)
Group members:
Joshua Lim
Willy Tan
Tan Wei Xiang
Tow Ying Xiang

Teacher mentor:

Madam Ee Ah Hong

Picture from: http://sophismata.wordpress.com/2009/03/05/monkeys-and-typewriters/


Contents
About the infinite monkey theorem Pg 3

Proving the theory Pg 5

Concerning the probabilities Pg 7

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.

In this context, almost surely is a mathematical term. If we say that an event is


‘sure’, then it means that the event is sure to happen even though the chances may be
so small. This is why it is possible to type out at random and still have a chance to
produce text from a book. When we say an event is ‘almost sure’, it means that the
event has a possibility of happening within a given set of possible outcomes.

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

And is the first few blocks of 6 letters.

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.

As approaches infinity, the probability Xn approaches zero. So, by making n


huge enough, Xn can be made as small as you want it to and the chance of typing
durian will near 100%. However, it is impossible for the chance of typing out durian to
reach 100% unless is infinity, which is impossible since there is no such thing as
infinity in real life. Everything has a limit.

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

Without the consideration of other keys on the keyboard such as capitalization,


spacing, and punctuation, a monkey typing letters uniformly at random has a chance of
one in 26 of correctly typing the first letter of an average adult fiction story book. It has a
chance of one in 676 (26 × 26) of typing the first two letters. Thus at 20 letters it already
has only a chance of one in 2620 = 19,928,148,895,209,409,152,340,197,376.

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:
http://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:

Caps Lock, M, Caps Lock, r, space, Caps Lock, B, Caps Lock, e, a, n

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.

Note: All applications will use example 1 in them as it is more realistic.

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.

After experimenting by hitting the keyboard randomly with a palm, it is realized


that sometimes different numbers of keys are hit. The numbers are usually small. Our
estimate suggests that the numbers range from 0 to 4. There is a huge probability that a
lot of keys can be hit but no letter will be typed out. Thus, the probability of typing out 0
letters is higher than the other probabilities. Below is the chart that tallies up our
attempts at hitting a keyboard with a full palm out of 50 tries.

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

In this case, to type out ‘hold’, there are 3 different probabilities:

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.

Hitting out 1 letter then hitting out 3 letters


Whether 1 or 3 letters are hit out first does not really matter. Altogether, the
probability is the same. Let’s do the sums for hitting out 1 letter first. From above, you
can see it is .

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.

Hitting out 4 letters once


This is basically another modification of example 3. The probability to type out 4
letters from the word to be typed out is . There are 24 different orders for 4 letters.
So, in this case, we will have to multiply the probability of getting 4 letters from the word
to be typed by Stated below is the probability of getting ‘hold’ when hitting out 4
letters at once.

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

I felt that this project was very beneficial as I used my


mathematical knowledge and applied it. This project was a
great intellectual exercise as I had to search and collate
knowledge that I had never learnt before which was quite
tough initially but after a while, I became used to it and
overcame it eventually. I also learnt that I must have tolerance
and practice self-control as other people's views may be
different from mine but may not be necessarily wrong because
during the course of completing the project we faced many
conflicts but managed to resolve them and reach a consensus
in the end. Also, I learnt to respect other people and try to
accommodate them as we all have different plans and
schedules so we must try to allow each other freedom. I learnt
this when trying to meet up with my fellow group members as
Wei Xiang was not free for most of the days so we had to
organize when we wanted to meet. Also, due to the differences
in talent in our group, we had to delegate the tasks to the right
people even though it caused some of us to be disgruntled, we
still went with it as we knew it was the best for us. I was
eventually given the role of researching and editing the final
product as I was the best at mathematics. I hope to do more
projects lie this so I can learn more things.

Page 15 of 19
Joshua Lim

I have learnt many things and encountered many challenges in


our project work.

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

However, in the end, we managed to pull through and form a


rather good project. Through this process believe that I and my
group have learnt how to work better as a team and some
traits of my other group members. For example, Willy is a good
task manager and explains things well while Ying Xiang can
adapt well is rather knowledgeable.

Thus I think that this project work has been very fruitful.

Page 16 of 19
Willy Tan

Project work has thought me a lot of new things. Our opportunity


to present a mathematics topic is very valuable. In fact, it was
the first time I ever got a chance to present something related
to mathematics. Thus, I treasured the course of project work.
However, I also faced a lot of problems in project work. Firstly,
we could not find a suitable mathematics topic and only
managed to get one at the end of term 2. We then had to rush
the mathematics project during the holidays. Unfortunately,
our topic was too difficult to understand and thus we had to
change our project on the last week of the June holidays. So,
we came up with the Infinite Monkey theorem. Unfortunately,
that was not the end of our problems. My group had one
member who slacked a lot, thus it was difficult to get him to
help out. Even though there are a lot of difficulties, I treasure
the course of this project work as when I look back to it, it will
teach me to be more efficient about projects in the future and
to get better group members.

Page 17 of 19
Tan Wei Xiang

We had a hard time discussing on what topic to do. Mdm Ee


offered us to do a math project .we had actually wanted to do
a project related to service learning or a science project but
she said that she does not do science projects, thus in the end
we decided on the infinite monkey theorem.

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) http://www.junkworthknowing.com/technology/the_infinite_monkey_theorem

2) http://en.wikipedia.org/wiki/Infinite_monkey_theorem

3) http://www.greatplay.net/?p=1825

4) http://www.mathgoodies.com/lessons/vol6/intro_probability.html

Page 19 of 19

You might also like