This text is displayed if your browser does not support HTML5 Canvas.

Approximating Pi with Buffon's Needle
Drop a needle onto a flat horizontal plane that has a series of parallel lines drawn on it. The distance between the lines is twice the length of the needle. After the needle has fallen, check to see if it is crossing over one of the lines. Now drop another needle... and then another...and another... keeping track of how many needles cross a line.

If you divide the total number of needles dropped by the number of line-crossings, you may notice that the number starts to hover just above 3, as you drop more needles and test them. Yes, you guessed it. If you keep dropping needles and making this simple calculation, that number will start to approximate pi.

But don't get your hopes up: even after dropping many thousands of needles, we can only approximate pi to within a few digits. According to this web site, the Buffon's Needle experiment can only give us a few digits of precision. And the results are always different. But precision is not the point of this experiment. It's a new way of understanding pi. You can learn more about it at Data Genetics.



About the Animation
This is a simulation of 3D needles that fall with gravity and collide with a flat surface, using spring physics. The calculation to determine if a needle has crossed a line is done after the needle has settled (finished bouncing). This accounts for the delay in the numbers displayed at top.

The circle in the middle illustrates the proportion of the two numbers, expressed as diameter and (approximated) circumference.



About the Math
n - length of each needle
w - width between each line
d - number of needles dropped
c - number of dropped needles that cross a line

Each needle must be dropped so that both its position and its angle are random. n can be any value less than or equal to w. For many experiments, n = w, which results in the approximation of 2Pi. In this variation of the experiment, n = w / 2, and so the approximation of pi is simply d / c.



Created by Jeffrey Ventrella. Ventrella.com