Buffon's Needle Simulation
Monte Carlo simulation to estimate π using geometric probability
Needles Dropped
0
Crossings
0
Crossing Probability
0
Estimated π
N/A
Buffon's Needle is a classic probability problem that can be used to estimate π. The experiment involves dropping needles of length L onto a surface with parallel lines spaced distance D apart.
The Formula: The probability that a needle crosses a line is P = (2L)/(πD). By measuring the actual crossing probability through simulation, we can estimate π ≈ (2L)/(PD).
Legend:
- ● Red needles cross lines
- ● Blue needles don't cross lines
The more needles you drop, the more accurate the π estimate becomes! This is an example of a Monte Carlo simulation.
What is Buffon's Needle problem?
Buffon's Needle is a classic probability problem posed by Georges-Louis Leclerc, Comte de Buffon in 1777. It asks: if you drop a needle of length L onto a floor with parallel lines spaced distance D apart, what is the probability that the needle will cross a line? The surprising answer involves pi: P = 2L/(pi*D) when L <= D.
How does Buffon's Needle estimate pi?
By rearranging the probability formula P = 2L/(pi*D), we get pi = 2L/(P*D). If we drop many needles and count how many cross lines, we can estimate P experimentally. Substituting this empirical probability into the formula gives an estimate of pi. More needle drops lead to more accurate estimates.
What is a Monte Carlo simulation?
A Monte Carlo simulation uses random sampling to obtain numerical results. In Buffon's Needle, we simulate randomly dropping needles by generating random positions and angles. By repeating this many times and counting outcomes, we can estimate probabilities and derive mathematical constants like pi.
Why does the estimate improve with more needle drops?
This is due to the Law of Large Numbers. As you perform more random trials, the experimental probability converges to the true theoretical probability. With few drops, random variation causes large errors. With thousands of drops, the estimate becomes quite accurate, typically within a few percent of pi's true value.