Can’t Wrap Your Head Around Pi? Here’s a Cool Visual to Help

Mar 14, 2025 7:00 AM

Pi is an irrational number, and like some irrational people it just goes on and on. What is it with this crazy, crucial number?

Photograph: Jeffrey Coolidge/Getty Images

Happy Pi Day! We celebrate pi on March 14 because 3-14 gives the first three digits of this famous number. But what’s the big deal about pi anyway? Why does it get a day? Well, for starters, it defines the simplest, most perfect shape, the circle. So it’s everywhere around you. Pi is the ratio of the circumference to the diameter of a circle: π = C/d.

No matter how big or small a circle is, that ratio is always the same. In decimal notation, it’s 3.141592653 … aaand you can run that out as far as you want, because it’s an irrational number, and it never, ever, ever ends.

What people do—in fact what calculators do if you press the π button—is choose a certain number of decimal places, depending on the precision required, and round off to that number. It’s not really pi, but you could say … it’s a piece of pi. (Sorry, but every Pi Day story needs a pi-pun.)

Irrational Is as Irrational Does

Being infinitely long doesn’t in itself make a number irrational. For example, say you have a rectangle that measures 4 by 11 meters. The ratio of the sides, 4/11, equals 0.36363636 … This number is also endless, but it follows a pattern. With irrational numbers, there’s no repetition.

The real distinction is that rational numbers can be written as a ratio of two integers. (Get it? ratio-nal.) And ratios are the same thing as fractions. So:

It’s also the case that any finite decimal number, no matter how long, can be expressed as the ratio of two integers. (Which is pretty mind-boggling all by itself.) Irrational numbers, on the other hand, can’t be expressed in fractional form.

Oh, you can try. For example, 22/7 is a pretty good approximation. But it’s not pi. (We could have celebrated Pi Day on July 22, since most of the world uses the day-month-year format for dates, and that would be 22-7.)

But maybe you’re not inclined to take my word for it. So here’s what I’m going to do: I’m going to use a brute-force algorithm I made in Python to generate all possible integer fractions and see if one of them equals pi.

No Pi in Python

What’s a brute-force method? It’s a way of solving a problem that doesn’t require cleverness, just a ton of work. My program starts with the fraction 1/1 and methodically ratchets it up by adding 1 to the numerator or the denominator. Here’s the recipe:

– Take the fraction (u/v) and compare to pi

– If u/v is less than pi, add one to the numerator (u+1)

– If u/v is greater than pi, add one to the denominator (v+1)

– If u/v is equal to pi, you win. You just proved that pi is rational.

So the series starts like this: 1/1, 2/1, 3/1, 4/1, 4/2, 5/2, 6/2, 7/2, 7/3, 8/3 … I mean, you could do this on paper, but you’d soon go mad. I ran my program to iterate 1,000 times. (If you want to see the code, here it is on Google Colab.) Then I plotted the decimal value for all 1,000 fractions (Since the horizontal axis goes from 1 to 1,000, I’m using a log scale to compress it.)

After 1,000 runs, I have a fraction of 760/242. This is a fine value for pi. It’s accurate to two decimal places—the standard 3.14, which is what a lot of people use anyway. But it’s not pi. Oh, well, how about 500,000 iterations?

This gives me a final fraction of:

This integer ratio is close—it matches pi up to the sixth decimal place—but it’s still not pi. OK, how about 10 million iterations? This gives an integer fraction of 7,585,471 over 2,414,531, which is off by only 0.00003 percent. But it’s still NOT PI.

So, what have we done here? Not much really. We didn’t prove that pi is irrational, but I think any rational person would be inclined to accept it at this point.

Picturing Irrationality

How about a visual demo? We can actually show that pi is irrational by swinging balls around in a circle. Here’s how it works: First we start with a single ball moving at a constant speed.

Now let’s add another ball on the end of that ball. It’s moving in a circle with the same radius, but at a speed that is 3.5 times faster. Not only does this create a cool pattern, but at some point the pattern will repeat. If you keep your eye on the starting point on the right side, you can see when the ball begins to retrace its path:

You could try any ratio of speeds that evaluates to a finite decimal number, like the 3.5 above. In other words, rational numbers! 3.5 can be expressed as an integer fraction: 7/2. Each one will give you a different pattern, but for all rational numbers the pattern will eventually repeat.

So what happens when you use an irrational number for the speed? In the one below, I have the second ball moving at π times the speed of the first one:

See? The pattern never repeats. It’s just like the never-ending series of digits in pi. It gets close, but it’s still off by a little bit—you can see the lines begin to thicken. In fact, I let it run for a long time and this is what I got:

Because you can’t write pi as a fraction of integers, the two circles will never sync back up. It’s a cool way to show that pi is irrational, but it’s also just fun to watch.

Leave a Reply

Your email address will not be published. Required fields are marked *