Thursday, 9 August 2007

Of monkeys and typewriters

The concept of the monkeys and the typewriters is a famous one. If you have an infinite number of monkeys and an infinite number of typewriters, any work you care to mention (often cited as being the complete works of Shakespeare, you could also have all the Harry Potter books, my PhD thesis and your GCSE English coursework) will but spouted out. Well, supposedly anyway.

So why? The argument is that if you stick a monkey in front of a typewriter, it will either write a pointless blog whingeing about why it's okay for adults to like Harry Potter or it will start hitting keys at random (it is assumed the monkey doesn't run off or hide in Chris Griffin's closet) , thus we have a random variable. Now, supposing the complete works of Shakespeare contain k characters, there are 27^{k} possible combinations of letters plus the space bar (that is not including numbers, "tab" and other such keys), and so the probability that one monkey, after tapping k keys, has typed up shakespeare is < 1/(27)^k, which is very,very small. The point is though, that it's still more than 0, so it can happen. We call this probability p.

Now, the probability that the monkey will not type shakespeare is 1-p, which is less than 1. The probability that 2 monkeys don't type shakespeare is (1-p)^2 and so on. Thus, if M is some huge number, the probability that M monkeys don't type Shakespeare is (1-p)^M which, for large enough M, will be tiny, since (1-p)<1. style="font-style: italic;">almost surely.

Why almost surely? Surely 1 means that it is certain? No, sadly not, but it would make everyone's lives (well... my life) that bit easier. If something is certain, it will have probability 1 ( eg 2 is an even number), but if something has probability 1, it is not necessarily certain. Analogously, we say that something having probabilty 0 is not necessarily impossible.

An example then: it's easier to show that something of probability zero is not necessarily impossible, so I will do that.

Suppose I am throwing darts at a picture of JK Rowling on a dartboard. Now, there are an infinite number of points on the dartboard (don't believe me? try and count them), and we suppose that the dart lands anywhere in the dartboard. Where does the exact centre of the tip of the dart land? On any point, we assume with equal probabilty. Thus, the probability that it lands on any particular point is 1/infinity which is so ludicrously tiny that we define it to be zero. But the tip of the dart has to land somewhere.. So the probability of it landing in the exact centre is zero, but it is still possible... (and thus the probability that it will not land on a particular point is 1, but it can still land on it)

So what's the point of all this? Well, assuming I haven't confused you and you're still reading, the point here is that maths probably isn't as clear cut as you think it is, and that's why you get gibbons like me who decide they want to help advance it further. It's fascinating, is it not?

Andrew (aka Monkey 7854778434783274387547876947547033234...)

Addendum: I read this somewhere, lampooning wikipedia:

"The stuff about monkeys and typewriters is rubbish. If you have a million monkeys and a million typewriters, they can't even make an encyclopedia"

1 comment:

L said...

It's obviously ridiculous. There isn't really any way they could type a sentence, maybe even a word.

http://www.ted.com/index.php/talks/view/id/67