Sunday 23 March 2014

A thought about Buffon's Needle

I am delighted that this blog will be hosting the April 2014 Carnival of Mathematics.  To find out more, see previous Carnivals, or suggest an article for inclusion, go to the Carnival of Mathematics page at the Aperiodical.  The Carnival will appear here soon after the deadline for submissions, which is 5 April.
* * *
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 2l/.  So if we toss n coins and m of them cross the junctions, then 2ln / 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, 2ln/tm is infinite. If at least one needle crosses a line, then the value of 2ln / tm is finite.  So when I calculated the expected value of 2ln / tm from ten million tosses, the result is infinite and the expected value of my approximation to π is infinity. Which is some way out.

2 comments:

  1. 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....

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

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

      Delete