# probability of 26 letters

A monkey at a typewriter types each if the 26 letters of the alphabet exactly once, the order being random.

A. What is the probanility that the word HAMLET appears somewhere in the string if letters? B. How many independent monkey typists would you need in order that the probability that the word appears is at least 0.90?

Attempted solution:

A. Sample space = 26! Now the challenge was to find the size of the event. I said that there are $26 - 6 + 1 = 21$ ways that hamlet could be written in our sequence. Now take that with $20!$ different ways the other letters of the alphabet could be arranged and i end up with: $$P(event) = \frac {20! × 21}{26!}$$

B. This one i found a little trickier, but if this was the probability for one monkey and they want a probabikity for 9 would i set it up like this: $$0.90 = \frac {20! × 21}{26!} × n$$ where n is just the number of monkies and then solve?

The first part is right, but the second part is wrong (although not an absolutely terrible estimate.)

Basically, when you do the trial $n$ times, the value you computed is the expected number of occurrences of HAMLET.

This is a case where using the negative probability is better. The probability that you do not get HAMLET from one monkey is:

$$1-\frac{20!\times 21}{26!}$$

So the probability that you don't get HAMLET from $n$ monkeys is:

$$\left(1-\frac{20!\times 21}{26!}\right)^n$$

So the probability that you got at least one HAMLET from $n$ monkeys is:

$$1-\left(1-\frac{20!\times 21}{26!}\right)^n$$

Solve for that $\geq 0.90$.

I get $n\geq 18175684.7\dots$.

Your approach would give you $n=7104240$ which is off by a factor of approximately $2.5$.

• Awesome, and thanks for breaking down the thought process – dc3rd May 26 '15 at 0:22