
π Toothpicks
Suppose you have a floor made of parallel strips of wood of width D as shown below. If you randomly drop a toothpick of length L on the floor, what is the probability that it lies across a line separating two adjacent strips? This is the so-called Buffon’s needle problem, named after the 18th century mathematician who first posed it. He was able to prove that the probability p of a toothpick of length L < D lying on two adjacent strips of wood is:
It follows that if you drop a toothpick of length L = D/2 on the floor, the probability of intersection is equal to 1/π. We therefore expect that if we were to drop a large number of toothpicks, the fraction of the total number of toothpicks that intersect lines should converge on 1/π! Inverting this fraction gives us a way to calculate π. Try it out below to see for yourself; pay attention to the total number of toothpicks N, and the total number that intersect lines Nᵢ. The ratio N/Nᵢ should (very slowly) converge on π as N gets larger and larger.
Methods such as this that rely on random sampling to obtain numerical results are known as Monte Carlo methods, and this is far from the only one that can be used to compute π. Stay tuned for more!