+0

# Infinite Monkey Theorem

0
421
4

So this schoolproject I'm working on asks me to calculate how long it would take a monkey to randomly type the letters: "Mag ik een banaan?" (Dutch for "Can I have a banana") on a keyboard.

Could someone check my calculations?

These are the given facts:

- There is 1 monkey on a typewriter

- Every second the monkey types one letter

- The monkey never dies and never stops typing

- The typewriter has 28 letters (the alphabet and a spacebar and a questionmark)

How long would it take the monkey to type:"Mag ik een banaan?"

The sentence had 18 characters and the typewriter has 28 keys.

There are 28^18 possible combinations of 18 letters, 28^18= 111.903.730.358.193.158.266.814.464

The monkey types 60 characters a minute, 3600 every hour, 86.400 every day, 31.536.000 every year.

So there are 28^18 different combinations of 18 characters, (28^18)*18=2.014.267.146.447.476.848.802.660.352 (2*10^27) letters in al the combinations

(2*10^27)/31.536.000= 6*10^20 years before the monkey would type down "Mag ik een banaan?"

Please let me know what you think about my calculations!

Guest Jun 9, 2015

#2
+26401
+10

The probability of the monkey getting it right on the k'th try is p = 1/n where n = 2818.  The time taken to get it right on the k'th try is k*18 secs.  Therefore, the expected time taken by the monkey to get it right is:

$$18p\Sigma_{k=1}^nk \text{ seconds }\rightarrow 18p\frac{n(n+1)}{2} \text{ seconds }\rightarrow 18\frac{(n+1)}{2} \text{ seconds}$$

Time ≈ 3*1019 years

.

Alan  Jun 9, 2015
Sort:

#1
+91450
+5

I agree that the chance of getting all those letters in that order from any given starting point is 1/28^18

I agree with how many letters are typed in a year.

But after that you lost me.

There is probably some key thing that I am supposed to understand but I do not understand.

In reality, the monkey could get that combination on the first go - it is afterall just as likely as any other set of 18 characters.

OR

The monkey could type away for any finite period and the sentence will not appear.

I am sure that someone could work out the probability of it a appearing in any given period of time but I do no see how they could specify exactly how long it would take.

Like I said, I expect I am missing some key understanding of what is being asked here.

Melody  Jun 9, 2015
#2
+26401
+10

The probability of the monkey getting it right on the k'th try is p = 1/n where n = 2818.  The time taken to get it right on the k'th try is k*18 secs.  Therefore, the expected time taken by the monkey to get it right is:

$$18p\Sigma_{k=1}^nk \text{ seconds }\rightarrow 18p\frac{n(n+1)}{2} \text{ seconds }\rightarrow 18\frac{(n+1)}{2} \text{ seconds}$$

Time ≈ 3*1019 years

.

Alan  Jun 9, 2015
#3
+132
+5

Humans love to ask hypothetical questions about monkeys typing random strings. We were curious ourselves so we did an experiment. Though we are often referred to as such, we of course are not monkeys; we are apes. We are not just any ape we are genetically enhanced primates.

To compensate for this obvious advantage we modified the experiment by setting up computer keyboards during one of our banana and coconut daiquiri parties for board members and guests. Everyone had to type at least 2 dozen characters to get a drink and they could type anything whenever they had a mind to. There is nothing like alcohol to introduce a randomizing element into the experiment.

After we sobered up, we analyzed the data. We had about 119,479 bytes consisting of typed characters on a standard keyboard.

The most common phrases were

Melody would you like another daiquiri?

CPhill would chop a few more coconuts please.

Ayumu would you bring me another daiquiri?

Get it yourself you *** ****

Ayumu what is 1+1 ?

Shut the **** up you *** ****

Stop throwing **** at me you ******* *** ****

(This wasn’t a series of asterisks it just the word filter at work)

There were no Shakespeare phrases. The closest to that was

“To pee or not to pee on this keyboard”

This sounds like an inebriated Chimp Stuart. He often modifies quotes from Shakespeare

A few hours in to the party, it became more random and unprintable.

------------------

Chimp Ayumu enjoying her pipe. She says she can see equations in the smoke. I believe her.

Chimp Otis eating a banana. When he’s sloshed he often eats the peel too. He's not just a ham, he’s a p*g.

Chimp Oskar. He’s a chick magnet for all primates.

-------------------------

I had to abandon my campaign for Moderator.

Most of us were caged for the past month. We were accused of smuggling mangos across state lines. It probably wasn’t a good idea to put 450 kilos of mangos in the trunk of Chimp Dix’s car. The cops pulled us over because the rear of the car would make a few sparks whenever the road was bumpy. If we had stayed calm, we probably would have just been fined and sent on our way. We didn’t mind paying a fine but the pigs wanted to confiscate our mangos.

One of the pigs said we should be in a zoo. That was the last straw. I don’t know who, but one of us threw a big mango at the pigs and the fight was on. After it was over, there was more than two-hundred kilos of very ripe mangos splattered on the pigs and covering the ground. Most of us were caged, but Chimp Loki managed to escape. His skills far exceed those of a mere mortal chimp; he managed to re-appropriate Chimp Dix’s car from the impound lot --it still had most of the mangos in the trunk. They let us out a few days ago and he came to pick us up and we were on our way.

I can tell you the only monkey bars we like are the ones that have daiquiris. First, we are kicked out of Greece, and then we are arrested. There are only concrete jungles where we live, but near here are forests. We are going to enjoy these forests for awhile, while we eat our naturally puréed mangos, complete with fruit flies, along with the bananas we brought from South America. Yes, the forest where the deer and, occasionally, the antelope play is our destination. Where the only pigs are wild ones -- true artiodactyls -- not the theoretical hybrids of ancient chimps and pigs by miscegenation that live in the concrete jungle.

Lucky Eddie winning most of the smokes in the pokey. He wins the most when we are not in the slammer too. I think he cheats, but we’ve never caught him.

So long, farewell, auf Wiedersehen, au revoir, arrivederci, sayonara, and good-bye.

When we return, I may campaign again for Moderator. I see the Governor General appointed Alan. An excellent choice. Congratulations!

LancelotLink  Jun 12, 2015
#4
+91450
+5

That really is a most interesting experiment.

A little biased prehaps but still a valid random experiment to investigate the "Infinite monkey Theorem."

Did no one type " Can I have a banana ... Daiquiri .....please?"  (I believe some chimps are very polite.  )

I thought that, in the early hours of the evening, surely some monkey would have typed that!

Maybe not in English or in Dutch...... Perhaps in French or Arabic or Swahili !

But still...........

I expect you will be keeping your nose very clean now. (after you wipe of the pureed mango and fruit fly mix from your face)

If you are going to run for moderator again then you cannot afford to have any recent skeletons, or illegal fruit, in your closet!

This has been included in our reference material thread

(For Alan's answer, not for LancelotLink's contribution)

Melody  Jun 12, 2015

### 15 Online Users

We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners.  See details