Math

How to Calculate Pi Using a Pump-Action Shotgun

Just in case.

Michael Byrne

Michael Byrne

​Image: Nick Hubbard/Flickr

​One of the neat things about the end of the year is having your face ​rubbed in all of the interesting stuff that got missed because, well, science is huge. This is one of those things, ​a paper released last spring describing how to calculate the value of pi using the distribution of buckshot fired from a shotgun. You know, just in case.

The idea's simple, but gets at pi's particular resistance to quantification: nature's ecstatic constant. It is, in the authors' words, a new perspective on calculating mathematical constants "using everyday tools." (Wait: shotgun = everyday tool?)

The technique uses what's known as importance sampling, which is a way of "encouraging" the production of important values from random samples. This is important in simulations, where we want some random event to happen a lot, but also happen naturally. It's a way of adding bias to random distributions.

This is important in Monte Carlo simulations, a method (or collection of methods) of using random sampling over a certain probability distribution to acquire deterministic numerical values, like that of pi. The shotgun example happens to be a pretty good way of explaining what that even means/what the Monte Carlo method is.

Take a square and trace a quarter circle through it, as above. Now, blast it with a shotgun (or scratter some sand on it or whatever; the shotgun's more of a sales ploy here), and add up all of the pellet holes (or grains, etc.) that are inside and outside of the quarter circle. Using those tallies and the fact that the ratio of the inside to the outside of the circle is pi/4, we can come up with a number for pi. See? We use randomness to give life to abstraction, which is a pretty neat thing to be able to do.

In the shotgun experiment, the researchers fired 200 shots, yielding 30857 total samples (holes). They then took a subset of all of those hoes (1000) and came up with an equation that could be used to calculate pi when applied to the remaining set of samples. They got 3.13, which is not bad for using a picture and a shotgun.