Buffon's Needle
In 1733, Georges-Louis Leclerc, Comte de Buffon, posed a question: if you drop a needle onto a floor made of parallel strips of wood, what is the probability that the needle will cross a line between two strips? The answer reveals a beautiful connection between random geometry and the number $\pi$.
The Mathematics
If the needle has length $l$ and the distance between parallel lines is $d$, with $l \le d$, the probability $P$ that the needle crosses a line is given by:
By randomly dropping $N$ needles and counting the number of crossings $C$, we can approximate this probability as $C/N$. Rearranging the equation allows us to estimate $\pi$:
Convergence
This is a classic Monte Carlo method. As the number of needles $N$ increases, the estimated value of $\pi$ converges to the true value. Watch the state readout to see the approximation improve over time.