How are first digits of $\pi$ found?

Since Pi or $\pi$ is an irrational number, its digits do not repeat. And there is no way to actually find out the digits of $\pi$ ($\frac{22}{7}$ is just a rough estimate but it's not accurate). I am talking about accurate digits by either multiplication or division or any other operation on numbers.

Then how are the first digits of $\pi$ found -

3.1415926535897932384626433832795028841971693993...

In fact, more than 100,000 digits of $\pi$ are found (sources - 100,000 digits of $\pi$)

How is that possible? If these digits of $\pi$ are found, then it must be possible to compute $\pi$ with some operations. (I am aware of breaking of circle into infinite pieces method but that doesn't give accurate results.)

How are these digits of $\pi$ found accurately? Can it be possible for a square root of some number to be equal to $\pi$?

• and yes, the square root of $\pi^2$ is $\pi$. Feb 15, 2015 at 4:31
• According to Wikipedia, we actually know the first 13.3 trillion digits of $\pi$ - much more than just the first $100,000$. I have no idea what use anyone has for so many digits, but... Feb 15, 2015 at 4:54
• You may be interested with the set of computable real numbers these include all algebraic numbers (numbers that are roots of finite polynomials with rational coefficients) as well as $e$ and $\pi$ and many more trascendental numbers. However their cardinality is the same as $\mathbb{N}$, which means that almost all numbers are, actually, uncomputable. Feb 15, 2015 at 7:53
• There's a tremendous difference in the claims "there is no way to compute all digits of $\pi$" and "there is no way to compute the first $n$ digits of $\pi$", where $n$ is some (possibly very large) positive integer. The first claim is true, the second is not.
– Mico
Feb 15, 2015 at 18:52
• Consider using the long division algorithm on $1/3$. You'll never end up with an infinite string of $0.333...$, but you have a method for calculating any finite $n$ digits of $1/3$ Feb 16, 2015 at 13:47

9 Answers

Clearly there is a way to calculate digits of $$\pi$$, as you gave a lengthy decimal expansion. Just because the digits do not repeat, does not mean it is impossible to calculate.

Here's one way you can try at home: Draw a large circle centered at the origin with radius $$r$$ on a lattice grid, inscribed in a square with side length $$2r$$. The ratio of integer coordinate points interior to the circle compared to the bounding box's area of $$4r^2$$ will approximate $$\pi/4$$. As you increase the radius and points considered, this will give you better approximations to the area of the circle, although the counting becomes inefficient for large values.

The Ancient Greeks used a similar idea to bound a circle's area but with many-sided polygons. Later on, mathematicians devised much more efficient methods to calculate dozens, then hundreds, then millions, etc. of digits.

What you are probably confused about is the notion that there is no discernable pattern in the digits of $$\pi$$. We can calculate further digits, but there is no easy way other than doing a bunch of calculations. Also, looking at millions of digits, the sequence of digits resemble uniformly randomly selected digits in statistical measures. For example, the digits $$0$$ through $$9$$ appear at approximately the same proportion. Unfortunately, we currently have no rigorous proofs about such statistics, such as the so-called "normal number" property of digit distribution.

• To be fair Aryan did not create this assumption. Innumerable popularizers take the vaguely meaningful view that "there's no discernible pattern to the digits of pi" and turn it into the falsehood "there is no rule for the digits of pi." Feb 15, 2015 at 13:08
• @ColinMcLarty Misinterpreting "irrational" for "impossible to understand or predict". The term is, honestly, the math popularizers' equivalent of conspiracy fuel.
– zxq9
Feb 16, 2015 at 6:18

One way the ancient mathematicians used was to compute the perimeter of a regular $n$-gon inscribed in a circle of diameter $1$. If one finds a formula for the perimeter of the inscribed $n$-gon, one has a sequence converging to $\pi$, i.e. for any accuracy you require there exist an $n$ such that this formula is accurate enough. This is not very practical though. In reality these ancient mathematicians such as Zu Chongzhi used iterative methods to compute the first digits of $\pi$.

From a more modern perspective, in analysis one seldom defines $\pi$ as the ratio of the circumference of the circle to its diameter. Here is one way: Let $\exp:\mathbb{C}\to \mathbb{C}$ be a function that satisfies $\exp(x+y)=\exp(x)\exp(y)$ and the derivative at $0$ being $1$. Then one can prove that such a function is unique and is realized by the function $\exp(z)=\displaystyle\sum_{n=0}^\infty \frac{z^n}{n!}$. One then defines $\sin(z)=\displaystyle\frac{\exp(iz)-\exp(-iz)}{2i}$. Consider its restriction on $\mathbb{R}$, then $\pi$ is defined as the smallest positive real number $x$ such that $sin(x)=0$. Then we immediately have very strong tools to compute $\pi$.

• I think you meant ratio of circumference to diameter. Feb 15, 2015 at 21:40
• And - to the point of the question -- you can determine (using inscribed and outscribed circles of the n-gon) that pi falls within certain accurately known limits, and therefore you can know some number of digits for certain. Feb 16, 2015 at 20:49

That a number is irrational means only that it cannot be computed merely by dividing one integer by another. Square roots of integers that are not perfect squares are irrational, but they can be computed by other methods that are just a little more complicated than long division. (These methods come down to addition, subtraction, multiplication, division, and sometimes a limited number of trial-and-error steps.)

Methods of computing the digits of irrational numbers simply find some computable quantity that is known to be very close to the true value of the desired number. If you have a formula that is known to be within the bounds $x \pm 0.0005$, for example, you merely need compute the value of that formula to enough places that you can accurately round it to the nearest 0.001, and then you know for sure the first three digits of $x$ to the right of the decimal point. To compute the first $100,000$ digits of $\pi$ requires you to evaluate a formula known to be within the bounds $\pi \pm (0.5\times10^{-100000}).$ This is difficult but not impossible.

• "Square roots that are not integers are irrational" Counter: $\sqrt{.25}$ is not an integer, but is rational. Did you mean "Square roots that are not rational are irrational"? Feb 15, 2015 at 19:36
• @ColeJohnson Good point, I was thinking of square roots of integers. I have updated the answer to say so. (Your way also would work.) Feb 15, 2015 at 19:39
• "square roots that are not rational are irrational" is a result that generalises to things other than square roots, as well... Feb 15, 2015 at 22:30
• To be pedantic about actually 'knowing' decimal digits - in general - if you know $x$ is within bounds $x_0 \pm 0.0005$, you may know the first 3 decimal places of $x$ if you are very lucky, but probably you know the first two. If $x_0$ happens to be 3.1999 then you don't even know the first decimal place. Feb 16, 2015 at 20:57
• @greggo Technically you're right; what I have described is really "$x$ accurate to $n$ decimal digits," which is not always the same as the first $n$ decimal digits of $x$: $\pi \approx 3.1416$, accurate to four digits past the decimal. Feb 16, 2015 at 21:48

And there is no way to actually find out the digits of Pi by either multiplication or division or any other operation on numbers.

You're missing some key words there: Pi cannot be found out by any finite number of operations. Pi is typically computed through an infinite series of operations that is known to converge on the actual value. The earliest known series was the perimeter of n-gons; various other series have been found that are easier to compute or converge faster, of which I believe the Chudnovsky series is currently the fastest.

• Importantly, John Machin's formula on that website "other series" that you linked to can be used by any amateur with a modern computer, a little bit of programming knowledge, and some patience, to calculate the first million digits of pi. Feb 15, 2015 at 9:45
• It's almost important to note that after X operations, the first Y digits are guaranteed to be correct. Feb 15, 2015 at 13:29

Use any formula for $\pi$ and implement it numerically. An example is $$\pi=4\arctan 1=4\int_0^1{dx\over 1+x^2}\doteq{4\over N}\left({3\over4}+\sum_{k=1}^{N-1}{1\over 1+(k/N)^2}\right)=:p_N\ .$$ Here we have approximated the integral by a trapezoidal sum. Doing the calculations one finds, e.g., $p_{100}=3.14157598692313$.

If you want millions of decimal digits for $\pi$ you of course have to resort to much deeper facts about $\pi$, which then will lead to faster convergence.

• $\arctan 1 = \arctan(1/2) + \arctan(1/3)$ by an angle addition formula, not anything particularly deep. The series for $\arctan(1/2)$ and $\arctan(1/3)$ both converge linearly. Feb 16, 2015 at 19:14

In the 18th century, Leonard Euler discovered an elegant formula:

$$\frac{π^4}{90}=\frac{1}{1^4}+\frac{1}{2^4}+\frac{1}{3^4}+\frac{1}{4^4}+\frac{1}{5^4}+\frac{1}{6^4}+\dots$$

The more terms you add, the more accurate the calculation of $π$ gets.

$$\frac{π^4}{90}=\frac{1}{1^4}=1.000$$

then $π=3.080$

$$\frac{π^4}{90}=\frac{1}{1^4}+\frac{1}{2^4}=1.0625$$

then $π=3.080$

$$\frac{π^4}{90}=\frac{1}{1^4}+\frac{1}{2^4}+\frac{1}{3^4}=1.0748$$

then $π=3.136$

$$\frac{π^4}{90}=\frac{1}{1^4}+\frac{1}{2^4}+\frac{1}{3^4}+\frac{1}{4^4}=1.0788$$

then $π=3.139$ $$\frac{π^4}{90}=\frac{1}{1^4}+\frac{1}{2^4}+\frac{1}{3^4}+\frac{1}{4^4}+\frac{1}{5^4}=1.0804$$

then $π=3.140$

etc

This is a slow way to calculate them, since after the 100th term, $π$ is $3.141592$, but it calculates them nontheless.

• This answer clearly shows that the more terms you add, the smaller the difference is going to be compared to the difference between the answer with 2 terms less and with 1 term less. Since with each term the divisor gets bigger. So simply put, the first digits are found by doing enough terms that any further terms will be too small a difference to influence the first digits. Feb 17, 2015 at 9:18

I am aware of breaking of circle into infinite pieces method but that doesn't give accurate results

Says who? You, of course, can't break a circle into infinite pieces, but if you break it into a sufficiently large finite number of pieces, you will get some number of accurate digits.

For another example, doing the taylor series for $4 \cdot \arctan(1)$:

$4 \cdot \left ( 1 - \frac 1 3 + \frac 1 5 - \frac 1 7 + \cdots \right )$

You have to do thousands of terms for each decimal digit (for terms i=9997 and 9999 I got ~3.1418 and ~3.1414 respectively), but since it converges you can be confident that the digits which have stopped changing "have been calculated".

• "digits which have stopped changing" is not a meaningful idea. An error estimate is needed, and when it falls below a predetermined threshold then, depending on the approximation at that stage, you are guaranteed to know pi to a certain number of digits.
– KCd
Feb 16, 2015 at 13:59
• A specific method here is to calculate upper and lower limits based on the incircle and outcircle. Whatever digits the two have in common, are good digits and won't change for larger polygons. This is essentially equivalent to what @KCd said but adding a specific way to get error bounds. The method is due to Archimedes. Feb 16, 2015 at 21:05

One interesting property of $\pi$ is this (though it is very hard to prove):
\begin{align} 4>&\pi\\ &\pi>4-\frac43\\ 4-\frac43+\frac45>&\pi\\ &\pi>4-\frac43+\frac45-\frac47\\ \end{align} etc.

Theoretically, you can use this to get $\pi$ to any number of digits. However, you need to add up hundreds of terms just to prove that $3.14<\pi<3.15$ (or, what is the same, that the first three digits of pi are $3.14$).

• ($\pi$ is actually the only number that satisfies that infinite system of inequalities. That's because the bounds get closer and closer together.) Feb 16, 2015 at 7:52

Can it be possible for a square root of some number to be equal to π?

We have the following series for $\pi^2$

$$\pi^2=10-\sum_{k=0}^\infty\frac{1}{((k+1)(k+2))^3}=10-\frac{1}{8}-\frac{1}{216}-\frac{1}{1728}-\frac{1}{8000}-\frac{1}{27000}-...$$

Therefore, we can compute $\pi$ to the desired accuracy as the square root of a fraction.

$$\pi \approx \sqrt{10-\sum_{k=0}^m\frac{1}{((k+1)(k+2))^3}}$$