## Friday, November 15, 2013

### Buffon's Needle (and his Noodles)

It seems strange, but it is true: you can approximate $$\pi$$ by throwing needles on the floor.

Back in 1733 a French guy named Georges-Louis Leclerc, Comte de Buffon (i.e., "Count Buffon") posed a simple question: If you throw a needle down on a wood plank floor, what is the probability that the needle will cross a line between planks?

It turns out that the probability, if the needle is the same length as the width of the planks, is $$P=2/\pi\approx 0.63662$$. That means that if you throw said needle 100 times on the floor, you'd expect about 64 of them to be across a line; throwing 50 needles, like in the animation above, should give about 32 crossings.

This gives a way of approximating $$\pi$$: since $$\pi=2/P$$, throw a needle $$n$$ times on the floor and count the number of crossings $$c$$. This means that $$P\approx c/n$$, and so $\pi = 2/P \approx 2/(c/n)= 2n/c.$
In the above gif, we find $$\pi \approx 2\cdot 50/32 =3.125.$$ That is the best approximation we can arrive at with only 50 tosses. Makes you wonder if we rigged the animation. (We did, sort of. The needle tosses were done at random with Mathematica; we lucked out that we got 32 crossings when we were ready to make a .gif and chose to not change it.) Speaking of "rigging it," there is an interesting story in this, starting with the following generalization:

If the needle has length $$\ell$$ and the width of the planks is $$d$$, then $$P = 2\ell/(\pi d)$$ (where $$\ell\leq d$$). Turning this into an approximation for $$\pi$$ with $$n$$ tosses and $$c$$ crosses, we have $\pi \approx 2\ell n/(c d).$

Back in 1901, a mathematician named Mario Lazzarini published the results of his tossing a needle of length 2.5cm onto lines spaced 3cm apart. His claimed results are amazing: in his tosses of 2000, 3000 and 4000 needles, his reported number of crossings are within 1 of the optimal number. Also, on toss 3408, he reportedly had 1808 crossings, which gives the approximation $$\pi \approx 3.1415929$$, which is accurate up to the last "9." Most people find it hard to believe that 1) he actually tossed a needle 4000 times, 2) he did it in any way that was truly random (after all, people can hardly do anything randomly), and 3) his results were so close to "perfect." But his paper did get published, and maybe that earned him tenure at some institution of higher education.

Noodles

In 1969, J. F. Ramalay published in the American Mathematical Monthly an article entitled "Buffon's Noodle Problem," in which he generalizes the needle problem further. Instead of tossing needles of length $$\ell$$, he solved the problem of tossing "noodles" of length $$\ell$$ - that is, arbitrary curves with arc length $$\ell$$. Because arbitrary curves are ... curvy, one noodle can cross a line more than once. He found that the expected number of total crossings $$E$$ is $E = 2\ell/(\pi d),$ effectively the same formula found before (and here $$\ell$$ can be greater than $$d$$). The difference between "probability" $$P$$ and "expected number" $$E$$ is subtle yet significant, but here we treat them as the same. If $$P=.3$$ or $$E=.3$$, then in each case you'd expect about 30 crossings after 100 throws. In the traditional case of needles, that means 30 needles cross a line; with noodles, that means there are 30 crossings, likely from less than 30 noodles.

We demonstrate this with the following 2 gifs. In the first, we toss circles (donuts?) onto a floor where the circumference (arc length) of each circle is 1, the distance between lines.

Note how each circle, when it crosses a line, gives two crossings. (And we didn't rig this one to give ourselves the optimal 32 crossings.)

Below, we throw arbitrary curves onto our board. Each curve is color-coded by the number of crossings it gives: there is one curve that gives 3 and a couple that give 2.

Thanks to Stan Wagon of Macalester College; he coded a Wolfram Demonstration on the topic and we cribbed some of his code to make our curves and count the crossings.

Follow us on Twitter and we'll update you when a new post is up.