Pi Day!

If you see Andrew Holmes today, wish him a happy Pi Day!  (He’s a fan of \pi (and pie)).

Those of you who were at Dr. Pitale’s Math Club talk learned many cool things.  We thought we’d share one in honor of Pi Day.

Question:  If you choose two positive integers at random, what is the probability that they will be relatively prime (i.e. only 1 will divide them both evenly)?

Answer: 6/\pi^2 \sim .6079.  So around 60%.

The good question is how does \pi show up in a question about relatively prime numbers?  Well, when you took Calc III and learned about series, you learned about the series

\sum_{n=1}^{\infty} \frac{1}{n^2}.

You probably even learned that this is a p-series with p=2, and that using the integral test it’s easy to see that it converges.

You might have even learned that it converges to \pi^2/6 (this was first shown by Euler, but Dr. Pitale told us that Euler only gets partial credit as his answer was right, but his proof was wrong!).  Notice that this number is the reciprocal of the probability from above.  How strange!

We won’t give the full explanation (ask Dr. Pitale for the details, or take his number theory class in the fall!), but let’s at least sketch how it goes:

Say you pick two positive integers at random: call them A and B.  We want to know the probability that they are relatively prime.

Well, they’re relatively prime if they have no common factors.  That is, if for each prime p, p does not divide both A and B.  What’s the probability of that?  It’s easier to compute the probability that p does divide both A and B first.

For example, if p=2, then both A and B have to be even numbers if 2 divides both of them.  The possibilities are: A is even/B is even, A is even/B is odd, A is odd/B is even, A is odd/B is even.  Only 1/4 of the possible outcomes gives both A and B divisible by p=2.

Similarily, if p=3, then 1/9 of the possible outcomes gives both A and B divisible by p=3.  In general, it’s not too hard to see that 1/p^2 is the fraction of possible outcomes where both A and B are divisible by p.

Therefore, 1-(1/p^2) = (1-p^{-2}) is the probability that A and B are not both divisible by p.

But the odds that A and B are both divisible by one prime is independent of whether they are both divisible by another prime.  The probability of independent events is the product of the probabilities of each individual event.  So the probability that A and B are relatively prime is equal to

\Pi_{p \text{ prime}} (1-p^{-2}).

Let’s consider the reciprocal of this number:

\frac{1}{\Pi_{p \text{ prime}} (1-(p^{-2}))} = \Pi_{p \text{ prime}} \left(\frac{1}{1-(p^{-2})} \right).

Now let r= p^{-2} = \frac{1}{p^2} < 1, so if we think about the geometric series

\sum_{n=0}^{\infty} r^n = \frac{1}{1-r}

we see we can substitute this geometric series into the above product to get

\Pi_{p \text{ prime}} (1+p^{-2} + (p^{-2})^2+ (p^{-2})^{3}+ \cdots).

Now, when you FOIL out this product, you should keep in mind that all but finitely many of the terms should be the 1 (That’s how infinite products are defined).    So what do you get when you multiple out?

By the Fundamental Theorem of Arithmetic every natural number can uniquely be written in this as a product of prime powers!  So on the one hand,

p_1^{a_1} p_2^{a_2}p_3 \cdots p_r^{a_r} = n

for some natural number n, and on the other hand, each natural number n appears exactly once as one of these products.

If you look carefully what happens when you FOIL it out, you see using the Fundamental Theorem of Arithmetic that you get exactly

1^{-2} + 2^{-2}+3^{-2}+4^{-2}+ 5^{-2} + \cdots

That is, you get exactly

\sum_{n=1}^{\infty} n^{-2} = \sum_{n=1}^{\infty} \frac{1}{n^2} .

Therefore, the reciprocal of the probability is exactly the p-series we started with!

It’s absolutely amazing that this well know series computes such a natural probability/number theory question.  And it has the bonus of having \pi showing up, too!

On the other hand, you could just enjoy this \pi video suggested by our own Dr. McCullough:

Or, you could just make some \pi pie.