# Thread: Monkeys to write shakespear.

1. ## Monkeys to write shakespear.

I was curious about the actual amount of monkeys needed to produce something like hamlet, so I went and figured out how many letters there were: 194270
There are 26 letters in the alphabet so every possible combination of letter we can have in hamlet:

$\displaystyle 26(194270)=5051020$

This problem produces a binomial distribution, so the mean of the normal curve would
be 1 because:
$\displaystyle \mu=np=(5051020)(5051020)^{-1}$
$\displaystyle \sigma = \sqrt{npq}=\sqrt{1(0.999999802020186)}$
$\displaystyle P(X\geqslant 1)=1-P(X\leqslant 1})$
$\displaystyle 1-P(Z\leqslant \frac{1-1}{\sigma })$
$\displaystyle 1-P(Z\leqslant 0})=1-.5=.5$

Therefore, if we have 5051020 monkeys, the probability of one of them producing hamlet (asssuming each only gets one try, the typing of one monkey does not effect the typing of another, and the probability of each monkey geting hamlet is the same) is on average 50%.

Is this correct?

2. im not sure i follow your first line. If you let a monkey type 194270 random characters the number of combinations is $\displaystyle 26^{194270} \neq 26(194270)$

PS: what about punctuation and capitalisation?

3. Ha, never mind you would need 26^{194270} monkeys to have a 50% chance to write shakespeare...

4. Moving away from the hamlet problem, you are basically arguing that if:

$\displaystyle X \sim Bi(\frac{1}{p},p)$

then P(X>0) = 0.5
and hence
P(X=0) = 0.5

you can see this isn 't true by using $\displaystyle \frac{1}{p}$ that is small enough to fit in a calculator.

However it may be approximately true if $\displaystyle \frac{1}{p}$ gets sufficiently big (im not sure either way). i did check a pretty extreme case ($\displaystyle \frac{1}{p} = 1,000,000,000$) and the probability was still less than 0.4