# Pi -- it sure gets around

**URL:** <https://boards.straightdope.com/t/pi-it-sure-gets-around/277611>\
**Category:** Factual Questions\
**Created:** [December 2, 2004, 1:26am UTC](https://boards.straightdope.com/t/pi-it-sure-gets-around/277611 "2004-12-02T01:26:56Z")\
**Posts on this page:** 14\
**Page:** 2

<div class="post-metadata">

**Author:** ![ultrafilter](https://avatars.discourse-cdn.com/v4/letter/u/3d9bf3/32.png) [@ultrafilter](https://boards.straightdope.com/u/ultrafilter)\
**Post date:** [December 2, 2004, 5:34pm UTC](https://boards.straightdope.com/t/pi-it-sure-gets-around/277611/21 "2004-12-02T17:34:53Z")

</div>

> [@DarrenS](#):
>
> What has the geometry of a cirlce got to do with pulling colored balls from a bag?

Not necessarily anything. Attempts to read deeper meanings into equations and theorems often lead to mystical claptrap.

---

<div class="post-metadata">

**Author:** ![ccwaterback](https://avatars.discourse-cdn.com/v4/letter/c/df705f/32.png) [@ccwaterback](https://boards.straightdope.com/u/ccwaterback)\
**Post date:** [December 2, 2004, 5:44pm UTC](https://boards.straightdope.com/t/pi-it-sure-gets-around/277611/22 "2004-12-02T17:44:04Z")

</div>

> [@ultrafilter](#):
>
> Not necessarily anything. Attempts to read deeper meanings into equations and theorems often lead to mystical claptrap.

I think the problem here is that the example comes from a discrete distribution, Normal distributions are continuous distributions.

---

<div class="post-metadata">

**Author:** ![ultrafilter](https://avatars.discourse-cdn.com/v4/letter/u/3d9bf3/32.png) [@ultrafilter](https://boards.straightdope.com/u/ultrafilter)\
**Post date:** [December 2, 2004, 5:47pm UTC](https://boards.straightdope.com/t/pi-it-sure-gets-around/277611/23 "2004-12-02T17:47:30Z")

</div>

What problem?

---

<div class="post-metadata">

**Author:** ![ccwaterback](https://avatars.discourse-cdn.com/v4/letter/c/df705f/32.png) [@ccwaterback](https://boards.straightdope.com/u/ccwaterback)\
**Post date:** [December 2, 2004, 6:06pm UTC](https://boards.straightdope.com/t/pi-it-sure-gets-around/277611/24 "2004-12-02T18:06:43Z")

</div>

From the OP: “What has the geometry of a cirlce got to do with pulling colored balls from a bag?”.

I’m not sure Pi has anything to do with the analysis of problems of this nature. Well, at least not to calculate simple probabilities of a discrete distribution.

---

<div class="post-metadata">

**Author:** ![CurtC](https://avatars.discourse-cdn.com/v4/letter/c/ce73a5/32.png) [@CurtC](https://boards.straightdope.com/u/CurtC)\
**Post date:** [December 2, 2004, 6:46pm UTC](https://boards.straightdope.com/t/pi-it-sure-gets-around/277611/25 "2004-12-02T18:46:23Z")

</div>

> [@Mathochist](#):
>
> It’s more important than ?..

You went to all that trouble to format your posts, but this character shows up as a question mark on my system (Win2K, Firefox).

---

<div class="post-metadata">

**Author:** ![suranyi](https://avatars.discourse-cdn.com/v4/letter/s/e36b37/32.png) [@suranyi](https://boards.straightdope.com/u/suranyi)\
**Post date:** [December 2, 2004, 8:09pm UTC](https://boards.straightdope.com/t/pi-it-sure-gets-around/277611/26 "2004-12-02T20:09:50Z")

</div>

> [@Chronos](#):
>
> I seem to recall, for instance, that given two large numbers, the probability that they will be relatively prime is 1/pi.

Actually, the probability that any two numbers picked at random, not necessarily large, are relatively prime is 6/(pi^2).

See this page for a cite:

[http://mathworld.wolfram.com/RelativelyPrime.html](http://mathworld.wolfram.com/RelativelyPrime.html)

That’s still one of the most remarkably unexpected appearances of pi, along with the fact that the sum of the reciprocals of the squares of the integers is (pi^2)/6.

Hey, those two values are reciprocals themselves! I wonder if there’s a connection.

Ed

---

<div class="post-metadata">

**Author:** ![ultrafilter](https://avatars.discourse-cdn.com/v4/letter/u/3d9bf3/32.png) [@ultrafilter](https://boards.straightdope.com/u/ultrafilter)\
**Post date:** [December 2, 2004, 8:14pm UTC](https://boards.straightdope.com/t/pi-it-sure-gets-around/277611/27 "2004-12-02T20:14:25Z")

</div>

What does “at random” mean in that context?

---

<div class="post-metadata">

**Author:** ![Cabbage](https://avatars.discourse-cdn.com/v4/letter/c/f07891/32.png) [@Cabbage](https://boards.straightdope.com/u/Cabbage)\
**Post date:** [December 2, 2004, 8:25pm UTC](https://boards.straightdope.com/t/pi-it-sure-gets-around/277611/28 "2004-12-02T20:25:25Z")

</div>

> [@ultrafilter](#):
>
> What does “at random” mean in that context?

I was about to ask the same thing. It’s meaningless to give the probability of two randomly picked integers being relatively prime if we don’t know what probability distribution on the integers is being used in the first place. I’m sure it’s probably an interesting result, but it’s kind of misleading when it’s so vaguely stated.

---

<div class="post-metadata">

**Author:** ![Chronos](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/chronos/32/134_2.png) [@Chronos](https://boards.straightdope.com/u/Chronos)\
**Post date:** [December 2, 2004, 8:45pm UTC](https://boards.straightdope.com/t/pi-it-sure-gets-around/277611/29 "2004-12-02T20:45:18Z")

</div>

I _think_ that what it means is that if you take an upper bound U and pick the numbers from a uniform distribution on [1,U], you can determine the probability P(U) that the numbers will be relatively prime, and that in the limit U --\> infinity, P(U) --\> 6/pi[sup]2[/sup] (of course, for any finite U, P(U) is rational). Amusingly, I once saw a numerical experiment which used the digits of pi themselves as the source of the “random” numbers, and thereby managed to use a million digits of pi to derive an estimate of pi accurate to three decimal places.

---

<div class="post-metadata">

**Author:** ![suranyi](https://avatars.discourse-cdn.com/v4/letter/s/e36b37/32.png) [@suranyi](https://boards.straightdope.com/u/suranyi)\
**Post date:** [December 2, 2004, 8:55pm UTC](https://boards.straightdope.com/t/pi-it-sure-gets-around/277611/30 "2004-12-02T20:55:13Z")

</div>

> [@ultrafilter](#):
>
> What does “at random” mean in that context?

Unfortunately, the mathworld page I cited doesn’t have any more information about this.

Ed

---

<div class="post-metadata">

**Author:** ![Cabbage](https://avatars.discourse-cdn.com/v4/letter/c/f07891/32.png) [@Cabbage](https://boards.straightdope.com/u/Cabbage)\
**Post date:** [December 2, 2004, 9:01pm UTC](https://boards.straightdope.com/t/pi-it-sure-gets-around/277611/31 "2004-12-02T21:01:17Z")

</div>

> [@Chronos](#):
>
> I _think_ that what it means is that if you take an upper bound U and pick the numbers from a uniform distribution on [1,U], you can determine the probability P(U) that the numbers will be relatively prime, and that in the limit U → infinity, P(U) → 6/pi[sup]2[/sup] (of course, for any finite U, P(U) is rational). Amusingly, I once saw a numerical experiment which used the digits of pi themselves as the source of the “random” numbers, and thereby managed to use a million digits of pi to derive an estimate of pi accurate to three decimal places.

That would be my guess as well. It’s a pretty natural way of doing it, but such a probability distribution wouldn’t atually satisfy the Kolmogorov probability axioms (it’s not countably additive).

---

<div class="post-metadata">

**Author:** ![Omphaloskeptic](https://avatars.discourse-cdn.com/v4/letter/o/bcef8e/32.png) [@Omphaloskeptic](https://boards.straightdope.com/u/Omphaloskeptic)\
**Post date:** [December 3, 2004, 2:39am UTC](https://boards.straightdope.com/t/pi-it-sure-gets-around/277611/32 "2004-12-03T02:39:38Z")

</div>

> [@Cabbage](#):
>
> > [@Chronos](#):
> >
> > I _think_ that what it means is that if you take an upper bound U and pick the numbers from a uniform distribution on [1,U], you can determine the probability P(U) that the numbers will be relatively prime, and that in the limit U → infinity, P(U) → 6/pi[sup]2[/sup] (of course, for any finite U, P(U) is rational). Amusingly, I once saw a numerical experiment which used the digits of pi themselves as the source of the “random” numbers, and thereby managed to use a million digits of pi to derive an estimate of pi accurate to three decimal places.
> 
> That would be my guess as well. It’s a pretty natural way of doing it, but such a probability distribution wouldn’t atually satisfy the Kolmogorov probability axioms (it’s not countably additive).

Are you saying that the limit of the uniform distribution on {1,…,U} (as U → infinity) is not a probability distribution? In that case, I agree, but the limit that’s being taken is not of the distribution but of the probability of relative primality of two numbers chosen according to that distribution. I don’t see anything problematic about that limit (except for the somewhat loose way it was originally given).

The result is basically just an interpretation of the identity  
6 / pi[sup]2[/sup] = [product over primes p](1 - 1/p[sup]2[/sup]),  
with each factor of (1 - 1/p[sup]2[/sup]) representing the probability that two “randomly chosen” numbers do not both contain a factor of p. This identity is in turn easily reducible to the more common identity  
pi[sup]2[/sup] / 6 = [sum over n]1/n[sup]2[/sup]  
already mentioned.

---

<div class="post-metadata">

**Author:** ![Mathochist](https://avatars.discourse-cdn.com/v4/letter/m/c89c15/32.png) [@Mathochist](https://boards.straightdope.com/u/Mathochist)\
**Post date:** [December 3, 2004, 3:17am UTC](https://boards.straightdope.com/t/pi-it-sure-gets-around/277611/33 "2004-12-03T03:17:38Z")

</div>

> [@CurtC](#):
>
> You went to all that trouble to format your posts, but this character shows up as a question mark on my system (Win2K, Firefox).

should be a Unicode “Greek small letter pi”.

---

<div class="post-metadata">

**Author:** ![suranyi](https://avatars.discourse-cdn.com/v4/letter/s/e36b37/32.png) [@suranyi](https://boards.straightdope.com/u/suranyi)\
**Post date:** [December 3, 2004, 7:20pm UTC](https://boards.straightdope.com/t/pi-it-sure-gets-around/277611/34 "2004-12-03T19:20:58Z")

</div>

I just found out about another place where pi makes an unexpected (at first glance) appearance:

The average number of ways in which a non-negative integer can be expressed as the sum of the squares of two integers is pi!

To be precise:

Let r(n) be the number of ways that n, a non-negative integer, can be expressed as the sum of squares of two integers. For example r(5) = 8, because

5 = (2^2) + (1^2) = (1^2)+(2^2)  
= (-2^2) + (1^2) = (1^2)+(-2^2)  
= (2^2) + (-1^2) = (-1^2)+(2^2)  
= (-2^2) + (-1^2) = (-1^2)+(-2^2)

Now let R(z) = r(0) + r(1) + . . . + r(z-1),

Then A(z), the average number of ways for the first z integers is:

A(z) = R(z)/z

I saw a proof yesterday that the limit of A(z) as z goes to infinity is pi.

When you realize that R(z) is equal to the number of lattice points inside a circle centered at the origin, with radius sqrt(z), the connection with pi starts to make sense.

Ed

[Previous page](https://boards.straightdope.com/t/pi-it-sure-gets-around/277611.md?page=1)
