32

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$?

Robert Soupe
  • 14,268
  • 2
  • 27
  • 57
Confuse
  • 1,040
  • 8
  • 15
  • 1
    Related: http://math.stackexchange.com/questions/22777/calculate-pi-precisely-using-integrals , http://math.stackexchange.com/questions/188858/calculate-pi-to-an-accuracy-of-5-decimal-places –  Feb 15 '15 at 04:22
  • 45
    and yes, the square root of $\pi^2$ is $\pi$. – Ittay Weiss Feb 15 '15 at 04:31
  • 16
    According to [Wikipedia](http://en.wikipedia.org/wiki/Chronology_of_computation_of_%CF%80), 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... – Milo Brandt Feb 15 '15 at 04:54
  • 3
    You may be interested with the set of [computable real numbers](http://en.wikipedia.org/wiki/Computable_number) 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. – Bakuriu Feb 15 '15 at 07:53
  • $3$ is easy. Draw a circle, then without adjusting your compass, put the point on the circle, draw a mark on the circle, put the point on that mark, and continue all the way around the circle. – Jack M Feb 15 '15 at 13:19
  • 5
    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 '15 at 18:52
  • "I am aware of breaking of circle into infinite pieces method but that doesn't give accurate results" -- the deep magic of irrational, but very real, numbers. *No* method is precise, whether its with a stick and some string, breaking the circle, or computing exhaustively on a supercomputer. That's the very point of the term irrational. – zxq9 Feb 16 '15 at 06:16
  • 4
    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$ – Harrison Paine Feb 16 '15 at 13:47
  • @Mico Can we compute all digits of $\frac13$? I'm not sure that 'There's no way to compute all digits of $\pi$' isn't an essentially trivial statement. – Steven Stadnicki Feb 16 '15 at 23:47
  • @StevenStadnicki - I'm concerned you may have missed the point I was trying to make. What I was *trying* to say is that it's not at at all necessary to be able to compute *all* digits of an irrational number in order to compute some (possibly a very large number) of them. Anyway, $1/3$ is a rational number -- I'm afraid I may be missing the point (rebuttal? counter-example? concurring statement?) you're trying to make. – Mico Feb 17 '15 at 12:05
  • @Mico My point was somewhat akin to what I think Harrison's was: it's not clear to me that there's any difference between 'there is no way to compute all the digits of $\pi$' and 'there is no way to compute all the digits of $1/3$' - that is, we haven't really defined what it means to 'compute all the digits' of _any_ number, and almost any definition that doesn't make your statement vacuously true (that is, that no number can have all its digits computed) applies equally well to $1/3$ as to $\pi$. – Steven Stadnicki Feb 17 '15 at 16:21
  • @StevenStadnicki - Maybe we should be having this conversation with the OP rather than with each other? I had interpreted his/her posting as questioning whether it's possible to compute *any* digits of $\pi$ correctly given that not all digits are known. My interpretation, naturally, may not have been the one that the OP had in mind. – Mico Feb 18 '15 at 09:38
  • It's worth repeating that $\pi$ is a transcendental number, not an algebraic number. – Robert Soupe Feb 28 '15 at 05:18
  • @Meelo Due to the spigot algorithm, we know any digit of pi that we want to know. – DanielV Feb 28 '15 at 05:56

9 Answers9

45

You make the assumption there is no way to calculate the digits of $\pi$. That is untrue; there exist many formulas to calculate the digits of $\pi$ (with their own proofs of correctness). One of the simplest (though very slow) formulas is the Leibniz formula for $\pi$.

Robert Soupe
  • 14,268
  • 2
  • 27
  • 57
qwr
  • 9,834
  • 4
  • 38
  • 70
  • 9
    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." – Colin McLarty Feb 15 '15 at 13:08
  • 5
    @ColinMcLarty Misinterpreting "irrational" for "impossible to understand or predict". The term is, honestly, the math popularizers' equivalent of conspiracy fuel. – zxq9 Feb 16 '15 at 06:18
25

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$.

Qidi
  • 1,360
  • 9
  • 14
  • 2
    I think you meant ratio of circumference to diameter. – Faraz Masroor Feb 15 '15 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. – greggo Feb 16 '15 at 20:49
15

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.

Teoc
  • 8,522
  • 4
  • 22
  • 56
David K
  • 85,585
  • 7
  • 71
  • 188
  • _"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"? – Cole Tobin Feb 15 '15 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.) – David K Feb 15 '15 at 19:39
  • 4
    "square roots that are not rational are irrational" is a result that generalises to things other than square roots, as well... – Ben Millwood Feb 15 '15 at 22:30
  • 1
    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. – greggo Feb 16 '15 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. – David K Feb 16 '15 at 21:48
  • Yes, there really two valid meanings to that, and the one you use is common and used in several other answers. The gist of the question tends to point to the pendantic sense, in my view, so I wanted to insert that point somewhere. Especially since square roots were mentioned in the question - because if $a$ is expressible in finite precision, then it's fairly easy to find $ \sqrt a $ starting with the first digits and just working one's way down. So it's about why pi is different. – greggo Feb 16 '15 at 21:56
14

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.

Mark
  • 730
  • 1
  • 4
  • 12
  • 1
    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. – gnasher729 Feb 15 '15 at 09:45
  • 2
    It's almost important to note that after X operations, the first Y digits are guaranteed to be correct. – BlueRaja - Danny Pflughoeft Feb 15 '15 at 13:29
8

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.

Christian Blatter
  • 216,873
  • 13
  • 166
  • 425
  • $\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. – tmyklebu Feb 16 '15 at 19:14
8

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".

Random832
  • 493
  • 2
  • 10
  • 2
    "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 '15 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. – greggo Feb 16 '15 at 21:05
8

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.

Shevliaskovic
  • 1,019
  • 1
  • 13
  • 24
  • 2
    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. – asontu Feb 17 '15 at 09:18
6

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$).

Akiva Weinberger
  • 19,084
  • 1
  • 31
  • 84
  • 2
    ($\pi$ is actually the _only_ number that satisfies that infinite system of inequalities. That's because the bounds get closer and closer together.) – Akiva Weinberger Feb 16 '15 at 07:52
0

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}-...$$

(see https://math.stackexchange.com/a/1644137/134791)

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}}$$

Jaume Oliver Lafont
  • 4,924
  • 1
  • 21
  • 41