We all know the story about the monkeys at the typewriter. That, if given enough time the monkey will bash out the works of Shakespeare. In fact this is known as “The Infinite Monkey Theorem”. The Bio teacher I work with at school was wondering how many times his name would appear before my name would appear. His name being “Colm” and mine “Stephen”. And how long it would take before his name would appear…. Let’s work it out.

Let us assume the typewriter has 50 keys. The probability the 4 key strokes would result in Colm (case insensitive) would be $\frac{1}{50^4}$ where as for Stephen it would be $\frac{1}{50^7}$. He said to take the monkey to be typing at two strokes per second. So this means we would have a $\frac{1}{50^4}$ probability of success for Colm in every 2 seconds (4 stokes). This is $\frac{1}{2 \times 50^4}$ probability of success per second. This is known as $\lambda$ in statistics and the expected wait time for success would be $\frac{1}{\lambda} = $ 145 days.

Now for Stephen, during a 3.5 second period of time (7 strokes) I would have a probability of $\frac{1}{50^7}$ of seeing my name. That means per second I would have a probability of $\frac{1}{3.5 \times 50^7}$ which gives me a time to wait of 86,700 years. Meaning that Colm would see his name 219,000 times before I would see mine once.

The longest name in the world is Kananinoheaokuuhomeopuukaimanaalohilo. Let us say he would like to know how many times his friend… “Jo” would see their name before he sees his. The answer… $5.38 \times 10^{60}$ times. A quick and easy formula for comparing names of length $n_1$ and $n_2$ would be $\frac{n_1 \times 50^{n_1}}{n_2 \times 50^{n_2}}$. Try it out :)