You Can Count on Pi

On Pi Day we answer the burning question: Is there any world in which pi does not go on forever?
Animation: Jacqui VanLiew

For geeks, there are several great holidays on the calendar. There is of course Mole Day (10/23) to commemorate Avogadro's number, which is huge (on the order of 1023) and hugely important in physics. There's e Day (2/7) for Euler's ubiquitous number (e = 2.718…). But the best is Pi Day, held on March 14 because the infinitely long decimal approximation of pi begins with 3.14. There's so much to say about pi—I've been writing Pi Day posts for 14 years. (Here's a partial list).

What is pi (or as the Greeks would say, π)? By definition, it's the ratio of the circumference to the diameter of a circle. It's not obvious why that should be special, but pi shows up in a bunch of cool places that seem to have nothing to do with circles. But one of the weirdest things about pi is that it's an irrational number. That means it's a value that can't be expressed as a fraction of two integers. Oh, sure. The number 22/7 (22 ÷ 7) is a fair approximation, but it's not pi.

But wait a second. When we say pi is irrational, all we're really saying is that it's irrational in the system of numbers we use, which is the base-10, or decimal, system. But there's nothing inevitable about that system. As you probably know, computers use a base-2, or binary, number system. Base-10 was probably chosen in the analog era because we have 10 fingers to count on. (Fun fact: The Latin root of digit is digitus, which means “finger.”)

So could there be a number system in which pi is rational? The answer is yes.

Wait, What’s a Number System?

Let's review how a number system works. Imagine you're a bean counter back in Neanderthal times. For each successive bean, you write down a different symbol on the wall of your cave. For 200 beans, you need 200 symbols. It's mind-numbing, and so you call them “numbers.”

One day you meet a clever Homo sapiens who says, “You're working too hard!” They have a new system with just 10 symbols, written as 0 to 9, which can represent any quantity of beans. Once you reach 9, you just move over one spot to the left and start again, where each digit is now a multiple of 10. After that it's multiples of 100, and so on in successively higher powers of 10.

Take the number 214: We have 2 hundreds, 1 ten, and 4 ones. We can write what this really means as the following:

Illustration: Rhett Allain

(Remember, any number raised to the power of 0 is 1.) What about place values smaller than 1? Those are just powers of 10 with negative exponents: 10-1 = 1/10th. Let's use part of the number pi as an example: 3.14. That really means the following:

Illustration: Rhett Allain

The only problem with this base-10 system is that when you divide the circumference of a circle by the diameter, you have to keep moving to the right forever, because there's always a remainder: 3.141592653589793238…

Anyway, you know all this; you've been using base-10 numbers all your life. So let's see how we can use these same ideas with other number systems.

Binary Numbers

Maybe your only experience with binary is from Star Wars, when Uncle Owen asks C3P0 if he understands the binary language of moisture vaporators. (Of course, C3P0 knows all the languages and is eager to oblige.) But you should know about binary too. Not only is it used in all your computing devices, there are also some good math jokes that you can tell. (Keep reading.)

The basic idea is that binary uses just two numbers (0 and 1) instead of 10 numbers. Perhaps the best way to really get a feel for binary is to take a number in base-2 and convert it to base-10. Suppose we have the number 1010. What does this mean? Just like with base-10, each place represents 2 raised to a power.

Illustration: Rhett Allain

See, it's just like base-10, but different. What if we want to convert a base-10 number, say 22, to binary? We can follow a simple recipe. We start by dividing 22 by 2, which gives us a quotient of 11. There's no remainder, so 0 is the first digit in our binary number (20 place). Now we divide 11 by 2, which gives us 5 with a remainder of 1. Boom—our next digit is 1 (21 place). Just keep doing this until your division gives you zero. Here's what that looks like:

Illustration: Rhett Allain

So 22 is written as 10110 in binary. OK, but what about a base-10 number with decimal places? These would just be base-2 place values with negative exponents. We can find the binary values using a similar recipe, but instead of dividing by 2, this time we multiply by 2.

Let's try this with 0.43. Multiply by 2 and you get 0.86. Instead of keeping the remainder, I'm going to keep the number in front of the decimal point—that's a 0. This will be my 2-1 place value. Next, I'll multiply the number by 2 again to get 1.72. The value in front of the decimal point is 1, so I get 1 x 2-2. Since I used the 1, I'm going to take it away and move forward with just the number 0.72. Keep repeating this process until you get bored. It looks like this.

Illustration: Rhett Allain

This gives a binary value of 0.01101. Of course, it doesn't stop there. We could keep on going with smaller and smaller place values. It's similar to converting the base-10 fraction of 1/3 to the base-10 decimal of 0.333... But at least we can convert numbers from base-10 to base-2.

Now for a joke. It goes like this: “There are 10 kinds of people in the world, those who understand binary and those who don't.” Get it? The 10 is a TWO in binary. Maybe it's not that funny.

Pi in Binary

Just for fun, let's convert a decimal approximation of pi, 3.1415, into binary. We'll need both of those processes above. First, we can convert 3 (base-10) into 11 (base-2) by dividing by 2 twice. Second, we can look at the fractional part. Using the rules above, 0.1415 converts to 0.0010001. So, that approximation of pi is 11.0010001.

It would be fun to put that on a T-shirt and see how many people recognize it as pi. I bet there would be some nerds out there. But of course, it's still just an approximation—pi is irrational in base-2 just like it is in base-10—and just about every other base that you try.

Pi as a Rational Number

So is there any number base in which pi is not an irrational number? Well, what about base-pi? Wait! Is that even possible? Of course it's possible, this is just math—we can do whatever we want. So, what would a base-pi number system look like? It would just be digits where each place is a power of pi. Like this:

Illustration: Rhett Allain

How about some examples? In base-pi, the number 1 is just pi0 which is also 1 in base-10. What about the base-pi number 10? That's (1 x pi1)+ (0 x pi0) or just pi. That's cool. Right? What about converting 10 in base-10 to base-pi? You would use the same idea as going to binary, but it would be little bit more complicated. However, in base-pi that number would be 100.01022122221… Oh, it goes on forever. Isn't that fun? We'd no longer be able to count our fingers accurately.

Here's another one. Since 3.14 isn't actually the value of pi, what about converting this number to base-pi? You would get 3.0110130010112... I think it's an irrational number in base-pi. So, the date of Pi Day isn't a rational number in the pi system. Does that mean it's irrational to celebrate Pi Day on March 14? Maybe, but we love pi, and love isn't always rational.