Find pi today simply by tossing coins

find-pi-today-simply-by-tossing-coins

Find pi today simply by tossing coins

Celebrate Pi Day and learn how this number appears in math and science on our special Pi Day page.

Take something circular, like a cup, measure the distance around the circle and divide it by the distance across the widest part. What you will get is a pretty good estimate of the irrational number pi (3.14159…). But you can also find pi in a series of random coin tosses or in a collection of needles thrown on a wooden floor. Sometimes the reason pi appears in randomly generated values ​​is obvious: if there are circles or angles involved, pi is your guy. But sometimes the circle is cleverly hidden, and sometimes the reason pi appears is a mathematical mystery!

To celebrate Pi Day this year, here are three ways to estimate pi using chance that you can try at home. The latest, using sweepstakes, is brand new: released just in time for Pi Day.


On supporting science journalism

If you enjoy this article, please consider supporting our award-winning journalism by subscribe. By purchasing a subscription, you are helping to ensure the future of impactful stories about the discoveries and ideas shaping our world today.


1. Circle within a square

Perhaps the simplest way to estimate pi randomly works like this: take a square of side 2 and place a circle of radius 1 inside it so that it just touches the edges of the square. Then randomly generate points on the square. As you add more and more random points, the proportion of points that end up in the circle will get closer to p4—the ratio between the area of ​​the circle (pi) and the area of ​​the square (4).

The incidence of pi here is not surprising – it comes directly from the formula for the area of ​​a circle – but the method is a classic example of Monte Carlo simulation, in which random data is used to approximate an exact calculation.

The graph shows how a unit circle with radius 1 inside a 2 x 2 square containing 500 randomly generated points can be used to estimate the value of pi.

Amanda Montánez

2. Buffon noodles

Suppose I drop a bunch of needles on a hardwood floor with lines spaced a needle length apart. How many needles can I expect to cross the lines? This question was first asked by Georges-Louis Leclerc, Comte de Buffon (or Comte de Buffon) in 1733, and the answer is 2p (about 23).

To find out why, we need to think about a more general question: What if our needle was not a straight line but a squiggle, a square, or some other shape traced by a line?

This expanded version of the problem is sometimes called “Buffon’s noodles” because noodles come in many more shapes than needles. It turns out that no matter what shape the needle is bent, we can still expect it to cross the same number of lines on average. The expected value of the number of lines crossed is proportional to the length of the needle. In other words, we can expect a collection of needles of length n (of any shape) to cross n times more rows than the same number of needles of length 1.

So to find the answer to Buffon’s question, you just need to choose a clever shape for your needles. This is where circles come in. If you have lines one unit apart and a needle bent into a circle of diameter 1, it will always cross the lines exactly twice. The length of the needle making up the circle is pi, and so the probability that a needle of length 1 crosses a line will be the expected value of the number of times the circle crosses – 2 – divided by the length of the circular needle, which gives us 2p.

Amanda Montánez

3. Flip coins

Take a coin and flip it. Save heads or tails. Repeat until you have one more heads than tails and record the proportion of heads to the total number of flips. For example, if your first roll was heads, stop immediately and record 1. If you flip heads, heads, tails, tails, tails, stop and record ⅗. The expected value of your result, or the average of all your trials if you have done infinitely, is p4. The more trials you average together, the closer you get to p4.

This new method of estimating pi using coin toss was presented by University of Massachusetts Lowell mathematician James Propp in a preprint published online at ArXiv.org last month, just in time for Pi Day! While the math behind the method isn’t new, the idea of ​​using it to estimate pi with coin flips is.

So why do we get p4? The unsatisfactory answer is that somewhere in the probability calculus there exists an infinite sum that corresponds to the values ​​of the arcsin function, a trigonometric function closely related to pi. But mathematicians haven’t found a significant link between coin tossing and pi. “Sometimes something really fundamental applies to two completely disconnected branches of mathematics,” says Propp. “That’s one of the joys of mathematics, but in many ways it’s a mystery.”

Amanda Montánez

Stefan Gerhold, a mathematician at the Technical University of Vienna, observed a very similar resultwhich he released as a preprint on arXiv.org in 2025. Instead of flipping a coin until you have more heads than tails, Gerhold and his co-author thought about families having children and stopping when they had one more boy than a girl. “It’s very mysterious,” says Gerhold. “I don’t think there’s a right way to understand this [in this scenario] the expectation will involve pi.

None of these methods are particularly practical for estimating the value of pi. To get Pi to the precision of 3.14, Propp estimates it may take up to a trillion coin flips. This is partly because coin toss sequences can become very long before tails exceeds tails, so much so that the expected value of the length of a sequence is infinity! On top of that, you can’t throw all the coins at once in the same way you can drop needles: the order of heads and tails matters. That’s why Propp suggests trying it in a classroom setting, where many students can run sequences of plays simultaneously.

Jennifer Wilson, a mathematician at the New School who uses similar probability models to analyze voting methods, finds the result satisfactory. “It’s good because it’s definitely something you can try with any group of students, and all you need is some calculus training to understand it.”

On your own, you could flip coins for a while to get an accurate pi reading. And even the other two methods might require about a million random stitches or needle drops to get 3.14, but you might have better luck. This Pi Day, consider joining the tradition of finding the value of pi in extremely inefficient ways.

It’s time to defend science

If you enjoyed this article, I would like to ask for your support. Scientific American has been defending science and industry for 180 years, and we are currently experiencing perhaps the most critical moment in these two centuries of history.

I was a Scientific American subscriber since the age of 12, and it helped shape the way I see the world. SciAm always educates and delights me, and inspires a sense of respect for our vast and beautiful universe. I hope this is the case for you too.

If you subscribe to Scientific Americanyou help ensure our coverage centers on meaningful research and discoveries; that we have the resources to account for decisions that threaten laboratories across the United States; and that we support budding and working scientists at a time when the value of science itself too often goes unrecognized.

In exchange, you receive essential information, captivating podcastsbrilliant infographics, newsletters not to be missedunmissable videos, stimulating gamesand the best writings and reports from the scientific world. You can even give someone a subscription.

There has never been a more important time for us to stand up and show why science matters. I hope you will support us in this mission.

Exit mobile version