* * *

In my recent talk at Gresham College, I demonstrated a computer simulation of Buffon's Needle - a Monte Carlo method of finding an approximation to

*π*. The idea is that if one tosses a needle of length*l*onto a floor made up of planks of width*t*(with*l*<*t*for simplicity), then the probability that the needle crosses a junction of two planks is 2*l*/*tπ*. So if we toss*n*coins and*m*of them cross the junctions, then 2*ln*/*tm*will give us an approximate value for*π*. By choosing suitable values of*l*and*t*, or*n*, and by being slightly lucky or by not stopping until you have the answer you want, you can get the approximation 355/113 by this method (in my lecture I got this value by tossing only two needles!), which demonstrates the power of the method if you know the answer in advance and use that information to full advantage in conducting the experiment.
If I choose numbers which are less designed to give me the answer I want. I find I can get

*π*to reasonable accuracy - I just simulated 10,000,000 needles and got a result around 3.1488. Since one is essentially sampling, statistical theory can give estimates for the likely proportion of tosses that will cross a line and hence for the accuracy I can expect. But, it occurred to me, why bother tossing ten million computer-simulated needles? Why not just calculate the expected value?
There's a good reason. Suppose the probability that a random needle crosses a junction is

*p.*(In my lecture, where I chose*l*to be 710*and**t*to be 903 - notice the relationships to 355 and 113! - I have*p*almost exactly 1/2.) Then the probability of*m*"hits" out of*n*tosses can be calculated by the binomial formula. In particular, the probability that*m*is zero is (1-*p*)^*n*. So for ten million tosses, I have a (finite) probability of (1-p)^10,000,000 that no needle crosses a line. In that case, 2*ln*/*tm*is infinite. If at least one needle crosses a line, then the value of 2*ln*/*tm*is finite. So when I calculated the expected value of 2*ln*/*tm*from ten million tosses, the result is infinite and the expected value of my approximation to*π*is infinity. Which is some way out.
I have though more than once that a nice project would be to construct a Buffon's needle site - where people can upload their number of successes s from a total number of trials N (or just fix n=100) for the case where l=t, and then the site 'real-time' gives the current estimate of pi, and historical graph....

ReplyDeleteYes, that's a lovely idea. Someone should do it! I don;t have the web development skills.

DeleteSadly my computer simulation programme a value of pi to generate a random angle, which is a little circular.