# 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:** 16
**Page:** 4

<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 8, 2010, 6:51pm UTC](https://boards.straightdope.com/t/what-is-the-formula-for-pi/531566/61 "2010-03-08T18:51:29Z")

</div>

> [@](#):
>
> On a (curious) side note, what is the worst way of calculating pi ? In other words, what is the pi-converging series that converges the slowest towards it ?

I saw a method once that relied on pi cropping up in a statistical context (it might have been the Monte Carlo circle area, but I seem to recall it being more complicated than that), so if you took (for instance) a bunch of random digits, you could use those digits to produce an estimate of pi. The brainstorm idea that turns this from a merely bad method to a spectacularly pessimal method is to use the digits of pi themselves as the source of your random numbers. IIRC, the person doing this started with a file of the first million digits of pi as an input, and was able from that to determine a value of pi accurate to 3 digits (3.14).

---

<div class="post-metadata">

### Author: ![Pleonast](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/pleonast/32/1183_2.png) [@Pleonast](https://boards.straightdope.com/u/Pleonast)
#### Post date: [March 8, 2010, 6:58pm UTC](https://boards.straightdope.com/t/what-is-the-formula-for-pi/531566/62 "2010-03-08T18:58:22Z")

</div>

> [@Chronos](#):
>
> I saw a method once that relied on pi cropping up in a statistical context (it might have been the Monte Carlo circle area, but I seem to recall it being more complicated than that), so if you took (for instance) a bunch of random digits, you could use those digits to produce an estimate of pi. The brainstorm idea that turns this from a merely bad method to a spectacularly pessimal method is to use the digits of pi themselves as the source of your random numbers. IIRC, the person doing this started with a file of the first million digits of pi as an input, and was able from that to determine a value of pi accurate to 3 digits (3.14).

:smack: Is there a term for the opposite of “boot-strap process”?

---

<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 8, 2010, 7:02pm UTC](https://boards.straightdope.com/t/what-is-the-formula-for-pi/531566/63 "2010-03-08T19:02:36Z")

</div>

> [@Chronos](#):
>
> I saw a method once that relied on pi cropping up in a statistical context (it might have been the Monte Carlo circle area, but I seem to recall it being more complicated than that), so if you took (for instance) a bunch of random digits, you could use those digits to produce an estimate of pi. The brainstorm idea that turns this from a merely bad method to a spectacularly pessimal method is to use the digits of pi themselves as the source of your random numbers. IIRC, the person doing this started with a file of the first million digits of pi as an input, and was able from that to determine a value of pi accurate to 3 digits (3.14).

I’ve seen something similar on my current Computer Algebra course: a method for finding increasingly narrow bounds for p which, unless I’m missing something, actually relies on the _correct_ value of p to compute those bounds. :smack:

---

<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 8, 2010, 8:52pm UTC](https://boards.straightdope.com/t/what-is-the-formula-for-pi/531566/64 "2010-03-08T20:52:26Z")

</div>

Refining and refining towards the nicest possible proof, the last step of post [#51](http://boards.straightdope.com/sdmb/showpost.php?p=12199575&postcount=51) can be simplified. To wit, derive arctan(1) - (-1)[sup]n[/sup] times the integral from 0 to 1 of u[sup]2n[/sup]/(1 + u[sup]2[/sup]) = 1 - 1/3 + 1/5 - … + (-1)[sup]n-1[/sup]/(2n - 1) just as before. Then observe that this already establishes that the partial sums of the series 1/1 - 1/3 + 1/5 - 1/7 + … alternate between being above and being below arctan(1). This means the deviation at any point is bounded by the next term, and thus, as the terms clearly approach 0, we can conclude that the series itself approaches arctan(1), as desired.

---

<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 8, 2010, 8:59pm UTC](https://boards.straightdope.com/t/what-is-the-formula-for-pi/531566/65 "2010-03-08T20:59:19Z")

</div>

> [@SGT42](#):
>
> The series 1 - 1/x + 1/x^3 - 1/x^5 + … represents arctan x. If you replace x by 1 you have the series for the arc whose tangent is 1 (pi/4). Multiply it by 4 and you have the series for pi.

> [@KarlGauss](#):
>
> I know this will sound snarky\*, but please see posts #14, 31, 41, 42, 50, and 51.

Actually, if you look closely, you’ll see that **SGT42** said something a little different from what everyone else has said. Unfortunately, this is not to **SGT42** ’s advantage… 🙂

---

<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 9, 2010, 12:20am UTC](https://boards.straightdope.com/t/what-is-the-formula-for-pi/531566/66 "2010-03-09T00:20:45Z")

</div>

> [@Indistinguishable](#):
>
> Actually, if you look closely, you’ll see that **SGT42** said something a little different from what everyone else has said. Unfortunately, this is not to **SGT42** ’s advantage… 🙂

Good point! 😃

Maybe he was listening to [this guy](http://rds.yahoo.com/_ylt=A0geu.amkpVLXAwBzztXNyoA;_ylu=X3oDMTB0bHQ5NmJ0BHNlYwNzYwRjb2xvA2FjMgR2dGlkA0Y2NjZfMTEw/SIG=11o33ickg/EXP=1268180006/**http%3a//new.music.yahoo.com/arcangel/) when he posted? Mind you, we spell his name differently here in Canada (you know, like centre instead of center).

---

<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 9, 2010, 1:27am UTC](https://boards.straightdope.com/t/what-is-the-formula-for-pi/531566/67 "2010-03-09T01:27:18Z")

</div>

Is there a way to reformulate the polygonal method of solving for Pi into calculus terms? And how quickly does that method converge on Pi?

---

<div class="post-metadata">

### Author: ![Ruminator](https://avatars.discourse-cdn.com/v4/letter/r/b9bd4f/32.png) [@Ruminator](https://boards.straightdope.com/u/Ruminator)
#### Post date: [March 9, 2010, 1:45am UTC](https://boards.straightdope.com/t/what-is-the-formula-for-pi/531566/68 "2010-03-09T01:45:52Z")

</div>

> [@Indistinguishable](#):
>
> Perhaps you misunderstand what is being done with the calculus in post #14? It demonstrates why arctan(1) = 1 - 1/3 + 1/5 - 1/7 + … . arctan(1) is the number of radians in the (principal) angle which produces a tangent of 1; i.e., the number of radians in half of a quarter of a full revolution.

I believe this is glossed over easily because there’s not a diagram of a unit circle to make this obvious. Proofs explained purely as text are not as intuitive.

---

<div class="post-metadata">

### Author: ![Ruminator](https://avatars.discourse-cdn.com/v4/letter/r/b9bd4f/32.png) [@Ruminator](https://boards.straightdope.com/u/Ruminator)
#### Post date: [March 9, 2010, 1:48am UTC](https://boards.straightdope.com/t/what-is-the-formula-for-pi/531566/69 "2010-03-09T01:48:09Z")

</div>

> [@CurtC](#):
>
> When you’re doing advanced math, the number pi falls out of equations all over the place. Most people at this level don’t think of pi as something as crude as the ratio of a circle’s circumference to its diameter; it’s a universal number that you come across constantly, of which one of its uses is in figuring the circumference of a circle.

Yes, this is a good point.

Wolfram has several examples of pi. More than the wikipedia page about pi.

> **[Representations of Pi - Wolfram|Alpha](https://www.wolframalpha.com/input/?i=Representations%2Bof%2BPi)**
>
> Wolfram|Alpha brings expert-level knowledge and capabilities to the broadest possible range of people—spanning all professions and education levels.

---

<div class="post-metadata">

### Author: ![AWB](https://avatars.discourse-cdn.com/v4/letter/a/bb73d2/32.png) [@AWB](https://boards.straightdope.com/u/AWB)
#### Post date: [March 14, 2010, 12:49pm UTC](https://boards.straightdope.com/t/what-is-the-formula-for-pi/531566/70 "2010-03-14T12:49:51Z")

</div>

> [@Chronos](#):
>
> **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.

Actually, this method works _perfectly_. It’s just superfluous, because any calculator with the function would have the constant.

---

<div class="post-metadata">

### Author: ![ricksummon](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/ricksummon/32/3333_2.png) [@ricksummon](https://boards.straightdope.com/u/ricksummon)
#### Post date: [March 14, 2010, 2:23pm UTC](https://boards.straightdope.com/t/what-is-the-formula-for-pi/531566/71 "2010-03-14T14:23:03Z")

</div>

Here’s the one thing I could never figure out. If you have a series that you know converges to pi, how can you calculate how many terms of that series you’ll need to get pi out to a specific number of decimal places?

---

<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 14, 2010, 4:19pm UTC](https://boards.straightdope.com/t/what-is-the-formula-for-pi/531566/72 "2010-03-14T16:19:04Z")

</div>

> [@ricksummon](#):
>
> Here’s the one thing I could never figure out. If you have a series that you know converges to pi, how can you calculate how many terms of that series you’ll need to get pi out to a specific number of decimal places?

You calculate it by doing the calculations. Each series converges at a different rate so there’s no overall way of knowing. I don’t believe that you can predict exactly how fast a new series will converge without actually running the numbers step and step.

This is true for all converging series, to my understanding.

---

<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 14, 2010, 6:43pm UTC](https://boards.straightdope.com/t/what-is-the-formula-for-pi/531566/73 "2010-03-14T18:43:54Z")

</div>

> [@](#):
>
> This is true for all converging series, to my understanding.

Certainly not true for all series. For instance, consider the Zeno series: 1/2 + 1/4 + 1/8 + 1/16 + … = 1. Every new term gives you exactly one more binary digit of accuracy.

I believe that for most series used in practice for calculating things like pi, that it is known precisely how fast it converges, but the method for determining that probably isn’t systematic (you’d need to figure it out for each series, and knowing how to figure it out for one won’t necessarily help you figure it out for another).

---

<div class="post-metadata">

### Author: ![Cheshire\_Human](https://avatars.discourse-cdn.com/v4/letter/c/5f8ce5/32.png) [@Cheshire\_Human](https://boards.straightdope.com/u/Cheshire_Human)
#### Post date: [March 14, 2010, 9:08pm UTC](https://boards.straightdope.com/t/what-is-the-formula-for-pi/531566/74 "2010-03-14T21:08:31Z")

</div>

> [@Covered\_In\_Bees](#):
>
> I hate it when I invent or discover something and it turns out someone invented/discovered it thousands of years before I did…

At least I did better than you. When I was majoring in undergrad chemistry, which required a couple of semesters of physics (I always used to sleep thru that one, because between my HS physics and my outside reading in relativity, et al., I aced the physics tests and labs without ever cracking the book), I realized that _ **this** _ from chemistry, combined with _ **that** _ from physics, implied _ **something else** _. After a few minutes of doing the calculus, I started to recognize the math I was coming up with and said “Aww, _[**expletive**]_! Stephen Hawking won the Nobel Prize in Physics a couple of decades back for the _ **something else** _!” I don’t remember exactly what the _ **this** _ or _ **that** _ were or what the _ **something else** _ it implied was, except that it had something to do with “Hawking Radiation”, which was how I started to recognize the math.

_I was beat by **2 orders** of magnitude **less** than you! **HA!** _

BTW, to be entirely fair, all thru elementary, high school, college, and outside reading, I was frequently beat by the same millenial level priority. It’s only the Hawking radiation one I was beat on by a mere ± 2 decades, although my invention of the electrical relay was only beaten by the difference between the dates of my 5th grade class, and the invention of the telegraph (1840’s?).

Ahh, the problems us 2+ standard deviations above the mean of the bell curve have to endure…😉

---

<div class="post-metadata">

### Author: ![Topologist](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/topologist/32/3208_2.png) [@Topologist](https://boards.straightdope.com/u/Topologist)
#### Post date: [March 14, 2010, 10:09pm UTC](https://boards.straightdope.com/t/what-is-the-formula-for-pi/531566/75 "2010-03-14T22:09:53Z")

</div>

> [@Exapno\_Mapcase](#):
>
> You calculate it by doing the calculations. Each series converges at a different rate so there’s no overall way of knowing. I don’t believe that you can predict exactly how fast a new series will converge without actually running the numbers step and step.
> 
> This is true for all converging series, to my understanding.

In practice this works, but in theory it doesn’t. Just because it appears that the first 5 digits have settled down, doesn’t guarantee that the next 100 terms won’t change them.

When you derive a series, you usually also derive an estimate for the error when you truncate the series at the nth term. (Note that you can’t have a practical formula for the exact error – if you had such a formula you wouldn’t need the series.) For example, for Taylor series there’s [Taylor’s theorem with remainder](http://en.wikipedia.org/wiki/Taylor%27s_theorem). The remainder is the truncation error, and Taylor’s theorem leads to bounds on the size of that remainder.

For example, for the [Gregory-Leibniz formula](http://en.wikipedia.org/wiki/Leibniz_formula_for_pi) that’s been discussed here, pi = 4(1 - 1/3 + 1/5 - 1/7 + …), the Wikipedia page gives a derivation of the estimate that the remainder on stopping at the nth term (i.e., 1/(2n+1)) is no more than 4/(2n+3). So, if you want to find pi to 5 decimal places, you want the error to be no more than 10[sup]-6[/sup] (yes, I know, that doesn’t quite guarantee it). To get 4/(2n+3) \< 10[sup]-6[/sup] you need n \> 2,000,000 (approximately). You can also see from this estimate that each digit takes 10 times as many terms to nail down as the preceding digit did.

---

<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 15, 2010, 12:36am UTC](https://boards.straightdope.com/t/what-is-the-formula-for-pi/531566/76 "2010-03-15T00:36:09Z")

</div>

> [@](#):
>
> At least I did better than you. When I was majoring in undergrad chemistry, which required a couple of semesters of physics (I always used to sleep thru that one, because between my HS physics and my outside reading in relativity, et al., I aced the physics tests and labs without ever cracking the book), I realized that this from chemistry, combined with that from physics, implied something else. After a few minutes of doing the calculus, I started to recognize the math I was coming up with and said “Aww, [expletive]! Stephen Hawking won the Nobel Prize in Physics a couple of decades back for the something else!” I don’t remember exactly what the this or that were or what the something else it implied was, except that it had something to do with “Hawking Radiation”, which was how I started to recognize the math.

First of all, Hawking has never won the Nobel Prize. Second, though, what you stumbled across was probably the thermodynamic derivation of Hawking radiation. To sum up, black holes must have entropy (and presumably a very high entropy), since they’re pretty much the ultimate when it comes to a “final state”. Second, everything with entropy must have a temperature. And third, everything with a temperature must radiate. To get actual numbers, you need a few more details, such as the fact that a black hole’s entropy is proportional to the surface area of the event horizon (which can be guessed from the fact that any accretion into a black hole, or collision between two black holes, will never decrease the event horizon area). And, of course, some of the things you read about black holes were written by people who already knew about Hawking radiation, and were likely inspired at least in part by it.

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