The Infinite Monkey Theorem

download The Infinite Monkey Theorem

of 19

Transcript of The Infinite Monkey Theorem

  • 8/9/2019 The Infinite Monkey Theorem

    1/19

    Teacher mentor:

    Madam Ee Ah Hong

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

    The Infinite Monkey Theorem

    2010 (2-3)

    Group members:Joshua Lim

    Willy TanTan Wei Xiang

    Tow Ying Xiang

  • 8/9/2019 The Infinite Monkey Theorem

    2/19

    ContentsAbout 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

  • 8/9/2019 The Infinite Monkey Theorem

    3/19

    About the Infinite Monkey TheoremThe 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 readabletext. 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 issure, then it means that the event is sure to happen even though the chances may beso small. This is why it is possible to type out at random and still have a chance toproduce text from a book. When we say an event is almost sure, it means that theevent has a possibility of happening within a given set of possible outcomes.

    However, the probability of other events besides the one that is almost surelyhappening go closer and closer to zero as the sample spaces size gets bigger.

    Page 3 of 19

  • 8/9/2019 The Infinite Monkey Theorem

    4/19

    The monkey in this context refers to a random generator that does not needdaily necessities like eating or drinking. In fact, the random generator will continue totype for an eternity without stopping to rest.

    Please also note that the monkey stated in the theorem is brainless. Without theability to think, it is basically just a random generator since it cannot decide what thenext letter it types will be.

    Page 4 of 19

  • 8/9/2019 The Infinite Monkey Theorem

    5/19

    Proving the theoryThe infinite monkey theorem is all about probability. Lets start simple.

    For example, the chance of Bob falling sick is 0.5. The chance of a stormhappening in Bobs town is 0.2. These two events are independent. So, to find thechance of Bob falling sick AND a storm happening in his town is:

    Now lets start the main thing. Suppose a typewriter has 100 keys. The word tobe typed is durian. Typing at random, the chance that the first letter typed is 'd is 0.01and 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 formthis expression:

    From the above expression, lets 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. Lets see a few sums to show this. By calculating after substituting with 1million, we will get 0.999999 for the chance of not typing out durian. Then, if yousubstitute with 1 billion, we will get 0.9990004998. Then, if you substitute with 1trillion, we will get 0.3678794412. As you can see, the chance of typing out duriangrows smaller and smaller as gets larger.

    As approaches infinity, the probability X n approaches zero. So, by making nhuge enough, X n can be made as small as you want it to and the chance of typingdurian will near 100%. However, it is impossible for the chance of typing out durian toreach 100% unless is infinity, which is impossible since there is no such thing asinfinity in real life. Everything has a limit.

    Page 5 of 19

  • 8/9/2019 The Infinite Monkey Theorem

    6/19

    However, there is a very low chance of allowing the chance of typing out durianto reach 100% happening realistically. If there are as many monkeys as there are asmany particles in the universe that can currently be seen (which is 10 80) and eachmonkey types at a super fast speed of 1000 keystrokes per second for 100 times the lifeof the universe (which is 10 20 seconds) without any rest, it is still highly unlikely that theywill even copy a short book perfectly.

    Page 6 of 19

  • 8/9/2019 The Infinite Monkey Theorem

    7/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 achance of one in 676 (26 26) of typing the first two letters. Thus at 20 letters it alreadyhas only a chance of one in 26 20 = 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. Anaverage book has 400 pages and each page has about 200 words. Thus there is aprobability of one in 3.4 10 183,946 to get the text right at the first trial. This is if we do notinclude punctuation. If we do it will be a one in 4.4 10 360,783 chance to get it right at thefirst 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 thanone in 10 183,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 themonkeys must eventually succeed "gives a misleading conclusion about very, very largenumbers." This is retrieved their textbook on thermodynamics, the field whose statisticalfoundations 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

  • 8/9/2019 The Infinite Monkey Theorem

    8/19

    ApplicationsThere 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 1Lets 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, totype 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

    http://www.asphaltandrubber.com/news/asphalt-rubber-welcomes-john-boyed-writing-mix/http://www.asphaltandrubber.com/news/asphalt-rubber-welcomes-john-boyed-writing-mix/http://www.asphaltandrubber.com/news/asphalt-rubber-welcomes-john-boyed-writing-mix/http://www.asphaltandrubber.com/news/asphalt-rubber-welcomes-john-boyed-writing-mix/
  • 8/9/2019 The Infinite Monkey Theorem

    9/19

    There are 11 keys to be pressed altogether. The chance of each key beingpressed 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 thanwith only the letter keys used.

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

    Example 2The 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. Lets say the phrase to be typed is go catch the eagle. In this case, there are 105keys but lets 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 sizeof 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 theprobability of the word being typed out. We cannot assume that monkeys are civilized inthe way that they type. Monkeys may whack the keyboard with both of their hands atthe same time. Lets say that the word to be typed out is donkey. Here is theexpression 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 isactually the same since 6 keys are supposed to be hit. However, the problem lies inwhen the monkey hits both keys at the same time, which will come first? This is a 50-50chance.

    Page 9 of 19

  • 8/9/2019 The Infinite Monkey Theorem

    10/19

    Lets assume that the chance of getting d and o really happened. To make sured comes before o, the chance of 0.5 must happen. Lets put it in this expression.

    This expression represents the chance of getting d and o at the shot of hittingboth 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 chanceto get do by itself 3 times.

    So, to conclude, the chance of getting donkey through the use of two fingershitting at the same time is smaller than when regular typing is used.

    This application can also be modified to a monkey smashing its hand ontoseveral keys at once. This is explored in example 4.

    Example 4A 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 amonkey using a whole hand to smash onto the keyboard. This may seem as amodification to example 3, but this is actually different. Hitting a keyboard with a wholehand may vary the number of keys hit.

    After experimenting by hitting the keyboard randomly with a palm, it is realizedthat 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 alot of keys can be hit but no letter will be typed out. Thus, the probability of typing out 0letters 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

  • 8/9/2019 The Infinite Monkey Theorem

    11/19

    For the next few expressions, we will follow this table as a guide since theprobabilities in real-life require very long testing in order to get the results. Lets assumethe 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 outwill 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

  • 8/9/2019 The Infinite Monkey Theorem

    12/19

    Hitting out 2 letters 2 timesThis 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 by0.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 lettersWhether 1 or 3 letters are hit out first does not really matter. Altogether, the

    probability is the same. Lets do the sums for hitting out 1 letter first. From above, you

    can see it is .

    Now whats 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

  • 8/9/2019 The Infinite Monkey Theorem

    13/19

    Now, we will finish the problem by multiplying the probabilities of hitting out 1letter from the word to be typed and hitting out 3 letters from the word to be typedtogether. The final probability is stated below.

    Hitting out 4 letters onceThis 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

  • 8/9/2019 The Infinite Monkey Theorem

    14/19

    Group ReflectionWe 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 learningsince 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 knowwhere to start. It was only at the end of term 2 when we came up with an idea, whichwas the Chebyshev's Sum Inequality theorem. We worked on it through the Juneholidays but then realized that we could not think of any way to apply the theorem sinceit is too difficult. So, during the last week of the June Holidays, we had to rush our newidea: The Infinite Monkey Theorem. It was a challenge to finish the project since we hadto 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 workhas 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

  • 8/9/2019 The Infinite Monkey Theorem

    15/19

    Tow Ying Xiang

    I felt that this project was very beneficial as I used mymathematical knowledge and applied it. This project was agreat intellectual exercise as I had to search and collate

    knowledge that I had never learnt before which was quitetough initially but after a while, I became used to it and

    overcame it eventually. I also learnt that I must have toleranceand practice self-control as other people's views may be

    different from mine but may not be necessarily wrong becauseduring the course of completing the project we faced many

    conflicts but managed to resolve them and reach a consensusin the end. Also, I learnt to respect other people and try to

    accommodate them as we all have different plans andschedules so we must try to allow each other freedom. I learntthis when trying to meet up with my fellow group members as

    Wei Xiang was not free for most of the days so we had toorganize when we wanted to meet. Also, due to the differencesin talent in our group, we had to delegate the tasks to the rightpeople 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 waseventually given the role of researching and editing the finalproduct 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

  • 8/9/2019 The Infinite Monkey Theorem

    16/19

    Joshua Lim

    I have learnt many things and encountered many challenges inour project work.

    Firstly, our idea was related to service learning, but since ourmentor Mdm Ee, the HOD of mathematics, suggested for us todo a mathematics project instead. At first, we thought it was

    going to be much easier than the usual project on servicelearning 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 manydifficulties finding a suitable topic to work on. We triedresearching on many topic such as the Chebeshev's inequality

    theorem and napoleons theorem until we finally decided towork 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 uspanicked. 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 arather good project. Through this process believe that I and my

    group have learnt how to work better as a team and sometraits of my other group members. For example, Willy is a good

    task manager and explains things well while Ying Xiang canadapt well is rather knowledgeable.

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

    Page 16 of 19

  • 8/9/2019 The Infinite Monkey Theorem

    17/19

    Willy Tan

    Project work has thought me a lot of new things. Our opportunityto present a mathematics topic is very valuable. In fact, it wasthe first time I ever got a chance to present something relatedto 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 rushthe mathematics project during the holidays. Unfortunately,our topic was too difficult to understand and thus we had tochange 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 onemember who slacked a lot, thus it was difficult to get him tohelp out. Even though there are a lot of difficulties, I treasurethe course of this project work as when I look back to it, it willteach me to be more efficient about projects in the future and

    to get better group members.

    Page 17 of 19

  • 8/9/2019 The Infinite Monkey Theorem

    18/19

    Tan Wei Xiang

    We had a hard time discussing on what topic to do. Mdm Eeoffered us to do a math project .we had actually wanted to doa project related to service learning or a science project but

    she said that she does not do science projects, thus in the endwe decided on the infinite monkey theorem.

    This project was difficult due to the lack of time and CCAs andother commitments. Though this project has noting much to dowith service learning, it plays a significant role in society and is

    applied in daily life

    Page 18 of 19

  • 8/9/2019 The Infinite Monkey Theorem

    19/19

    Bibliography1) 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

    http://www.junkworthknowing.com/technology/the_infinite_monkey_theoremhttp://en.wikipedia.org/wiki/Infinite_monkey_theoremhttp://www.greatplay.net/?p=1825http://www.mathgoodies.com/lessons/vol6/intro_probability.htmlhttp://www.mathgoodies.com/lessons/vol6/intro_probability.htmlhttp://www.junkworthknowing.com/technology/the_infinite_monkey_theoremhttp://en.wikipedia.org/wiki/Infinite_monkey_theoremhttp://www.greatplay.net/?p=1825http://www.mathgoodies.com/lessons/vol6/intro_probability.html