The Buffon’s needle calculator gives the probability that a needle dropped on parallel lines crosses a line, the expected number of crossings, the standard deviation and the estimate of pi from the observed crossings, for a needle shorter or longer than the line spacing.
How the calculation works
- Enter the needle length and the spacing between the lines.
- Enter the number of throws and the crossings observed.
- Read the probability, the expected crossings and the estimate of pi.
Example
A needle of 3 cm on lines 4 cm apart crosses a line with a probability of 0.47746. In 1000 throws, 477.5 crossings are expected, with a standard deviation of 15.80. The 478 observed crossings are 0.03 standard deviations from the expected value and give pi ≈ 3.1381, an error of -0.11 %.
Why it matters
The calculator helps probability students and teachers who run the experiment in class with a needle or a stick, programmers who write Monte Carlo simulations, and curious people who want to see why a random experiment gives a value of pi and how many throws it takes for a good estimate.
Good to know
The estimate of pi only works when the needle is not longer than the spacing, otherwise the output is zero. The needle and lines must be in the same unit, and the needle must land with a random position and angle. The estimate improves slowly, since the error shrinks with the square root of the number of throws. A result very close to pi after few throws is luck, not skill. The expected crossings are an average, and a given experiment can differ by a few standard deviations.
Related tools
The probability calculator handles basic chances, the coin flip calculator treats repeated trials, the circle calculator gives the value of pi in context and the Stirling approximation calculator estimates factorials in large counts.