# How do you determine how many digits of pi are necessary?

It is said that you only need to calculate pi to 62 decimal places, in order to calculate the circumference of the observable universe, from its diameter, to within one Planck length.

Most of us are probably dealing with more terrestrial things. Automobile tires, for example. And we can usually tolerate more sloppy calculations. Say, to within one micrometer.

Given a specified scale and/or desired precision, how can we figure out how many digits of pi we really need?

Using $\Delta$ for errors and usual notation otherwise for the circumference of a circle,

$$\Delta C = 2 R \Delta\pi + 2\pi\Delta R$$

If you want $\Delta C$ within some error margin, you usually have to worry first about minimizing measurement error for the radius $\Delta R$. But if that is no longer a constraint, then worry about $\Delta \pi$.

For example, suppose your target error $\Delta C = 1 \ \mu m$ but you can only measure $R$ within one $\mu m$. Then your error for $C$ is $2\pi \ \mu m$ before we even consider $\Delta \pi$. If you could measure $R$ within say $1/10 \ \mu m$, then we can begin to worry about solving for the required number the digits for $\Delta\pi$:

$$\text{ Target value of } \Delta \pi \leq \frac{\Delta C - 2\pi\Delta R}{2R}$$ a quantity that is now positive and meaningful. Suppose in our example that $R = 1 \ m$, then $\Delta \pi \leq 1.86 \times 10^{-7}$ and thus we would want $\pi$ accurate to at least $7$ decimal places.

• How did you get the first equation. Is this equation is obtained by a derivative? – hlapointe Oct 21 '15 at 1:17
• Yes, it's a total differential. There are also other versions of error measurement, but this is a useful place to start. – Simon S Oct 21 '15 at 1:19
• Can you explain the total differential or give a link who explain it, because I really don't remember it. – hlapointe Oct 21 '15 at 1:23
• If $y = f(x_1,x_2, \cdots, x_n)$ then $$dy = \frac{\partial f}{\partial x_1} \, dx_1 + \frac{\partial f}{\partial x_2} \, dx_2 + \cdots + \frac{\partial f}{\partial x_n} \, dx_n$$ – Simon S Oct 21 '15 at 1:24
• Yes, with $C = 2\pi R$, $\partial C/\partial \pi = 2R$, $\partial C/\partial R = 2\pi$ and thus $$dC = 2R\,d\pi + 2\pi\,dR$$ – Simon S Oct 21 '15 at 1:26

Suppose you have an approximation $\pi_n$ of $\pi$ to $n$ decimal places. Then $\pi_n < \pi < \pi_n + 10^{-n}$ (These inequalities are strict as $\pi$ is not rational). Then you can do whatever you would do to $\pi$ to this inequality instead and then solve for $n$ when you know how big an error you can have.

If you know the radius (or diameter but lets focus on radius) to a certain accuracy $r\pm\delta r$ and want the circumference to be $c\pm\delta c$ then the worse cases will be covered by: $$2(r-\delta r)\pi_1=c+\delta c$$ and $$2(r+\delta r)\pi_2=c-\delta c$$ where $\pi_1$ and $\pi_2$ are suitable approximations to $\pi$. Rewriting these gives: $$\pi\pm\delta \pi=\frac{c\pm\delta c}{2(r\mp\delta r)}$$ $$\pi\pm\delta \pi=\frac{c(1\pm\frac{\delta c}{c})}{2r(1\mp\frac{\delta r}{r})}$$ $$\pi\pm\delta \pi=\pi\times\frac{1\pm\frac{\delta c}{c}}{1\mp\frac{\delta r}{r}}$$ $$1\pm\frac{\delta \pi}{\pi} = \frac{1\pm\frac{\delta c}{c}}{1\mp\frac{\delta r}{r}}$$ *The plus error will be larger than the minus error.

Um, that depends on the amount of accuracy you need. That's usually expressed as "significant digits". If you need accuracy within .01% = 0.0001 margin of error, that is "four significant digits". Everything, not just pi, can be estimated to four significant digits so it suffices to just use the first four digits of pi. If you need higher accuracy you use more digits.

• This is more or less just re-stating the question. I'm looking for a formula or process by which, given a known scale and desired level of accuracy, I can determine how many digits of pi I need. Of course you add more digits for higher accuracy, but the question here is about how to know when you're using more digits than you really need. – Iszi Oct 21 '15 at 16:49