Approximations for the mathematical constant pi in the history of mathematics reached an accuracy within 0.04% of the true value before the beginning of the Common Era. In Chinese mathematics, this was improved to approximations correct to what corresponds to about seven decimal digits by the 5th century.
Further progress was not made until the 14th century, when Madhava of Sangamagrama developed approximations correct to eleven and then thirteen digits. Jamshīd al-Kāshī achieved sixteen digits next. Early modern mathematicians reached an accuracy of 35 digits by the beginning of the 17th century (Ludolph van Ceulen), and 126 digits by the 19th century (Jurij Vega), surpassing the accuracy required for any conceivable application outside of pure mathematics.
The record of manual approximation of is held by William Shanks, who calculated 527 decimals correctly in 1853. Since the middle of the 20th century, the approximation of has been the task of electronic digital computers (for a comprehensive account, see Chronology of computation of ). On June 28, 2024, the current record was established by the StorageReview Lab team with Alexander Yee's y-cruncher with 202 trillion (2.02×) digits.[1]
The best known approximations to dating to before the Common Era were accurate to two decimal places; this was improved upon in Chinese mathematics in particular by the mid-first millennium, to an accuracy of seven decimal places. After this, no further progress was made until the late medieval period.
Some Egyptologists[2] have claimed that the ancient Egyptians used an approximation of as = 3.142857 (about 0.04% too high) from as early as the Old Kingdom.[3] This claim has been met with skepticism.[4] [5]
Babylonian mathematics usually approximated to 3, sufficient for the architectural projects of the time (notably also reflected in the description of Solomon's Temple in the Hebrew Bible).[6] The Babylonians were aware that this was an approximation, and one Old Babylonian mathematical tablet excavated near Susa in 1936 (dated to between the 19th and 17th centuries BCE) gives a better approximation of as = 3.125, about 0.528% below the exact value.[7] [8] [9] [10]
At about the same time, the Egyptian Rhind Mathematical Papyrus (dated to the Second Intermediate Period, c. 1600 BCE, although stated to be a copy of an older, Middle Kingdom text) implies an approximation of as ≈ 3.16 (accurate to 0.6 percent) by calculating the area of a circle via approximation with the octagon.[4] [11]
Astronomical calculations in the Shatapatha Brahmana (c. 6th century BCE) use a fractional approximation of .[12]
The Mahabharata (500 BCE – 300 CE) offers an approximation of 3, in the ratios offered in Bhishma Parva verses: 6.12.40–45.[13]
In the 3rd century BCE, Archimedes proved the sharp inequalities < < , by means of regular 96-gons (accuracies of 2·10−4 and 4·10−4, respectively).[14]
In the 2nd century CE, Ptolemy used the value, the first known approximation accurate to three decimal places (accuracy 2·10−5).[15] It is equal to
3+8/60+30/602,
The Chinese mathematician Liu Hui in 263 CE computed to between and by inscribing a 96-gon and 192-gon; the average of these two values is (accuracy 9·10−5).He also suggested that 3.14 was a good enough approximation for practical purposes. He has also frequently been credited with a later and more accurate result, π ≈ = 3.1416 (accuracy 2·10−6), although some scholars instead believe that this is due to the later (5th-century) Chinese mathematician Zu Chongzhi.[16] Zu Chongzhi is known to have computed to be between 3.1415926 and 3.1415927, which was correct to seven decimal places. He also gave two other approximations of : π ≈ and π ≈, which are not as accurate as his decimal result. The latter fraction is the best possible rational approximation of using fewer than five decimal digits in the numerator and denominator. Zu Chongzhi's results surpass the accuracy reached in Hellenistic mathematics, and would remain without improvement for close to a millennium.
In Gupta-era India (6th century), mathematician Aryabhata, in his astronomical treatise Āryabhaṭīya stated:Approximating to four decimal places: π ≈ = 3.1416,[17] [18] [19] Aryabhata stated that his result "approximately" ( "approaching") gave the circumference of a circle. His 15th-century commentator Nilakantha Somayaji (Kerala school of astronomy and mathematics) has argued that the word means not only that this is an approximation, but that the value is incommensurable (irrational).[20]
Further progress was not made for nearly a millennium, until the 14th century, when Indian mathematician and astronomer Madhava of Sangamagrama, founder of the Kerala school of astronomy and mathematics, found the Maclaurin series for arctangent, and then two infinite series for .[21] [22] [23] One of them is now known as the Madhava–Leibniz series, based on
\pi=4\arctan(1):
\pi=4\left(1- |
| ||||||
The other was based on
\pi=6\arctan(1/\sqrt3):
\pi=
infty | |
\sqrt{12}\sum | |
k=0 |
(-3)-k | |
2k+1 |
=
infty | |
\sqrt{12}\sum | |
k=0 |
| |||||
2k+1 |
=\sqrt{12}\left(1-{1\over3 ⋅ 3}+{1\over5 ⋅ 32}-{1\over7 ⋅ 33}+ … \right)
He used the first 21 terms to compute an approximation of correct to 11 decimal places as .
He also improved the formula based on arctan(1) by including a correction:
\pi/4 ≈ 1-
| ||||||||||
|
It is not known how he came up with this correction.[22] Using this he found an approximation of to 13 decimal places of accuracy when = 75.
Jamshīd al-Kāshī (Kāshānī), a Persian astronomer and mathematician, correctly computed the fractional part of 2 to 9 sexagesimal digits in 1424,[24] and translated this into 16 decimal digits[25] after the decimal point:
2\pi ≈ 6.2831853071795864,
which gives 16 correct digits for π after the decimal point:
\pi ≈ 3.1415926535897932
He achieved this level of accuracy by calculating the perimeter of a regular polygon with 3 × 228 sides.[26]
In the second half of the 16th century, the French mathematician François Viète discovered an infinite product that converged on known as Viète's formula.
The German-Dutch mathematician Ludolph van Ceulen (circa 1600) computed the first 35 decimal places of with a 262-gon. He was so proud of this accomplishment that he had them inscribed on his tombstone.[27]
In Cyclometricus (1621), Willebrord Snellius demonstrated that the perimeter of the inscribed polygon converges on the circumference twice as fast as does the perimeter of the corresponding circumscribed polygon. This was proved by Christiaan Huygens in 1654. Snellius was able to obtain seven digits of from a 96-sided polygon.[28]
In 1656, John Wallis published the Wallis product:
\pi | |
2 |
=
infty | |
\prod | |
n=1 |
4n2 | |
4n2-1 |
=
infty | ||
\prod | \left( | |
n=1 |
2n | |
2n-1 |
⋅
2n | |
2n+1 |
\right)=(
2 | |
1 |
⋅
2 | |
3 |
) ⋅ (
4 | |
3 |
⋅
4 | |
5 |
) ⋅ (
6 | |
5 |
⋅
6 | |
7 |
) ⋅ (
8 | |
7 |
⋅
8 | |
9 |
) ⋅ …
In 1706, John Machin used Gregory's series (the Taylor series for arctangent) and the identity to calculate 100 digits of (see below).[29] [30] In 1719, Thomas de Lagny used a similar identity to calculate 127 digits (of which 112 were correct). In 1789, the Slovene mathematician Jurij Vega improved John Machin's formula to calculate the first 140 digits, of which the first 126 were correct.[31] In 1841, William Rutherford calculated 208 digits, of which the first 152 were correct.
The magnitude of such precision (152 decimal places) can be put into context by the fact that the circumference of the largest known object, the observable universe, can be calculated from its diameter (93billion light-years) to a precision of less than one Planck length (at, the shortest unit of length expected to be directly measurable) using expressed to just 62 decimal places.[32]
The English amateur mathematician William Shanks calculated to 530 decimal places in January 1853, of which the first 527 were correct (the last few likely being incorrect due to round-off errors).[33] [34] He subsequently expanded his calculation to 607 decimal places in April 1853,[35] but an error introduced right at the 530th decimal place rendered the rest of his calculation erroneous; due to the nature of Machin's formula, the error propagated back to the 528th decimal place, leaving only the first 527 digits correct once again. Twenty years later, Shanks expanded his calculation to 707 decimal places in April 1873.[36] Due to this being an expansion of his previous calculation, most of the new digits were incorrect as well. Shanks was said to have calculated new digits all morning and would then spend all afternoon checking his morning's work. This was the longest expansion of until the advent of the electronic digital computer three-quarters of a century later.[37]
In 1910, the Indian mathematician Srinivasa Ramanujan found several rapidly converging infinite series of, including
1 | |
\pi |
=
2\sqrt{2 | |
which computes a further eight decimal places of with each term in the series. His series are now the basis for the fastest algorithms currently used to calculate . Evaluating the first term alone yields a value correct to seven decimal places:
\pi ≈ | 9801 |
2206\sqrt2 |
≈ 3.14159273
From the mid-20th century onwards, all improvements in calculation of have been done with the help of calculators or computers.
In 1944−45, D. F. Ferguson, with the aid of a mechanical desk calculator, found that William Shanks had made a mistake in the 528th decimal place, and that all succeeding digits were incorrect.[34] [38]
In the early years of the computer, an expansion of to decimal places was computed by Maryland mathematician Daniel Shanks (no relation to the aforementioned William Shanks) and his team at the United States Naval Research Laboratory in Washington, D.C. In 1961, Shanks and his team used two different power series for calculating the digits of . For one, it was known that any error would produce a value slightly high, and for the other, it was known that any error would produce a value slightly low. And hence, as long as the two series produced the same digits, there was a very high confidence that they were correct. The first 100,265 digits of were published in 1962.[39] The authors outlined what would be needed to calculate to 1 million decimal places and concluded that the task was beyond that day's technology, but would be possible in five to seven years.[39]
In 1989, the Chudnovsky brothers computed to over 1 billion decimal places on the supercomputer IBM 3090 using the following variation of Ramanujan's infinite series of :
1 | |
\pi |
=12
infty | |
\sum | |
k=0 |
(-1)k(6k)!(13591409+545140134k) | |
(3k)!(k!)36403203k |
.
Records since then have all been accomplished using the Chudnovsky algorithm.In 1999, Yasumasa Kanada and his team at the University of Tokyo computed to over 200 billion decimal places on the supercomputer HITACHI SR8000/MPP (128 nodes) using another variation of Ramanujan's infinite series of . In November 2002, Yasumasa Kanada and a team of 9 others used the Hitachi SR8000, a 64-node supercomputer with 1 terabyte of main memory, to calculate to roughly 1.24 trillion digits in around 600 hours (25days).[40]
Depending on the purpose of a calculation, can be approximated by using fractions for ease of calculation. The most notable such approximations are (relative error of about 4·10−4) and (relative error of about 8·10−8).[57] [58] [59] In Chinese mathematics, the fractions 22/7 and 355/113 are known as Yuelü and Milü .
Of some notability are legal or historical texts purportedly "defining " to have some rational value, such as the "Indiana Pi Bill" of 1897, which stated "the ratio of the diameter and circumference is as five-fourths to four" (which would imply "") and a passage in the Hebrew Bible that implies that .
See main article: Indiana Pi Bill. The so-called "Indiana Pi Bill" from 1897 has often been characterized as an attempt to "legislate the value of Pi". Rather, the bill dealt with a purported solution to the problem of geometrically "squaring the circle".[60]
The bill was nearly passed by the Indiana General Assembly in the U.S., and has been claimed to imply a number of different values for, although the closest it comes to explicitly asserting one is the wording "the ratio of the diameter and circumference is as five-fourths to four", which would make, a discrepancy of nearly 2 percent. A mathematics professor who happened to be present the day the bill was brought up for consideration in the Senate, after it had passed in the House, helped to stop the passage of the bill on its second reading, after which the assembly thoroughly ridiculed it before postponing it indefinitely.
It is sometimes claimed that the Hebrew Bible implies that " equals three", based on a passage in 7:23 NKJV and 4:2 NKJV giving measurements for the round basin located in front of the Temple in Jerusalem as having a diameter of 10 cubits and a circumference of 30 cubits.
The issue is discussed in the Talmud and in Rabbinic literature.[61] Among the many explanations and comments are these:
There is still some debate on this passage in biblical scholarship.[63] [64] Many reconstructions of the basin show a wider brim (or flared lip) extending outward from the bowl itself by several inches to match the description given in Kings 7:26[65] In the succeeding verses, the rim is described as "a handbreadth thick; and the brim thereof was wrought like the brim of a cup, like the flower of a lily: it received and held three thousand baths" Chronicles 4:5, which suggests a shape that can be encompassed with a string shorter than the total length of the brim, e.g., a Lilium flower or a Teacup.
See main article: List of formulae involving π.
Archimedes, in his Measurement of a Circle, created the first algorithm for the calculation of based on the idea that the perimeter of any (convex) polygon inscribed in a circle is less than the circumference of the circle, which, in turn, is less than the perimeter of any circumscribed polygon. He started with inscribed and circumscribed regular hexagons, whose perimeters are readily determined. He then shows how to calculate the perimeters of regular polygons of twice as many sides that are inscribed and circumscribed about the same circle. This is a recursive procedure which would be described today as follows: Let and denote the perimeters of regular polygons of sides that are inscribed and circumscribed about the same circle, respectively. Then,
P2n=
2pnPn | |
pn+Pn |
, p2n=\sqrt{pnP2n
3
10 | |
71 |
<\pi<3
1 | |
7 |
.
Archimedes uses no trigonometry in this computation and the difficulty in applying the method lies in obtaining good approximations for the square roots that are involved. Trigonometry, in the form of a table of chord lengths in a circle, was probably used by Claudius Ptolemy of Alexandria to obtain the value of given in the Almagest (circa 150 CE).
Advances in the approximation of (when the methods are known) were made by increasing the number of sides of the polygons used in the computation. A trigonometric improvement by Willebrord Snell (1621) obtains better bounds from a pair of bounds obtained from the polygon method. Thus, more accurate results were obtained from polygons with fewer sides. Viète's formula, published by François Viète in 1593, was derived by Viète using a closely related polygonal method, but with areas rather than perimeters of polygons whose numbers of sides are powers of two.
The last major attempt to compute by this method was carried out by Grienberger in 1630 who calculated 39 decimal places of using Snell's refinement.
See main article: Machin-like formula. For fast calculations, one may use formulae such as Machin's:
\pi | |
4 |
=4\arctan
1 | |
5 |
-\arctan
1 | |
239 |
(5+i)4 ⋅ (239-i)=22 ⋅ 134(1+i).
((
Formulae of this kind are known as Machin-like formulae. Machin's particular formula was used well into the computer era for calculating record numbers of digits of, but more recently other similar formulae have been used as well.
For instance, Shanks and his team used the following Machin-like formula in 1961 to compute the first 100,000 digits of :
\pi | |
4 |
=6\arctan
1 | |
8 |
+2\arctan
1 | |
57 |
+\arctan
1 | |
239 |
and they used another Machin-like formula,
\pi | |
4 |
=12\arctan
1 | |
18 |
+8\arctan
1 | |
57 |
-5\arctan
1 | |
239 |
as a check.
The record as of December 2002 by Yasumasa Kanada of Tokyo University stood at 1,241,100,000,000 digits. The following Machin-like formulae were used for this:
\pi | |
4 |
=12\arctan
1 | |
49 |
+32\arctan
1 | |
57 |
-5\arctan
1 | |
239 |
+12\arctan
1 | |
110443 |
\pi | |
4 |
=44\arctan
1 | |
57 |
+7\arctan
1 | |
239 |
-12\arctan
1 | |
682 |
+24\arctan
1 | |
12943 |
Other formulae that have been used to compute estimates of include:
Liu Hui (see also Viète's formula):
\begin{align} \pi& ≈ 768\sqrt{2-\sqrt{2+\sqrt{2+\sqrt{2+\sqrt{2+\sqrt{2+\sqrt{2+\sqrt{2+\sqrt{2+1}}}}}}}}}\\ & ≈ 3.141590463236763. \end{align}
\pi=
infty | |
\sqrt{12}\sum | |
k=0 |
(-3)-k | |
2k+1 |
=
infty | |
\sqrt{12}\sum | |
k=0 |
| |||||
2k+1 |
=\sqrt{12}\left({1\over1 ⋅ 30}-{1\over3 ⋅ 31}+{1\over5 ⋅ 32}-{1\over7 ⋅ 33}+ … \right)
Newton / Euler Convergence Transformation:[66]
\begin{align} \arctanx &=
x | |
1+x2 |
infty | |
\sum | |
k=0 |
(2k)!!x2k | |
(2k+1)!!(1+x2)k |
=
x | |
1+x2 |
+
| ||||
+ |
2 ⋅ 4 | |
3 ⋅ 5 |
x5 | |
(1+x2)3 |
+ … \\[10mu]
\pi | |
2 |
&=
| ||||
\sum | ||||
k=0 |
=
infty | |
\sum | |
k=0 |
\cfrac{2kk!2}{(2k+1)!} =1+
1 | \left(1+ | |
3 |
2 | \left(1+ | |
5 |
3 | |
7 |
\left(1+ … \right)\right)\right) \end{align}
where is the double factorial, the product of the positive integers up to with the same parity.
{\pi}=20\arctan
1 | |
7 |
+8\arctan
3 | |
79 |
(Evaluated using the preceding series for)
1 | |
\pi |
=
2\sqrt{2 | |
David Chudnovsky and Gregory Chudnovsky:
1 | |
\pi |
=12
infty | |
\sum | |
k=0 |
(-1)k(6k)!(13591409+545140134k) | |
(3k)!(k!)36403203k |
Ramanujan's work is the basis for the Chudnovsky algorithm, the fastest algorithms used, as of the turn of the millennium, to calculate .
Extremely long decimal expansions of are typically computed with iterative formulae like the Gauss–Legendre algorithm and Borwein's algorithm. The latter, found in 1985 by Jonathan and Peter Borwein, converges extremely quickly:
For
y0=\sqrt2-1, a0=6-4\sqrt2
yk+1=(1-f(yk))/(1+f(yk))~,~ak+1=ak(1+yk+1)4-22k+3yk+1(1+yk+1
2) | |
+y | |
k+1 |
f(y)=(1-y4)1/4
1/ak
The first one million digits of and are available from Project Gutenberg.[68] [69] A former calculation record (December 2002) by Yasumasa Kanada of Tokyo University stood at 1.24 trillion digits, which were computed in September 2002 on a 64-node Hitachi supercomputer with 1 terabyte of main memory, which carries out 2 trillion operations per second, nearly twice as many as the computer used for the previous record (206 billion digits). The following Machin-like formulae were used for this:
\pi | |
4 |
=12\arctan
1 | |
49 |
+32\arctan
1 | |
57 |
-5\arctan
1 | |
239 |
+12\arctan
1 | |
110443 |
\pi | |
4 |
=44\arctan
1 | |
57 |
+7\arctan
1 | |
239 |
-12\arctan
1 | |
682 |
+24\arctan
1 | |
12943 |
These approximations have so many digits that they are no longer of any practical use, except for testing new supercomputers.[70] Properties like the potential normality of will always depend on the infinite string of digits on the end, not on any finite computation.
Historically, base 60 was used for calculations. In this base, can be approximated to eight (decimal) significant figures with the number 3;8,29,44, which is
3+
8 | |
60 |
+
29 | |
602 |
+
44 | |
603 |
=3.14159 259+
≈ eq3+
8 | |
60 |
+
30 | |
602 |
-
30 | |
743 |
+
555 | |
556 |
+
1105 | |
868 |
=3.141592653589793237...
This aproximation shows us the exact of first 18 digits of Pi.
In addition, the following expressions can be used to estimate :
22 | |
7 |
=3.143+
\sqrt{2}+\sqrt{3}=3.146+
Karl Popper conjectured that Plato knew this expression, that he believed it to be exactly, and that this is responsible for some of Plato's confidence in the omnicompetence of mathematical geometry—and Plato's repeated discussion of special right triangles that are either isosceles or halves of equilateral triangles.
\sqrt{15}-\sqrt{3}+1=3.1409+
1+e-\gamma=3.1410+,
e
\gamma
\sqrt[3]{31}=3.1413+
\sqrt{63}-\sqrt{23}=3.14142 2+
\sqrt{51}-\sqrt{16}=3.14142 8+
3+ | \sqrt{2 |
\sqrt{7+\sqrt{6+\sqrt{5}}}=3.1416+
9 | +\sqrt{ | |
5 |
9 | |
5 |
77 | |
49 |
=3.14156+
\sqrt[5]{306}=3.14155+
\left(2-
\sqrt{2\sqrt{2 | |
- |
2}}{22}\right)2=3.14159 6+
\sqrt{2}+\sqrt{3}+
\sqrt{2 | |
- |
\sqrt{3}}{68}=3.14159 0+
4\left(1- | 1 | + |
3 |
1 | - | |
5 |
1 | + | |
7 |
1 | \right)- | |
9 |
2 | |||||||||
|
=3.14159 3+
355 | |
113 |
=3.14159 29+
\sqrt{883 | |
- |
\sqrt{21}}{8}=3.14159 25+
9801 | |
2206\sqrt{2 |
\left( | 2 ⋅ 4 ⋅ 6 |
3 ⋅ 5 ⋅ 7 |
| ||||||||||
\right) |
\right)=3.14159 27+
\sqrt{2669 | |
- |
\sqrt{547}}{9}=3.14159 269+
16 | |
5\sqrt[38]{2 |
\sqrt[3846]{2}}=3.14159 260+
3+ | \sqrt{2 |
\sqrt[1234]{2}\sqrt[1068]{2}}{10} |
=3.14159 268+
99733 | |
31746 |
=3.14159 264+
\left( | \sqrt{58 |
This is the case that cannot be obtained from Ramanujan's approximation (22).
\sqrt[4]{34+2
| ||||||||
This is from Ramanujan, who claimed the Goddess of Namagiri appeared to him in a dream and told him the true value of .
\sqrt[15]{28658146}=3.14159 26538+
63 | |
25 |
x
17+15\sqrt{5 | |
\sqrt[193]{ | 10100 |
11222.11122 |
This curious approximation follows the observation that the 193rd power of 1/ yields the sequence 1122211125... Replacing 5 by 2 completes the symmetry without reducing the correct digits of, while inserting a central decimal point remarkably fixes the accompanying magnitude at 10100.[78]
\sqrt[18]{888582403}=3.14159 26535 8+
\sqrt[20]{8769956796}=3.14159 26535 89+
\left( | \sqrt{163 |
This is obtained from the Chudnovsky series (truncate the series (1.4)[79] at the first term and let = 151931373056001/151931373056000 ≈ 1).
2510613731736\sqrt{2 | |
165707065 | |
52746197 |
=3.14159 26535 89793 4+
\left( | \sqrt{253 |
This is the approximation (22) in Ramanujan's paper[80] with = 253.
3949122332\sqrt{2 | |
2286635172367940241408\sqrt{2 | |
1 | ln\left( | |
10 |
221 | |
(\sqrt[4]{5 |
-1)24
This is derived from Ramanujan's class invariant .[80]
ln(6403203+744) | |
\sqrt{163 |
Derived from the closeness of Ramanujan constant to the integer 6403203+744. This does not admit obvious generalizations in the integers, because there are only finitely many Heegner numbers and negative discriminants d with class number h(−d) = 1, and d = 163 is the largest one in absolute value.
ln(52803(236674+30303\sqrt{61 | |
) |
3+744)}{\sqrt{427}}
Like the one above, a consequence of the j-invariant. Among negative discriminants with class number 2, this d the largest in absolute value.
ln(2-30((3+\sqrt{5 | |
)(\sqrt{5}+\sqrt{7})(\sqrt{7}+\sqrt{11})(\sqrt{11}+3)) |
12-24)}{\sqrt{5}\sqrt{7}\sqrt{11}}
This is derived from Ramanujan's class invariant .[80]
ln((2u)6+24) | |
\sqrt{3502 |
where u is a product of four simple quartic units,
u=(a+\sqrt{a2-1})2(b+\sqrt{b2-1})2(c+\sqrt{c2-1})(d+\sqrt{d2-1})
and,
\begin{align} a&=\tfrac{1}{2}(23+4\sqrt{34})\\ b&=\tfrac{1}{2}(19\sqrt{2}+7\sqrt{17})\\ c&=(429+304\sqrt{2})\\ d&=\tfrac{1}{2}(627+442\sqrt{2}) \end{align}
Based on one found by Daniel Shanks. Similar to the previous two, but this time is a quotient of a modular form, namely the Dedekind eta function, and where the argument involves
\tau=\sqrt{-3502}
15261343909396942111177730086852826352374060766771618308167575028500999 | |
48590509502030754798379641288876701245663220023884870402810360529259 |
...
... | 551152789881364457516133280872003443353677807669620554743\sqrt{10005 |
3 | |
1 |
,
22 | |
7 |
,
333 | |
106 |
,
355 | |
113 |
,
103993 | |
33102 |
,
104348 | |
33215 |
,
208341 | |
66317 |
,
312689 | |
99532 |
,
833719 | |
265381 |
,
1146408 | |
364913 |
,
4272943 | |
1360120 |
,
5419351 | |
1725033 |
Of these,
355 | |
113 |
Pi can be obtained from a circle if its radius and area are known using the relationship:
A=\pir2.
If a circle with radius is drawn with its center at the point (0, 0), any point whose distance from the origin is less than will fall inside the circle. The Pythagorean theorem gives the distance from any point ( ) to the center:
d=\sqrt{x2+y2}.
Mathematical "graph paper" is formed by imagining a 1×1 square centered around each cell ( ), where and are integers between − and . Squares whose center resides inside or exactly on the border of the circle can then be counted by testing whether, for each cell ( ),
\sqrt{x2+y2}\ler.
The total number of cells satisfying that condition thus approximates the area of the circle, which then can be used to calculate an approximation of . Closer approximations can be produced by using larger values of .
Mathematically, this formula can be written:
\pi=\limr
1 | |
r2 |
r | |
\sum | |
x=-r |
r | |
\sum | |
y=-r |
\begin{cases} 1&if\sqrt{x2+y2}\ler\\ 0&if\sqrt{x2+y2}>r.\end{cases}
In other words, begin by choosing a value for . Consider all cells ( ) in which both and are integers between − and . Starting at 0, add 1 for each cell whose distance to the origin (0,0) is less than or equal to . When finished, divide the sum, representing the area of a circle of radius, by 2 to find the approximation of .For example, if is 5, then the cells considered are:
(−5,5) | (−4,5) | (−3,5) | (−2,5) | (−1,5) | (0,5) | (1,5) | (2,5) | (3,5) | (4,5) | (5,5) | |
(−5,4) | (−4,4) | (−3,4) | (−2,4) | (−1,4) | (0,4) | (1,4) | (2,4) | (3,4) | (4,4) | (5,4) | |
(−5,3) | (−4,3) | (−3,3) | (−2,3) | (−1,3) | (0,3) | (1,3) | (2,3) | (3,3) | (4,3) | (5,3) | |
(−5,2) | (−4,2) | (−3,2) | (−2,2) | (−1,2) | (0,2) | (1,2) | (2,2) | (3,2) | (4,2) | (5,2) | |
(−5,1) | (−4,1) | (−3,1) | (−2,1) | (−1,1) | (0,1) | (1,1) | (2,1) | (3,1) | (4,1) | (5,1) | |
(−5,0) | (−4,0) | (−3,0) | (−2,0) | (−1,0) | (0,0) | (1,0) | (2,0) | (3,0) | (4,0) | (5,0) | |
(−5,−1) | (−4,−1) | (−3,−1) | (−2,−1) | (−1,−1) | (0,−1) | (1,−1) | (2,−1) | (3,−1) | (4,−1) | (5,−1) | |
(−5,−2) | (−4,−2) | (−3,−2) | (−2,−2) | (−1,−2) | (0,−2) | (1,−2) | (2,−2) | (3,−2) | (4,−2) | (5,−2) | |
(−5,−3) | (−4,−3) | (−3,−3) | (−2,−3) | (−1,−3) | (0,−3) | (1,−3) | (2,−3) | (3,−3) | (4,−3) | (5,−3) | |
(−5,−4) | (−4,−4) | (−3,−4) | (−2,−4) | (−1,−4) | (0,−4) | (1,−4) | (2,−4) | (3,−4) | (4,−4) | (5,−4) | |
(−5,−5) | (−4,−5) | (−3,−5) | (−2,−5) | (−1,−5) | (0,−5) | (1,−5) | (2,−5) | (3,−5) | (4,−5) | (5,−5) |
The 12 cells (0, ±5), (±5, 0), (±3, ±4), (±4, ±3) are exactly on the circle, and 69 cells are completely inside, so the approximate area is 81, and is calculated to be approximately 3.24 because = 3.24. Results for some values of are shown in the table below:
r | area | approximation of | |
---|---|---|---|
2 | 13 | 3.25 | |
3 | 29 | 3.22222 | |
4 | 49 | 3.0625 | |
5 | 81 | 3.24 | |
10 | 317 | 3.17 | |
20 | 1257 | 3.1425 | |
100 | 31417 | 3.1417 | |
1000 | 3141549 | 3.141549 |
For related results see The circle problem: number of points (x,y) in square lattice with x^2 + y^2 <= n.
Similarly, the more complex approximations of given below involve repeated calculations of some sort, yielding closer and closer approximations with increasing numbers of calculations.
Besides its simple continued fraction representation [3; 7, 15, 1, 292, 1, 1,{{nbsp}}...], which displays no discernible pattern, has many generalized continued fraction representations generated by a simple rule, including these two.
\pi={3+\cfrac{12}{6+\cfrac{32}{6+\cfrac{52}{6+\ddots}}}}
\pi=\cfrac{4}{1+\cfrac{12}{3+\cfrac{22}{5+\cfrac{32}{7+\cfrac{42}{9+\ddots}}}}}=3+\cfrac{12}{5+\cfrac{42}{7+\cfrac{32}{9+\cfrac{62}{11+\cfrac{52}{13+\ddots}}}}}
The remainder of the Madhava–Leibniz series can be expressed as generalized continued fraction as follows.
\pi=
m | |
4\sum | |
n=1 |
(-1)n-1 | |
2n-1 |
+\cfrac{2(-1)m}{2m+\cfrac{12}{2m+\cfrac{22}{2m+\cfrac{32}{2m+\ddots}}}} (m=1,2,3,\ldots)
Note that Madhava's correction term is
2 | ||||||||||
|
=4
m2+1 | |
4m3+5m |
The well-known values and are respectively the second and fourth continued fraction approximations to π. (Other representations are available at The Wolfram Functions Site.)
\pi=
infty | |
4\sum | |
n=0 |
\cfrac{(-1)n}{2n+1}=4\left(
1 | |
1 |
-
1 | |
3 |
+
1 | |
5 |
-
1 | |
7 |
+- … \right)
x
\pi
Knowing that 4 arctan 1 =, the formula can be simplified to get:
\begin{align} \pi&=2\left(1+\cfrac{1}{3}+\cfrac{1 ⋅ 2}{3 ⋅ 5} +\cfrac{1 ⋅ 2 ⋅ 3}{3 ⋅ 5 ⋅ 7}+\cfrac{1 ⋅ 2 ⋅ 3 ⋅ 4}{3 ⋅ 5 ⋅ 7 ⋅ 9} +\cfrac{1 ⋅ 2 ⋅ 3 ⋅ 4 ⋅ 5}{3 ⋅ 5 ⋅ 7 ⋅ 9 ⋅ 11}+ … \right)\\ &=
infty | |
2\sum | |
n=0 |
\cfrac{n!}{(2n+1)!!} =
infty | |
\sum | |
n=0 |
\cfrac{2n+1n!2}{(2n+1)!} =
infty | |
\sum | |
n=0 |
\cfrac{2n+1
with a convergence such that each additional 10 terms yields at least three more digits.
\pi=2+ | 1 | \left(2+ |
3 |
2 | \left(2+ | |
5 |
3 | |
7 |
\left(2+ … \right)\right)\right)
This series is the basis for a decimal spigot algorithm by Rabinowitz and Wagon.[84]
Another formula for
\pi
\pi | |
2k+1 |
=\arctan
\sqrt{2-ak-1 | |
ak=\sqrt{2+ak-1
a1=\sqrt{2}
\arctan(x)=
infty | |
\sum | |
n=0 |
22n(n!)2 | |
(2n+1)! |
x2n | |
(1+x2)n |
.
infty | ||
\arctan(x)=2\sum | { | |
n=1 |
1 | |
2n-1 |
{{a | |
n |
\begin{align} &a1(x)=2/x,\ &b1(x)=1,\ &an(x)=an-1
2\right)+4b | |
(x)\left(1-4/x | |
n-1 |
(x)/x,\ &bn(x)=bn-1
2\right)-4a | |
(x)\left(1-4/x | |
n-1 |
(x)/x, \end{align}
\pi
\pi
k
The constant
\pi
\pi | |
2 |
=
infty | ||
\sum | \arctan | |
n=0 |
1 | |
F2n+1 |
=\arctan
1 | |
1 |
+\arctan
1 | |
2 |
+\arctan
1 | |
5 |
+\arctan
1 | |
13 |
+ …
\pi | |
4 |
=\sumk\arctan
\sqrt{2-ak-1 | |
Fn
\pi
Observing an equilateral triangle and noting that
\sin\left(
\pi | |
6 |
\right)=
1 | |
2 |
\begin{align} \pi&=6\sin-1\left(
1 | |
2 |
\right) =6\left(
1 | |
2 |
+
1 | |
2 ⋅ 3 ⋅ 23 |
+
1 ⋅ 3 | |
2 ⋅ 4 ⋅ 5 ⋅ 25 |
+
1 ⋅ 3 ⋅ 5 | |
2 ⋅ 4 ⋅ 6 ⋅ 7 ⋅ 27 |
+ … \right)\\ &=
3 | |
160 ⋅ 1 |
+
6 | |
161 ⋅ 3 |
+
18 | |
162 ⋅ 5 |
+
60 | |
163 ⋅ 7 |
+ … =
infty | |
\sum | |
n=0 |
3 ⋅ \binom{2n | |
n} |
{16n(2n+1)}\\ &=3+
1 | |
8 |
+
9 | |
640 |
+
15 | |
7168 |
+
35 | |
98304 |
+
189 | |
2883584 |
+
693 | |
54525952 |
+
429 | |
167772160 |
+ … \end{align}
The Bailey–Borwein–Plouffe formula (BBP) for calculating was discovered in 1995 by Simon Plouffe. Using math, the formula can compute any particular digit of —returning the hexadecimal value of the digit—without having to compute the intervening digits (digit extraction).
infty | ||
\pi=\sum | \left( | |
n=0 |
4 | - | |
8n+1 |
2 | - | |
8n+4 |
1 | - | |
8n+5 |
1 | \right)\left( | |
8n+6 |
1 | |
16 |
\right)n
infty | |
\pi+3=\sum | |
n=1 |
n2nn!2 | |
(2n)! |
\pi= | 1 |
26 |
infty | |
\sum | |
n=0 |
(-1)n | |
210n |
\left(-
25 | - | |
4n+1 |
1 | + | |
4n+3 |
28 | - | |
10n+1 |
26 | - | |
10n+3 |
22 | - | |
10n+5 |
22 | + | |
10n+7 |
1 | |
10n+9 |
\right)
Many other expressions for were developed and published by Indian mathematician Srinivasa Ramanujan. He worked with mathematician Godfrey Harold Hardy in England for a number of years.
Extremely long decimal expansions of are typically computed with the Gauss–Legendre algorithm and Borwein's algorithm; the Salamin–Brent algorithm, which was invented in 1976, has also been used.
In 1997, David H. Bailey, Peter Borwein and Simon Plouffe published a paper (Bailey, 1997) on a new formula for as an infinite series:
\pi=
infty | |
\sum | |
k=0 |
1 | |
16k |
\left(
4 | |
8k+1 |
-
2 | |
8k+4 |
-
1 | |
8k+5 |
-
1 | |
8k+6 |
\right).
This formula permits one to fairly readily compute the kth binary or hexadecimal digit of, without having to compute the preceding k − 1 digits. Bailey's website[87] contains the derivation as well as implementations in various programming languages. The PiHex project computed 64 bits around the quadrillionth bit of (which turns out to be 0).
Fabrice Bellard further improved on BBP with his formula:[88]
\pi=
1 | |
26 |
infty | |
\sum | |
n=0 |
{(-1) | |
n}{2 |
10n
Other formulae that have been used to compute estimates of include:
\pi | |
2 |
| ||||
=\sum | ||||
k=0 |
infty | |
=\sum | |
k=0 |
2kk!2 | =1+ | |
(2k+1)! |
1 | \left(1+ | |
3 |
2 | \left(1+ | |
5 |
3 | |
7 |
\left(1+ … \right)\right)\right)
1 | |
\pi |
=
2\sqrt{2 | |
Srinivasa Ramanujan.This converges extraordinarily rapidly. Ramanujan's work is the basis for the fastest algorithms used, as of the turn of the millennium, to calculate .
In 1988, David Chudnovsky and Gregory Chudnovsky found an even faster-converging series (the Chudnovsky algorithm):
1 | |
\pi |
=
1 | |
426880\sqrt{10005 |
The speed of various algorithms for computing pi to n correct digits is shown below in descending order of asymptotic complexity. M(n) is the complexity of the multiplication algorithm employed.
Algorithm | Year | Time complexity or Speed | |
---|---|---|---|
1975 | O(M(n)log(n)) | ||
1988 | O(nlog(n)3) | ||
O(M(n)(logn)2) | |||
1300s | Sublinear convergence. Five billion terms for 10 correct decimal places |
Pi Hex was a project to compute three specific binary digits of using a distributed network of several hundred computers. In 2000, after two years, the project finished computing the five trillionth (5*1012), the forty trillionth, and the quadrillionth (1015) bits. All three of them turned out to be 0.
Over the years, several programs have been written for calculating to many digits on personal computers.
Most computer algebra systems can calculate and other common mathematical constants to any desired precision.
Functions for calculating are also included in many general libraries for arbitrary-precision arithmetic, for instance Class Library for Numbers, MPFR and SymPy.
Programs designed for calculating may have better performance than general-purpose mathematical software. They typically implement checkpointing and efficient disk swapping to facilitate extremely long-running and memory-expensive computations.
.
"Add four to one hundred, multiply by eight and then add sixty-two thousand. The result is approximately the circumference of a circle of diameter twenty thousand. By this rule the relation of the circumference to diameter is given."In other words, (4 + 100) × 8 + 62000 is the circumference of a circle with diameter 20000. This provides a value of π ≈ = 3.1416,Book: Jacobs, Harold R. . Geometry: Seeing, Doing, Understanding . Third . 2003 . . New York. 70.
\overline{\tfrac{16}5-\tfrac4{239}} -\tfrac13\overline{\tfrac{16}{53}-\tfrac4{2393}} +\tfrac15\overline{\tfrac{16}{55}-\tfrac4{2395}} -,\&c.=
Reprinted in Book: Smith, David Eugene . 1929 . A Source Book in Mathematics . McGraw–Hill . William Jones: The First Use of for the Circle Ratio . https://archive.org/details/sourcebookinmath1929smit/page/346/ . 346–347 .
Book: Sandifer, Edward . 2006 . Why 140 Digits of Pi Matter . Jurij baron Vega in njegov čas: Zbornik ob 250-letnici rojstva . http://people.wcsu.edu/sandifere/History/Preprints/Talks/Jurij%20Vega/Vega%20math%20script.pdf . Baron Jurij Vega and His Times: Celebrating 250 Years . DMFA . Ljubljana . 978-961-6137-98-0 . 2008467244 . 448882242 . https://web.archive.org/web/20060828194849/http://people.wcsu.edu/sandifere/History/Preprints/Talks/Jurij%20Vega/Vega%20math%20script.pdf . 2006-08-28 . We should note that Vega's value contains an error in the 127th digit. Vega gives a 4 where there should be an, and all digits after that are incorrect..
Book: Roy, Ranjan . 2021 . 1st ed. 2011 . Series and Products in the Development of Mathematics . 2 . 1 . Cambridge University Press . 215–216, 219–220.
Web site: Sandifer . Ed . 2009 . Estimating π . How Euler Did It . Reprinted in Book: Sandifer, Ed . 0 . 2014 . How Euler Did Even More . 109–118 . Mathematical Association of America.
Book: Newton, Isaac . Isaac Newton
. Isaac Newton . 1971 . Whiteside . Derek Thomas . Tom Whiteside . The Mathematical Papers of Isaac Newton . 4, 1674–1684 . Cambridge University Press . 526–653 .
Book: Euler, Leonhard . Leonhard Euler
. Leonhard Euler . 1755 . . §2.30 . 318 . Academiae Imperialis Scientiarium Petropolitanae . la . https://archive.org/details/institutiones-calculi-differentialis-cum-eius-vsu-in-analysi-finitorum-ac-doctri/page/318 . E 212.
Euler . Leonhard . Leonhard Euler . 1798 . written 1779 . Investigatio quarundam serierum, quae ad rationem peripheriae circuli ad diametrum vero proxime definiendam maxime sunt accommodatae . Nova Acta Academiae Scientiarum Petropolitinae . 11 . 133–149, 167–168 . E 705 .