# What is the formula for "pi"?

**URL:** https://boards.straightdope.com/t/what-is-the-formula-for-pi/531566
**Category:** Factual Questions
**Created:** [March 7, 2010, 12:10am UTC](https://boards.straightdope.com/t/what-is-the-formula-for-pi/531566 "2010-03-07T00:10:49Z")
**Posts on this page:** 20
**Page:** 2

<div class="post-metadata">

### Author: ![Exapno\_Mapcase](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/exapno_mapcase/32/1051_2.png) [@Exapno\_Mapcase](https://boards.straightdope.com/u/Exapno_Mapcase)
#### Post date: [March 7, 2010, 4:33am UTC](https://boards.straightdope.com/t/what-is-the-formula-for-pi/531566/21 "2010-03-07T04:33:25Z")

</div>

> [@Derleth](#):
>
> **Exapno Mapcase** , isn’t it usually considered good form to answer questions before getting into the stupid jokes?

And the half dozen people who answered the question before I came in, what were they: chopped liver?

---

<div class="post-metadata">

### Author: ![septimus](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/septimus/32/410_2.png) [@septimus](https://boards.straightdope.com/u/septimus)
#### Post date: [March 7, 2010, 6:07am UTC](https://boards.straightdope.com/t/what-is-the-formula-for-pi/531566/22 "2010-03-07T06:07:43Z")

</div>

> [@Exapno\_Mapcase](#):
>
> Maybe because if the formula weren’t correct, wheels wouldn’t be round. :smack:

I thought this was _hilarious_ and was amazed at the complaints. Perhaps the :smack: caused confusion and a simple 😛 or 😃 would have been better. 😕

Aceplace57: “22/7 is what I used in applied math…”  
I’m curious: Is this experience from the pre-calculater era?

---

<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: [March 7, 2010, 6:21am UTC](https://boards.straightdope.com/t/what-is-the-formula-for-pi/531566/23 "2010-03-07T06:21:01Z")

</div>

> [@](#):
>
> This method is not particularly efficient, and it doesn’t tell you how many digits are correct and where the incorrect digits begin.

Actually, it does, since the partial sums alternate between being high and being low. So any digit that doesn’t change when you add the next term must be a good one.

**AWB** , your method doesn’t really work, since any calculator that has a tangent button will also have a pi button. To turn that into an actual method, you need to also give a method of calculating tan(x) without first knowing pi.

**Cabbage** , I’d say that the biggest thing your proof glosses over is the fact that that integral is in fact arctan. I’d worry about that a long time before I’d worry about the constant of integration.

---

<div class="post-metadata">

### Author: ![Little\_Nemo](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/little_nemo/32/3120_2.png) [@Little\_Nemo](https://boards.straightdope.com/u/Little_Nemo)
#### Post date: [March 7, 2010, 6:24am UTC](https://boards.straightdope.com/t/what-is-the-formula-for-pi/531566/24 "2010-03-07T06:24:58Z")

</div>

I unfortunately can’t remember the details but there’s a method of generating pi by physical means. Some mathematics professor was captured as a POW during the American Civil War. He had a needle. He drew a diagram and then randomly dropped the needle on the drawing. The ratio of the amount of times the needle hit a line to the amount of times it didn’t equalled pi with a large enough sample of drops. As I recall, the professor eventually did enough drops to verify pi’s value to five digits.

---

<div class="post-metadata">

### Author: ![Derleth](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@Derleth](https://boards.straightdope.com/u/Derleth)
#### Post date: [March 7, 2010, 6:36am UTC](https://boards.straightdope.com/t/what-is-the-formula-for-pi/531566/25 "2010-03-07T06:36:39Z")

</div>

> [@Exapno\_Mapcase](#):
>
> And the half dozen people who answered the question before I came in, what were they: chopped liver?

None of them were responsive to the specific question you picked out: How to _prove_ a specific formula evaluates to _pi_. The first proof was posted by **Cabbage** , although I’ll admit **friedo** satisfied it if your tolerance for handwaving is sufficiently high. 😉

---

<div class="post-metadata">

### Author: ![cmyk](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/cmyk/32/3353_2.png) [@cmyk](https://boards.straightdope.com/u/cmyk)
#### Post date: [March 7, 2010, 6:47am UTC](https://boards.straightdope.com/t/what-is-the-formula-for-pi/531566/26 "2010-03-07T06:47:14Z")

</div>

Calculate it? When do we get to eat it?!

Wow, that was bad.

---

<div class="post-metadata">

### Author: ![Snarky\_Kong](https://avatars.discourse-cdn.com/v4/letter/s/a183cd/32.png) [@Snarky\_Kong](https://boards.straightdope.com/u/Snarky_Kong)
#### Post date: [March 7, 2010, 7:53am UTC](https://boards.straightdope.com/t/what-is-the-formula-for-pi/531566/27 "2010-03-07T07:53:56Z")

</div>

> [@Little\_Nemo](#):
>
> I unfortunately can’t remember the details but there’s a method of generating pi by physical means. Some mathematics professor was captured as a POW during the American Civil War. He had a needle. He drew a diagram and then randomly dropped the needle on the drawing. The ratio of the amount of times the needle hit a line to the amount of times it didn’t equalled pi with a large enough sample of drops. As I recall, the professor eventually did enough drops to verify pi’s value to five digits.

Post #20.

---

<div class="post-metadata">

### Author: ![Malacandra](https://avatars.discourse-cdn.com/v4/letter/m/45deac/32.png) [@Malacandra](https://boards.straightdope.com/u/Malacandra)
#### Post date: [March 7, 2010, 7:55am UTC](https://boards.straightdope.com/t/what-is-the-formula-for-pi/531566/28 "2010-03-07T07:55:24Z")

</div>

> [@friedo](#):
>
> One way to calculate pi to an arbitrary precision is to calculate the following infinite series:
> 
> 4 - ( 4/3 ) + ( 4/5 ) - ( 4/7 ) + ( 4/9 ) - ( 4/11 ) …
> 
> Keep going and you get closer and closer to pi. This method is not particularly efficient, and it doesn’t tell you how many digits are correct and where the incorrect digits begin. There are methods for calculating a given digit of pi, but I don’t know them.

And in this case “not particularly efficient” means “a million terms later, you’re still faffing over the sixth decimal place”. Gregory’s Series converges _slooooooowly_.

---

<div class="post-metadata">

### Author: ![Malacandra](https://avatars.discourse-cdn.com/v4/letter/m/45deac/32.png) [@Malacandra](https://boards.straightdope.com/u/Malacandra)
#### Post date: [March 7, 2010, 8:01am UTC](https://boards.straightdope.com/t/what-is-the-formula-for-pi/531566/29 "2010-03-07T08:01:44Z")

</div>

Basically the same as the polygon method - for small angles sin x \< x \< tan x, where x is in radians. So take a small angle and average its sine and tan and you have the value of x in radians. Since there are 2p radians in 360 degrees, the rest is trivial. All you need then is a method of computing sin and tan of small angles without working in radians in the first place (otherwise you have a, aha, _circular_ argument, and you’re good to go. The smaller the angle, the better the accuracy.

---

<div class="post-metadata">

### Author: ![aceplace57](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/aceplace57/32/3500_2.png) [@aceplace57](https://boards.straightdope.com/u/aceplace57)
#### Post date: [March 7, 2010, 8:11am UTC](https://boards.straightdope.com/t/what-is-the-formula-for-pi/531566/30 "2010-03-07T08:11:25Z")

</div>

Early calculator days. We were still taught to use fractions until the final step. A lot of times 22/7 would factor out and not be an issue. Mixing fractions and decimals makes a mess. It’s much easier to use fractions until the final step.

> [@septimus](#):
>
> I thought this was _hilarious_ and was amazed at the complaints. Perhaps the :smack: caused confusion and a simple 😛 or 😃 would have been better. 😕
> 
> Aceplace57: “22/7 is what I used in applied math…”  
> I’m curious: Is this experience from the pre-calculater era?

---

<div class="post-metadata">

### Author: ![Didactylos](https://avatars.discourse-cdn.com/v4/letter/d/a183cd/32.png) [@Didactylos](https://boards.straightdope.com/u/Didactylos)
#### Post date: [March 7, 2010, 8:34am UTC](https://boards.straightdope.com/t/what-is-the-formula-for-pi/531566/31 "2010-03-07T08:34:06Z")

</div>

> [@friedo](#):
>
> 4 - ( 4/3 ) + ( 4/5 ) - ( 4/7 ) + ( 4/9 ) - ( 4/11 ) …

This is the oldest and simplest of several infinite series converging to pi.  
The problem is both that it converges very slowly (as friedo said), but also that the rounding error from adding and subtracting all these very similar numbers (… + (4/100003) - 4/(100005) + 4/(100007) - … ) will quickly accumulate and swamp whatever significant digits we should theoretically have obtained given the number of iterations.

Mathematicians through the ages have continuously developed more complicated series with better convergence.

[Wiki has more to say about it.](http://en.wikipedia.org/wiki/Numerical_approximations_of_%CF%80)

---

<div class="post-metadata">

### Author: ![KarlGauss](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/karlgauss/32/3713_2.png) [@KarlGauss](https://boards.straightdope.com/u/KarlGauss)
#### Post date: [March 7, 2010, 11:04am UTC](https://boards.straightdope.com/t/what-is-the-formula-for-pi/531566/32 "2010-03-07T11:04:27Z")

</div>

> [@Little\_Nemo](#):
>
> I unfortunately can’t remember the details but there’s a method of generating pi by physical means . . .

[Speaking of chopped liver](http://boards.straightdope.com/sdmb/showpost.php?p=12196448&postcount=20) . . .

---

<div class="post-metadata">

### Author: ![Hari\_Seldon](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/hari_seldon/32/5173_2.png) [@Hari\_Seldon](https://boards.straightdope.com/u/Hari_Seldon)
#### Post date: [March 7, 2010, 1:39pm UTC](https://boards.straightdope.com/t/what-is-the-formula-for-pi/531566/33 "2010-03-07T13:39:32Z")

</div>

What no one seems to have pointed out is that all these formulas rely on trigonometry which depends crucially on the fact that there can similar trinagles that are not the same size (that is, congruent). This pins the formulas down to euclidean geometry. In any non-euclidean geometry, there will not be a constant ratio between the diameter and circumference of a circle; the ratio will depend on the size of the circle.

Long before we get to the 100th decimal digit of pi, we will have a value that is not accurate due to relativistic (gravitational) effects. We don’t even know if the geometry of empty space would be euclidean if empty space could actually exist.

Another formula is to add the reciprocal of all the squares, multiply by 6 and take the square root. Or add the reciprocals of all the fourth powers, multiply by 90 and take the fourth root. There are similar formulas for every even integer. Almost nothing is know for odd integers, except that the sum of the reciprocals of the cubes is irrational.

---

<div class="post-metadata">

### Author: ![Shark\_Sandwich](https://avatars.discourse-cdn.com/v4/letter/s/f04885/32.png) [@Shark\_Sandwich](https://boards.straightdope.com/u/Shark_Sandwich)
#### Post date: [March 7, 2010, 2:57pm UTC](https://boards.straightdope.com/t/what-is-the-formula-for-pi/531566/34 "2010-03-07T14:57:54Z")

</div>

> [@cmyk](#):
>
> Calculate it? When do we get to eat it?!
> 
> Wow, that was bad.

Pi r round.

---

<div class="post-metadata">

### Author: ![Tim\_R.Mortiss](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/tim_r.mortiss/32/142_2.png) [@Tim\_R.Mortiss](https://boards.straightdope.com/u/Tim_R.Mortiss)
#### Post date: [March 7, 2010, 3:29pm UTC](https://boards.straightdope.com/t/what-is-the-formula-for-pi/531566/35 "2010-03-07T15:29:28Z")

</div>

I teach Monte Carlo analysis by citing a simple example: hypothesize a circle of radius 1 inscribed inside a square of 2x2. Then generate x,y pairs from a uniform distribution between -1 and +1. It is an easy test to determine if a pair is inside the circle; all will of course be inside the square.

The area of the circle will of course be Pi (Pi\*R^2, where R=1). The area of the square is of course 4. Dividing the number of points within the circle by the number of points within the square, and multiplying by 4, will give you an approximation to Pi. More points = better approximation.

Simpler than the Buffon method, IMHO.

By the way, I’ve had students (mostly from overseas) who use the 22/7 approximation (this in graduate-level engineering courses), all the while holding a high-powered calculator in their hands. I give them no end of hell for that…TRM

P.S. - cornbread r square.

---

<div class="post-metadata">

### Author: ![Sapo](https://avatars.discourse-cdn.com/v4/letter/s/ec9cab/32.png) [@Sapo](https://boards.straightdope.com/u/Sapo)
#### Post date: [March 7, 2010, 4:01pm UTC](https://boards.straightdope.com/t/what-is-the-formula-for-pi/531566/36 "2010-03-07T16:01:30Z")

</div>

> [@friedo](#):
>
> That’s exactly how Archimedes did it. (You are probably not as smart as he is, though, because it took you like 2500 years more than him to figure it out.)

That’s exactly how John Mace replied it. (You are probably not as smart as he is, though, because it took you like 25 minutes more than him to post it out.) 🙂

---

<div class="post-metadata">

### Author: ![Frylock](https://avatars.discourse-cdn.com/v4/letter/f/ce7236/32.png) [@Frylock](https://boards.straightdope.com/u/Frylock)
#### Post date: [March 7, 2010, 4:05pm UTC](https://boards.straightdope.com/t/what-is-the-formula-for-pi/531566/37 "2010-03-07T16:05:50Z")

</div>

> [@Hari\_Seldon](#):
>
> What no one seems to have pointed out is that all these formulas rely on trigonometry which depends crucially on the fact that there can similar trinagles that are not the same size (that is, congruent). This pins the formulas down to euclidean geometry. In any non-euclidean geometry, there will not be a constant ratio between the diameter and circumference of a circle; the ratio will depend on the size of the circle.
> 
> Long before we get to the 100th decimal digit of pi, we will have a value that is not accurate due to relativistic (gravitational) effects. We don’t even know if the geometry of empty space would be euclidean if empty space could actually exist.

Why should anyone have pointed any of the above out? What’s the relevance?

---

<div class="post-metadata">

### Author: ![KarlGauss](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/karlgauss/32/3713_2.png) [@KarlGauss](https://boards.straightdope.com/u/KarlGauss)
#### Post date: [March 7, 2010, 4:58pm UTC](https://boards.straightdope.com/t/what-is-the-formula-for-pi/531566/38 "2010-03-07T16:58:24Z")

</div>

I _think_ he means that pi will always be pi, but, in the real world, especially on large scales, the formulas we use that have pi in the them (e.g. A= pi\*r[sup]2[/sup]), may not work. I think.

---

<div class="post-metadata">

### Author: ![Lumpy](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/lumpy/32/446_2.png) [@Lumpy](https://boards.straightdope.com/u/Lumpy)
#### Post date: [March 7, 2010, 7:05pm UTC](https://boards.straightdope.com/t/what-is-the-formula-for-pi/531566/39 "2010-03-07T19:05:20Z")

</div>

Just to comment on what’s been posted:

The polygon method of determining Pi: as said this was used by Archimedes to approximate Pi (more precisely, it gave upper and lower bounds Pi had to be within). Since trigonometry hadn’t been devised yet, he was limited to a proof based on classic plane geometry. He started with a circle inscribed between large and small hexagons because one can calculate an exact ratio of a hexagon’s sides to it’s radius (both center to vertice and center to middle-of-side). It’s then possible with some work to derive the ratio of a hexagon’s sides to a twelve-gon of equal radius’s sides, then 24, then 48, etc. Archimedes calculated it out to a circle between two 96-gons before giving up.

The classic proof **Cabbage** cites, although inefficient, has the virtue of demonstrating that it does necessarily give Pi, by using a function that incorporates Pi and then showing that the series must be equal to it.

Also thanks to **Cabbage** , I now know I should have said Pi is transcendental, which is the correct term for the property I was thinking of. That and the thread about memorizing digits of Pi led me to learn what a floating-point number was. 🙂

---

<div class="post-metadata">

### Author: ![Indistinguishable](https://avatars.discourse-cdn.com/v4/letter/i/90ced4/32.png) [@Indistinguishable](https://boards.straightdope.com/u/Indistinguishable)
#### Post date: [March 7, 2010, 11:55pm UTC](https://boards.straightdope.com/t/what-is-the-formula-for-pi/531566/40 "2010-03-07T23:55:34Z")

</div>

> [@Polycarp](#):
>
> Pi = _c/d_, where _c_ is the circumference of a circle of diameter _d_. Bettr than that by formula you cannot do, since it’s an irrational (“transcendental”) number.

No, better than that you cannot do, because it’s the exactly correct answer. You can give plenty of formulas that output the exact value of pi; they just don’t happen to be formulas that output results in the form of a ratio of integers or a root of a polynomial with integer coefficients. But that’s ok; there’s nothing magical about specifying numbers in those particular forms.

(This also goes for **Lumpy** saying there’s no single operation that can give pi’s exact value. What’s an “operation”? Plenty of expressions evaluate to pi exactly (this is a trivial statement, but it’s still true); they just happen to be operations which are not merely rational functions or such things)

[Previous page](https://boards.straightdope.com/t/what-is-the-formula-for-pi/531566.md?page=1)

[Next page](https://boards.straightdope.com/t/what-is-the-formula-for-pi/531566.md?page=3)
