eureka
§ A53

Buffon's Needle: Estimating Pi with Geometry

Imagine you're playing a game: you have a handful of toothpicks, and you drop them onto a hardwood floor with evenly spaced floorboards. Most toothpicks will probably land entirely on a single board, but some might cross the cracks between the boards.

Back in 1733, a French mathematician named Georges-Louis Leclerc, Comte de Buffon, wondered exactly how often a needle (or a toothpick) would cross a line on a floor like this. This simple question turned out to have an incredible answer that connects randomness to $\pi$ (pi), the famous number that relates a circle's circumference to its diameter!

Setting Up the Game

Let's say each toothpick is $l$ inches long, and the lines on the floor are exactly $d$ inches apart. To keep things simple, let's assume the toothpick is shorter than or exactly equal to the distance between the lines ($l \le d$).

Buffon discovered through calculus that if you randomly drop a needle, the probability ($P$) that it crosses one of the lines is given by this neat little formula:

$$ P = \frac{2l}{\pi d} $$

Notice what showed up in the denominator? It’s $\pi$! Even though there are no circles anywhere in this setup—just straight needles and straight parallel lines—$\pi$ is hiding right there in the probability.

Calculating Pi by Throwing Needles

Because $\pi$ is in the equation, we can flip the math around to actually calculate $\pi$ just by dropping toothpicks and counting.

Let's say you throw a large number of needles, which we'll call $N$. After dropping them all, you count how many of them actually crossed a line, which we'll call $C$. The probability of crossing a line is roughly the number of crosses divided by the total number of drops ($C / N$).

By matching our counted probability ($C / N$) with Buffon's exact formula ($P = \frac{2l}{\pi d}$), we can rearrange the equation to solve for $\pi$:

$$ \pi \approx \frac{2l \cdot N}{d \cdot C} $$

For example, if the distance between the lines $d$ is exactly equal to the needle's length $l$, the equation simplifies even further to: $\pi \approx \frac{2 \cdot N}{C}$.

The Power of the Monte Carlo Method

This experiment is a perfect example of what mathematicians call a Monte Carlo method. Named after the famous casino in Monaco, Monte Carlo methods use randomness and repeated, large-scale simulations to solve complicated math problems.

Because this method relies on probability, throwing just 10 needles might give you a terrible estimate for $\pi$ (like 2.5 or 4.0). But because of the "Law of Large Numbers," if you drop 10,000 needles, your estimate will get very close to 3.14159...

Don't want to throw 10,000 actual toothpicks on your kitchen floor? You don't have to! Visit our interactive Buffon's Needle simulator and let your computer do the heavy lifting. Watch the value of $\pi$ converge right before your eyes!