Approximations of π

From Wikipedia, the free encyclopedia
(Redirected from Pi approximations)
Jump to navigation Jump to search

Template:Short description Script error: No such module "Hatnote". Template:Use dmy dates

File:PiComputationHistory.svg
Graph showing the historical evolution of the record precision of numerical approximations to pi, measured in decimal places (depicted on a logarithmic scale; time before 1400 is not shown to scale)

Template:Pi box Approximations for the mathematical constant pi (Template: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).

The record of manual approximation of Template:Pi is held by William Shanks, who calculated 527 decimals correctly in 1853.[1] Since the middle of the 20th century, the approximation of Template:Pi has been the task of electronic digital computers (for a comprehensive account, see [[chronology of computation of π|Chronology of computation of Template:Pi]]). On April 2, 2025, the current record was established by Linus Media Group and Kioxia with Alexander Yee's y-cruncher with 300 trillion (3×Template:Val) digits.[2]

Early history

The best known approximations to Template:Pi 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[3] have claimed that the ancient Egyptians used an approximation of Template:Pi as <templatestyles src="Fraction/styles.css" />227 = 3.142857 (about 0.04% too high) from as early as the Old Kingdom (c. 2700–2200 BC).[4] This claim has been met with skepticism.[5][6]

Babylonian mathematics usually approximated Template:Pi to 3, sufficient for the architectural projects of the time (notably also reflected in the description of Solomon's Temple in the Hebrew Bible).[7] 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 Template:Pi as <templatestyles src="Fraction/styles.css" />258 = 3.125, about 0.528% below the exact value.[8][9][10][11]

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 Template:Pi as <templatestyles src="Fraction/styles.css" />25681 ≈ 3.16 (accurate to 0.6 percent) by calculating the area of a circle via approximation with the octagon.[5][12]

Astronomical calculations in the Shatapatha Brahmana (c. 6th century BCE) use a fractional approximation of Template:Math.[13]

The Mahabharata (500 BCE – 300 CE) offers an approximation of 3, in the ratios offered in Bhishma Parva verses: 6.12.40–45.[14]

<templatestyles src="Template:Blockquote/styles.css" />

...

The Moon is handed down by memory to be eleven thousand yojanas in diameter. Its peripheral circle happens to be thirty three thousand yojanas when calculated.
...
The Sun is eight thousand yojanas and another two thousand yojanas in diameter. From that its peripheral circle comes to be equal to thirty thousand yojanas.

...

Script error: No such module "Check for unknown parameters".

In the 3rd century BCE, Archimedes proved the sharp inequalities <templatestyles src="Fraction/styles.css" />22371 < Template:Pi < <templatestyles src="Fraction/styles.css" />227, by means of regular 96-gons (accuracies of 2·10−4 and 4·10−4, respectively).[15]

In the 2nd century CE, Ptolemy used the value <templatestyles src="Fraction/styles.css" />377120, the first known approximation accurate to three decimal places (accuracy 2·10−5).[16] It is equal to 3+8/60+30/602, which is accurate to two sexagesimal digits.

The Chinese mathematician Liu Hui in 263 CE computed Template:Pi to between Template:Val and Template:Val by inscribing a 96-gon and 192-gon; the average of these two values is Template:Val (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, π ≈ <templatestyles src="Fraction/styles.css" />39271250 = 3.1416 (accuracy 2·10−6), although some scholars instead believe that this is due to the later (5th-century) Chinese mathematician Zu Chongzhi.[17] Zu Chongzhi is known to have computed Template:Pi to be between 3.1415926 and 3.1415927, which was correct to seven decimal places. He also gave [[Milü|two other approximations of Template:Pi]]: π ≈ <templatestyles src="Fraction/styles.css" />227 and π ≈ <templatestyles src="Fraction/styles.css" />355113, which are not as accurate as his decimal result. The latter fraction is the best possible rational approximation of Template:Pi 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:

<templatestyles src="Template:Blockquote/styles.css" />

Add 4 to 100, multiply by 8 and add to 62,000. This is 'approximately' the circumference of a circle whose diameter is 20,000.

Script error: No such module "Check for unknown parameters".

Approximating Template:Pi to four decimal places: π ≈ <templatestyles src="Fraction/styles.css" />6283220000 = 3.1416,[18][19][20] Aryabhata stated that his result "approximately" (Template:Transliteration "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).[21]

Middle Ages

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 Template:Pi.[22][23][24] One of them is now known as the Madhava–Leibniz series, based on π=4arctan(1):

π=4(113+1517+)

The other was based on π=6arctan(1/3):

π=12k=0(3)k2k+1=12k=0(13)k2k+1=12(1133+15321733+)

Template:Comparison pi infinite series.svg

He used the first 21 terms to compute an approximation of Template:Pi correct to 11 decimal places as Template:Val.

He also improved the formula based on arctan(1) by including a correction:

π/4113+1517+(1)n2n1±n2+14n3+5n

It is not known how he came up with this correction.[23] Using this he found an approximation of Template:Pi to 13 decimal places of accuracy when Template:Mvar = 75.

Indian mathematician Bhaskara II used regular polygons with up to 384 sides to obtain a close approximation of π, calculating it as 3.141666.[25]

Jamshīd al-Kāshī (Kāshānī), a Persian astronomer and mathematician, correctly computed the fractional part of 2Template:Pi to 9 sexagesimal digits in 1424,[26] and translated this into 16 decimal digits[27] after the decimal point:

2π6.2831853071795864,

which gives 16 correct digits for π after the decimal point:

π3.1415926535897932

He achieved this level of accuracy by calculating the perimeter of a regular polygon with 3 × 228 sides.[28]

16th to 19th centuries

In the second half of the 16th century, the French mathematician François Viète discovered an infinite product that converged on Template:Pi known as Viète's formula.

The German-Dutch mathematician Ludolph van Ceulen (circa 1600) computed the first 35 decimal places of Template:Pi with a 262-gon. He was so proud of this accomplishment that he had them inscribed on his tombstone.[29]

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 Template:Pi from a 96-sided polygon.[30]

In 1656, John Wallis published the Wallis product:

π2=n=14n24n21=n=1(2n2n12n2n+1)=(2123)(4345)(6567)(8789)

In 1706, John Machin used Gregory's series (the Taylor series for arctangent) and the identity 14π=4arccot5arccot239 to calculate 100 digits of Template:Pi (see Template:Slink below).[31][32] 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.[33] 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 (93Template:Nbspbillion light-years) to a precision of less than one Planck length (at Template:Val, the shortest unit of length expected to be directly measurable) using Template:Pi expressed to just 62 decimal places.[34]

The English amateur mathematician William Shanks calculated Template:Pi 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).[1][35] He subsequently expanded his calculation to 607 decimal places in April 1853,[36] 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.[1] Twenty years later, Shanks expanded his calculation to 707 decimal places in April 1873.[37] Due to this being an expansion of his previous calculation, most of the new digits were incorrect as well.[1] 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 Template:Pi until the advent of the electronic digital computer three-quarters of a century later.[38]

20th and 21st centuries

Script error: No such module "Labelled list hatnote". In 1910, the Indian mathematician Srinivasa Ramanujan found several rapidly converging infinite series of Template:Pi, including

1π=229801k=0(4k)!(1103+26390k)(k!)43964k

which computes a further eight decimal places of Template:Pi with each term in the series. His series are now the basis for the fastest algorithms currently used to calculate Template:Pi. Evaluating the first term alone yields a value correct to seven decimal places:

π9801220623.14159273

See Ramanujan–Sato series.

From the mid-20th century onwards, all improvements in calculation of Template:Pi 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.[35][39]

In the early years of the computer, an expansion of Template:Pi to Template:Val decimal places[40]Template:Rp 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 Template:Pi. 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 Template:Pi were published in 1962.[40]Template:Rp The authors outlined what would be needed to calculate Template:Pi 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.[40]Template:Rp

In 1989, the Chudnovsky brothers computed Template:Pi to over 1 billion decimal places on the supercomputer IBM 3090 using the following variation of Ramanujan's infinite series of Template:Pi:

1π=12k=0(1)k(6k)!(13591409+545140134k)(3k)!(k!)36403203k+3/2.

Records since then have all been accomplished using the Chudnovsky algorithm. In 1999, Yasumasa Kanada and his team at the University of Tokyo computed Template:Pi to over 200 billion decimal places on the supercomputer HITACHI SR8000/MPP (128 nodes) using another variation of Ramanujan's infinite series of Template:Pi. 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 Template:Pi to roughly 1.24 trillion digits in around 600 hours (25Template:Nbspdays).[41]

Recent records

  1. In August 2009, a Japanese supercomputer called the T2K Open Supercomputer more than doubled the previous record by calculating Template:Pi to roughly 2.6 trillion digits in approximately 73 hours and 36 minutes.
  2. In December 2009, Fabrice Bellard used a home computer to compute 2.7 trillion decimal digits of Template:Pi. Calculations were performed in base 2 (binary), then the result was converted to base 10 (decimal). The calculation, conversion, and verification steps took a total of 131 days.[42]
  3. In August 2010, Shigeru Kondo used Alexander Yee's y-cruncher to calculate 5 trillion digits of Template:Pi. This was the world record for any type of calculation, but significantly it was performed on a home computer built by Kondo.[43] The calculation was done between 4 May and 3 August, with the primary and secondary verifications taking 64 and 66 hours respectively.[44]
  4. In October 2011, Shigeru Kondo broke his own record by computing ten trillion (1013) and fifty digits using the same method but with better hardware.[45][46]
  5. In December 2013, Kondo broke his own record for a second time when he computed 12.1 trillion digits of Template:Pi.[47]
  6. In October 2014, Sandon Van Ness, going by the pseudonym "houkouonchi" used y-cruncher to calculate 13.3 trillion digits of Template:Pi.[48]
  7. In November 2016, Peter Trueb and his sponsors computed on y-cruncher and fully verified 22.4 trillion digits of Template:Pi (22,459,157,718,361 (Template:PiTemplate:Mvar × 1012)).[49] The computation took (with three interruptions) 105 days to complete,[48] the limitation of further expansion being primarily storage space.[47]
  8. Script error: No such module "anchor". In March 2019, Emma Haruka Iwao, an employee at Google, computed 31.4 (approximately 10Template:Pi) trillion digits of pi using y-cruncher and Google Cloud machines. This took 121 days to complete.[50]
  9. In January 2020, Timothy Mullican announced the computation of 50 trillion digits over 303 days.[51][52]
  10. On 14 August 2021, a team (DAViS) at the University of Applied Sciences of the Grisons announced completion of the computation of Template:Pi to 62.8 (approximately 20Template:Pi) trillion digits.[53][54]
  11. On 8 June 2022, Emma Haruka Iwao announced on the Google Cloud Blog the computation of 100 trillion (1014) digits of Template:Pi over 158 days using Alexander Yee's y-cruncher.[55]
  12. On 14 March 2024, Jordan Ranous, Kevin O’Brien and Brian Beeler computed Template:Pi to 105 trillion digits, also using y-cruncher.[56]
  13. On 28 June 2024, the StorageReview Team computed Template:Pi to 202 trillion digits, also using y-cruncher.[57]
  14. On 2 April 2025, Linus Media Group and Kioxia computed Template:Pi to 300 trillion digits, also using y-cruncher.[2]

Practical approximations

Depending on the purpose of a calculation, Template:Pi can be approximated by using fractions for ease of calculation. The most notable such approximations are <templatestyles src="Fraction/styles.css" />227 (relative error of about 4·10−4) and <templatestyles src="Fraction/styles.css" />355113 (relative error of about 8·10−8).[58][59][60] In Chinese mathematics, the fractions 22/7 and 355/113 are known as Yuelü (Template:Zhi) and Milü (Template:Zhi).

Non-mathematical "definitions" of Template:Pi

Of some notability are legal or historical texts purportedly "defining Template:Pi" 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 "Template:Math") and a passage in the Hebrew Bible that implies that Template:Math.

Indiana bill

Script error: No such module "Labelled list hatnote". 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".[61]

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 Template:Pi, 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 Template:Math, 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.

Imputed biblical value

Script error: No such module "Labelled list hatnote".

It is sometimes claimedTemplate:By whom that the Hebrew Bible implies that "Template:Pi equals three", based on a passage in Script error: No such module "Bibleverse". and Script error: No such module "Bibleverse". 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.[62] Among the many explanations and comments are these:

  • Rabbi Nehemiah explained this in his Mishnat ha-Middot (the earliest known Hebrew text on geometry, ca. 150 CE) by saying that the diameter was measured from the outside rim while the circumference was measured along the inner rim. This interpretation implies a brim about 0.225 cubit (or, assuming an 18-inch "cubit", some 4 inches), or one and a third "handbreadths," thick (cf. Script error: No such module "Bibleverse". and Script error: No such module "Bibleverse".).
  • Maimonides states (ca. 1168 CE) that Template:Pi can only be known approximately, so the value 3 was given as accurate enough for religious purposes. This is taken by some[63] as the earliest assertion that Template:Pi is irrational.

There is still some debate on this passage in biblical scholarship.Script error: No such module "Unsubst".[64][65] 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 Script error: No such module "Bibleverse".[66] 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" Script error: No such module "Bibleverse"., 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.

Development of efficient formulae

Script error: No such module "Labelled list hatnote".

Polygon approximation to a circle

Archimedes, in his Measurement of a Circle, created the first algorithm for the calculation of Template:Pi 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 Template:Math and Template:Math denote the perimeters of regular polygons of Template:Math sides that are inscribed and circumscribed about the same circle, respectively. Then,

P2n=2pnPnpn+Pn,p2n=pnP2n.

Archimedes uses this to successively compute Template:Math and Template:Math.[67] Using these last values he obtains

31071<π<317.

It is not known why Archimedes stopped at a 96-sided polygon; it only takes patience to extend the computations. Heron reports in his Metrica (about 60 CE) that Archimedes continued the computation in a now lost book, but then attributes an incorrect value to him.[68]

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 Template:Pi given in the Almagest (circa 150 CE).[69]

Advances in the approximation of Template:Pi (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.[70] 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.[71]

The last major attempt to compute Template:Pi by this method was carried out by Grienberger in 1630 who calculated 39 decimal places of Template:Pi using Snell's refinement.[70]

Machin-like formula

Script error: No such module "Labelled list hatnote". For fast calculations, one may use formulae such as Machin's:

π4=4arctan15arctan1239

together with the Taylor series expansion of the function arctan(x). This formula is most easily verified using polar coordinates of complex numbers, producing:

(5+i)4(239i)=22134(1+i).

((Template:Mvar),(Template:Mvar) = {239, 132} is a solution to the Pell equation Template:Mvar2 − 2Template:Mvar2 = −1.)

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 Template:Pi,[40] 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 Template:Pi:[40]

π4=6arctan18+2arctan157+arctan1239

and they used another Machin-like formula,

π4=12arctan118+8arctan1575arctan1239

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:

π4=12arctan149+32arctan1575arctan1239+12arctan1110443

K. Takano (1982).

π4=44arctan157+7arctan123912arctan1682+24arctan112943

F. C. M. Størmer (1896).

Other classical formulae

Other formulae that have been used to compute estimates of Template:Pi include:

Liu Hui (see also Viète's formula):

π76822+2+2+2+2+2+2+2+13.141590463236763.

Madhava:

π=12k=0(3)k2k+1=12k=0(13)k2k+1=12(11301331+15321733+)

Newton / Euler Convergence Transformation:[72]

arctanx=x1+x2k=0(2k)!!x2k(2k+1)!!(1+x2)k=x1+x2+23x3(1+x2)2+2435x5(1+x2)3+π2=k=0k!(2k+1)!!=k=02kk!2(2k+1)!=1+13(1+25(1+37(1+)))
where Template:Math is the double factorial, the product of the positive integers up to Template:Math with the same parity.

Euler:

π=20arctan17+8arctan379
(Evaluated using the preceding series for Template:Math)

Ramanujan:

1π=229801k=0(4k)!(1103+26390k)(k!)43964k

David Chudnovsky and Gregory Chudnovsky:

1π=12k=0(1)k(6k)!(13591409+545140134k)(3k)!(k!)36403203k+3/2

Ramanujan's work is the basis for the Chudnovsky algorithm, the fastest algorithms used, as of the turn of the millennium, to calculate Template:Pi.

Modern algorithms

Extremely long decimal expansions of Template:Pi 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=21, a0=642 and

yk+1=(1f(yk))/(1+f(yk)),ak+1=ak(1+yk+1)422k+3yk+1(1+yk+1+yk+12)

where f(y)=(1y4)1/4, the sequence 1/ak converges quartically to Template:Pi, giving about 100 digits in three steps and over a trillion digits after 20 steps. Even though the Chudnovsky series is only linearly convergent, the Chudnovsky algorithm might be faster than the iterative algorithms in practice; that depends on technological factors such as memory sizes and access times.[73] For breaking world records, the iterative algorithms are used less commonly than the Chudnovsky algorithm since they are memory-intensive.

The first one million digits of Template:Pi and <templatestyles src="Fraction/styles.css" />1Template:Pi are available from Project Gutenberg.[74][75] 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:

π4=12arctan149+32arctan1575arctan1239+12arctan1110443 (Kikuo Takano (1982))
π4=44arctan157+7arctan123912arctan1682+24arctan112943 (F. C. M. Størmer (1896)).

These approximations have so many digits that they are no longer of any practical use, except for testing new supercomputers.[76] Properties like the potential normality of [[pi|Template:Pi]] will always depend on the infinite string of digits on the end, not on any finite computation.

Miscellaneous approximations

As well as the formulas and approximations such as 227 and 355113 discussed elsewhere in this article, The following expressions have been used to estimate Template:Pi:

  • Accurate to three digits: 2+3=3.146+. Karl Popper conjectured that Plato knew this expression, that he believed it to be exactly Template:Pi, and that this is responsible for some of Plato's confidence in the universal power of geometry and for Plato's repeated discussion of special right triangles that are either isosceles or halves of equilateral triangles.[77]
  • Accurate to four digits: 1+eγ=3.1410+, where e is the natural logarithmic base and γ is Euler's constant, and[78] 313=3.1413+.
  • Accurate to four digits (or five significant figures):[79] 7+6+5=3.1416+.
  • An approximation by Ramanujan, accurate to 4 digits (or five significant figures):[80] 95+95=3.1416+.
  • Accurate to five digits: 7749=3.14156+, 3065=3.14155+, and (by Kochański) 40323 =3.14153+.
  • accurate to six digits:[81] (222222)2=3.14159 6+.
  • accurate to eight digits:
(58437233)1=6623329148=3.14159 263+[82]
This is the case that cannot be obtained from Ramanujan's approximation (22).[80]
  • accurate to nine digits:
34+24+12+(23)24=2143224=3.14159 2652+
This is from Ramanujan, who claimed the Goddess of Namagiri appeared to him in a dream and told him the true value of Template:Pi.[80]
  • accurate to ten digits (or eleven significant figures): 1010011222.11122193=3.14159 26536+ This approximation follows the observation that the 193rd power of 1/Template:Pi yields the sequence 1122211125... Replacing 5 by 2 completes the symmetry without reducing the correct digits of Template:Pi, while inserting a central decimal point remarkably fixes the accompanying magnitude at 10100.[83]
  • accurate to 12 decimal places:
(163618110005)1=3.14159 26535 89+
This is obtained from the Chudnovsky series (truncate the series (1.4)[84] at the first term and let Template:Math = 151931373056001/151931373056000 ≈ 1).
  • accurate to 16 digits:
251061373173621130173253125=3.14159 26535 89793 9+ - inverse of sum of first two terms of Ramanujan series.
16570706552746197=3.14159 26535 89793 4+
  • accurate to 18 digits:
(253464311903223172)1=3.14159 26535 89793 2387+
This is the approximation (22) in Ramanujan's paper[80] with Template:Math = 253.
  • accurate to 19 digits:
394912233221777729635=3.14159 26535 89793 2382+ - improved inverse of sum of first two terms of Ramanujan series.
  • accurate to 24 digits:
228663517236794024140821029347477390786609545=3.14159 26535 89793 23846 2649+ - inverse of sum of first three terms of Ramanujan series.
  • accurate to 25 decimal places:
110ln(221(541)24+24)=3.14159 26535 89793 23846 26433 9+
This is derived from Ramanujan's class invariant Template:Math.[80]
  • accurate to 30 decimal places:
ln(6403203+744)163=3.14159 26535 89793 23846 26433 83279+
Derived from the closeness of Ramanujan constant to the integer 6403203+744. This does not admit obvious generalizations in the integers,Template:Clarify 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.
  • accurate to 52 decimal places:
ln(52803(236674+3030361)3+744)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.
  • accurate to 52 decimal places:
ln(230((3+5)(5+7)(7+11)(11+3))1224)5711
This is derived from Ramanujan's class invariant Template:Math.[80]
  • accurate to 161 decimal places:
ln((2u)6+24)3502
where u is a product of four simple quartic units,
u=(a+a21)2(b+b21)2(c+c21)(d+d21)
and,
a=12(23+434)b=12(192+717)c=(429+3042)d=12(627+4422)
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 τ=3502. The discriminant d = 3502 has h(−d) = 16.
  • accurate to 256 digits:
1526134390939694211117773008685282635237406076677161830816757502850099948590509502030754798379641288876701245663220023884870402810360529259...
...551152789881364457516133280872003443353677807669620554743100053134188302895457201473978137944378665098227220269702217081111 - improved inverse of sum of the first nineteen terms of Chudnovsky series.
31,227,333106,355113,10399333102,10434833215,20834166317,31268999532,833719265381,1146408364913,42729431360120,54193511725033
Of these, 355113 is the only fraction in this sequence that gives more exact digits of Template:Pi (i.e. 7) than the number of digits needed to approximate it (i.e. 6). The accuracy can be improved by using other fractions with larger numerators and denominators, but, for most such fractions, more digits are required in the approximation than correct significant figures achieved in the result.[87]

Summing a circle's area

File:Pi monte carlo en.gif
Numerical approximation of Template:Pi: as points are randomly scattered inside the unit square, some fall within the unit circle. The fraction of points inside the circle approaches Template:Math as points are added.

Pi can be obtained from a circle if its radius and area are known using the relationship:

A=πr2.

If a circle with radius Template:Mvar is drawn with its center at the point Template:Math, any point whose distance from the origin is less than Template:Mvar will fall inside the circle. The Pythagorean theorem gives the distance from any point Template:Math to the center:

d=x2+y2.

Mathematical "graph paper" is formed by imagining a 1×1 square centered around each cell Template:Math, where Template:Mvar and Template:Mvar are integers between −Template:Mvar and Template:Mvar. Squares whose center resides inside or exactly on the border of the circle can then be counted by testing whether, for each cell Template:Math,

x2+y2r.

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 Template:Pi. Closer approximations can be produced by using larger values of Template:Mvar.

Mathematically, this formula can be written:

π=limr1r2x=rry=rr{1if x2+y2r0if x2+y2>r.

In other words, begin by choosing a value for Template:Mvar. Consider all cells (Template:MvarTemplate:Mvar) in which both Template:Mvar and Template:Mvar are integers between −Template:Mvar and Template:Mvar. Starting at 0, add 1 for each cell whose distance to the origin Template:Math is less than or equal to Template:Mvar. When finished, divide the sum, representing the area of a circle of radius Template:Mvar, by Template:Mvar2 to find the approximation of Template:Pi. For example, if Template:Mvar 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)
File:Kreuz-5.svg
This circle as it would be drawn on a Cartesian coordinate graph. The cells Template:Math and Template:Math are labeled.

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 Template:Pi is calculated to be approximately 3.24 because Template:Sfrac = 3.24. Results for some values of Template:Mvar are shown in the table below:[88]

Template:Table alignment

r area approximation of Template:Pi
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

Similarly, the more complex approximations of Template:Pi given below involve repeated calculations of some sort, yielding closer and closer approximations with increasing numbers of calculations.

Continued fractions

Besides its simple continued fraction representation [3; 7, 15, 1, 292, 1, 1,Template:Nbsp...], which displays no discernible pattern, Template:Pi has many generalized continued fraction representations generated by a simple rule, including these two.

π=3+126+326+526+
π=41+123+225+327+429+=3+125+427+329+6211+5213+

The remainder of the Madhava–Leibniz series can be expressed as generalized continued fraction as follows.[89]

π=4n=1m(1)n12n1+2(1)m2m+122m+222m+322m+(m=1,2,3,)

Note that Madhava's correction term is

22m+122m+222m=4m2+14m3+5m.

The well-known values Template:Sfrac and Template:Sfrac are respectively the second and fourth continued fraction approximations to π.[90]

Trigonometry

Gregory–Leibniz series

The Gregory–Leibniz series

π=4n=0(1)n2n+1=4(1113+1517+)

is the power series for arctan(x) specialized to Template:Math = 1. It converges too slowly to be of practical interest. However, the power series converges much faster for smaller values of x, which leads to formulae where π arises as the sum of small angles with rational tangents, known as Machin-like formulae.

Arctangent

Script error: No such module "labelled list hatnote". Knowing that 4 arctan 1 = Template:Pi, the formula can be simplified to get:

π=2(1+13+1235+123357+12343579+12345357911+)=2n=0n!(2n+1)!!=n=02n+1n!2(2n+1)!=n=02n+1(2nn)(2n+1)=2+23+415+435+16315+16693+323003+326435+256109395+256230945+

with a convergence such that each additional 10 terms yields at least three more digits.

π=2+13(2+25(2+37(2+)))
This series is the basis for a decimal spigot algorithm by Rabinowitz and Wagon.[91]

Another formula for π involving arctangent function is given by

π2k+1=arctan2ak1ak,k2,

where ak=2+ak1 such that a1=2. Approximations can be made by using, for example, the rapidly convergent Euler formula[92]

arctan(x)=n=022n(n!)2(2n+1)!x2n+1(1+x2)n+1.

Alternatively, the following simple expansion series of the arctangent function can be used

arctan(x)=2n=112n1an(x)an2(x)+bn2(x),

where

a1(x)=2/x,b1(x)=1,an(x)=an1(x)(14/x2)+4bn1(x)/x,bn(x)=bn1(x)(14/x2)4an1(x)/x,

to approximate π with even more rapid convergence. Convergence in this arctangent formula for π improves as integer k increases.

The constant π can also be expressed by infinite sum of arctangent functions as

π2=n=0arctan1F2n+1=arctan11+arctan12+arctan15+arctan113+

and

π4=k2arctan2ak1ak,

where Fn is the n-th Fibonacci number. However, these two formulae for π are much slower in convergence because of set of arctangent functions that are involved in computation.

Arcsine

Observing an equilateral triangle and noting that

sin(π6)=12

yields

π=6sin1(12)=6(12+12323+1324525+135246727+)=31601+61613+181625+601637+=n=03(2nn)16n(2n+1)=3+18+9640+157168+3598304+1892883584+69354525952+429167772160+

with a convergence such that each additional five terms yields at least three more digits.

Digit extraction methods

The Bailey–Borwein–Plouffe formula (BBP) for calculating Template:Pi was discovered in 1995 by Simon Plouffe. Using a spigot algorithm, the formula can compute any particular base 16 digit of Template:Pi—returning the hexadecimal value of the digit—without computing the intervening digits.[93]

π=n=0(48n+128n+418n+518n+6)(116)n

In 1996, Plouffe derived an algorithm to extract the Template:Mathth decimal digit of Template:Pi (using baseTemplate:Nbsp10 math to extract a baseTemplate:Nbsp10 digit), and which can do so with an improved speed of Template:Math time. The algorithm does not require memory for storage of a full n-digit result, so the one-millionth digit of Template:Pi could in principle be computed using a pocket calculator.[94] (However, it would be quite tedious and impractical to do so.)

π+3=n=1n2nn!2(2n)!

The calculation speed of Plouffe's formula was improved to Template:Math by Fabrice Bellard, who derived an alternative formula (albeit only in baseTemplate:Nbsp2 math) for computing Template:Pi.[95]

π=126n=0(1)n210n(254n+114n+3+2810n+12610n+32210n+52210n+7+110n+9)

Efficient methods

Many other expressions for Template:Pi 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 Template:Pi 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 Template:Pi as an infinite series:

π=k=0116k(48k+128k+418k+518k+6).

This formula permits one to fairly readily compute the kth binary or hexadecimal digit of Template:Pi, without having to compute the preceding k − 1 digits. Bailey's website[96] contains the derivation as well as implementations in various programming languages. The PiHex project computed 64 bits around the quadrillionth bit of Template:Pi (which turns out to be 0).

Fabrice Bellard further improved on BBP with his formula:[97]

π=126n=0(1)n210n(254n+114n+3+2810n+12610n+32210n+52210n+7+110n+9)

Other formulae that have been used to compute estimates of Template:Pi include:

π2=k=0k!(2k+1)!!=k=02kk!2(2k+1)!=1+13(1+25(1+37(1+)))
Newton.
1π=229801k=0(4k)!(1103+26390k)(k!)43964k
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 Template:Pi.

In 1988, David Chudnovsky and Gregory Chudnovsky found an even faster-converging series (the Chudnovsky algorithm):

1π=142688010005k=0(6k)!(13591409+545140134k)(3k)!(k!)3(640320)3k.

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
Gauss–Legendre algorithm 1975 O(M(n)log(n))[73]
Chudnovsky algorithm 1988 O(nlog(n)3)[48]
Binary splitting of the arctan series in Machin's formula O(M(n)(logn)2)[73]
Leibniz formula for π 1300s Sublinear convergence. Five billion terms for 10 correct decimal places

Projects

Pi Hex

Pi Hex was a project to compute three specific binary digits of Template:Pi 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.

Software for calculating Template:Pi

Over the years, several programs have been written for calculating Template:Pi to many digits on personal computers.

General purpose

Most computer algebra systems can calculate Template:Pi and other common mathematical constants to any desired precision.

Functions for calculating Template:Pi are also included in many general libraries for arbitrary-precision arithmetic, for instance Class Library for Numbers, MPFR and SymPy.

Special purpose

Programs designed for calculating Template:Pi 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.

  • TachusPi by Fabrice Bellard[98] is the program used by himself to compute world record number of digits of pi in 2009.
  • [[Y-cruncher|Template:Math-cruncher]] by Alexander Yee[48] is the program which every world record holder since Shigeru Kondo in 2010 has used to compute world record numbers of digits. Template:Math-cruncher can also be used to calculate other constants and holds world records for several of them.
  • Script error: No such module "anchor".PiFast by Xavier Gourdon was the fastest program for Microsoft Windows in 2003. According to its author, it can compute one million digits in 3.5 seconds on a 2.4 GHz Pentium 4.[99] PiFast can also compute other irrational numbers like Template:Math and Template:Math. It can also work at lesser efficiency with very little memory (down to a few tens of megabytes to compute well over a billion (109) digits). This tool is a popular benchmark in the overclocking community. PiFast 4.4 is available from Stu's Pi page. PiFast 4.3 is available from Gourdon's page.
  • QuickPi by Steve Pagliarulo for Windows is faster than PiFast for runs of under 400 million digits. Version 4.5 is available on Stu's Pi Page below. Like PiFast, QuickPi can also compute other irrational numbers like Template:Math, Template:Math, and Template:Math. The software may be obtained from the Pi-Hacks Yahoo! forum, or from Stu's Pi page.
  • Super PI by Kanada Laboratory[100] in the University of Tokyo is the program for Microsoft Windows for runs from 16,000 to 33,550,000 digits. It can compute one million digits in 40 minutes, two million digits in 90 minutes and four million digits in 220 minutes on a Pentium 90 MHz. Super PI version 1.9 is available from Super PI 1.9 page.

See also

Notes

Template:Reflist

References

  • Script error: No such module "Citation/CS1".
  • Script error: No such module "citation/CS1".
  • Script error: No such module "citation/CS1".
  • Script error: No such module "citation/CS1".
  • Script error: No such module "citation/CS1".
  • Script error: No such module "citation/CS1".
  1. a b c d Template:Cite magazine
  2. a b Script error: No such module "citation/CS1".
  3. Script error: No such module "citation/CS1".
  4. Script error: No such module "citation/CS1".
  5. a b Script error: No such module "citation/CS1".
  6. Script error: No such module "citation/CS1".
  7. See #Imputed biblical value. Script error: No such module "Footnotes". "There has been concern over the apparent biblical statement of Template:Pi ≈ 3 from the early times of rabbinical Judaism, addressed by Rabbi Nehemiah in the 2nd century."Script error: No such module "Unsubst".
  8. Script error: No such module "citation/CS1".
  9. Script error: No such module "citation/CS1".
  10. Script error: No such module "citation/CS1".
  11. See also Script error: No such module "Footnotes". "in 1936, a tablet was excavated some 200 miles from Babylon. ... The mentioned tablet, whose translation was partially published only in 1950, ... states that the ratio of the perimeter of a regular hexagon to the circumference of the circumscribed circle equals a number which in modern notation is given by 57/60+36/(60)2 [i.e. Template:Pi = 3/0.96 = 25/8]".
  12. Script error: No such module "citation/CS1".
  13. Chaitanya, Krishna. A profile of Indian culture. Indian Book Company (1975). p. 133.
  14. Script error: No such module "Citation/CS1".
  15. Script error: No such module "citation/CS1".
  16. Script error: No such module "citation/CS1".
  17. Script error: No such module "citation/CS1".. Reprinted in Script error: No such module "citation/CS1".. See in particular pp. 333–334 (pp. 28–29 of the reprint).
  18. How Aryabhata got the earth's circumference right Template:Webarchive
  19. Āryabhaṭīya (Template:Transliteration):
    Template:Transliteration.
    "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 π ≈ <templatestyles src="Fraction/styles.css" />6283220000 = 3.1416, Script error: No such module "citation/CS1".
  20. Script error: No such module "citation/CS1".
  21. Script error: No such module "citation/CS1".
  22. Script error: No such module "citation/CS1".
  23. a b Script error: No such module "citation/CS1".
  24. Script error: No such module "Citation/CS1".
  25. Script error: No such module "citation/CS1".
  26. Script error: No such module "citation/CS1".
  27. Script error: No such module "citation/CS1".
  28. Script error: No such module "Citation/CS1".
  29. Script error: No such module "citation/CS1".
  30. Script error: No such module "Citation/CS1".
  31. Script error: No such module "citation/CS1".

    Reprinted in Script error: No such module "citation/CS1".

  32. Script error: No such module "Citation/CS1".
  33. Script error: No such module "Citation/CS1".

    Script error: No such module "citation/CS1".

  34. Script error: No such module "citation/CS1".
  35. a b Script error: No such module "Citation/CS1".
  36. Script error: No such module "citation/CS1".
  37. Script error: No such module "Citation/CS1".
  38. Script error: No such module "citation/CS1".
  39. Ferguson 1946a, Script error: No such module "doi".
  40. a b c d e Script error: No such module "Citation/CS1".
  41. Script error: No such module "citation/CS1".
  42. Script error: No such module "citation/CS1".
  43. McCormick Grad Sets New Pi Record Template:Webarchive
  44. Script error: No such module "citation/CS1".
  45. Script error: No such module "citation/CS1".
  46. Script error: No such module "citation/CS1".
  47. a b Script error: No such module "citation/CS1".
  48. a b c d Script error: No such module "citation/CS1".
  49. Script error: No such module "citation/CS1".
  50. Script error: No such module "citation/CS1".
  51. Script error: No such module "citation/CS1".
  52. Script error: No such module "citation/CS1".
  53. Script error: No such module "citation/CS1".
  54. Script error: No such module "citation/CS1".
  55. Script error: No such module "citation/CS1".
  56. Script error: No such module "citation/CS1".
  57. Script error: No such module "citation/CS1".
  58. Template:Cite magazine
  59. Script error: No such module "citation/CS1".
  60. Script error: No such module "citation/CS1".
  61. Script error: No such module "Citation/CS1".
  62. Script error: No such module "Citation/CS1".
  63. Wilbur Richard Knorr, The Ancient Tradition of Geometric Problems, New York: Dover Publications, 1993.
  64. Script error: No such module "citation/CS1".
  65. Script error: No such module "citation/CS1".
  66. Math Forum – Ask Dr. Math
  67. Script error: No such module "Footnotes".
  68. Script error: No such module "Footnotes".
  69. Script error: No such module "Footnotes".
  70. a b Script error: No such module "Footnotes".
  71. Script error: No such module "Footnotes".
  72. Unpublished work by Newton (1684), later independently discovered by others, and popularized by Euler (1755).

    Script error: No such module "citation/CS1".

    Script error: No such module "citation/CS1". Reprinted in Script error: No such module "citation/CS1".

    Script error: No such module "citation/CS1".

    Script error: No such module "citation/CS1".

    Script error: No such module "Citation/CS1".

    Script error: No such module "citation/CS1".

  73. a b c Script error: No such module "citation/CS1".
  74. Script error: No such module "citation/CS1".
  75. Script error: No such module "citation/CS1".
  76. Script error: No such module "citation/CS1".
  77. Script error: No such module "Citation/CS1". See p. 150.
  78. Script error: No such module "citation/CS1".
  79. Script error: No such module "citation/CS1".
  80. a b c d e f Script error: No such module "Citation/CS1". Reprinted in Script error: No such module "citation/CS1".
  81. Script error: No such module "citation/CS1".
  82. Script error: No such module "citation/CS1".
  83. Script error: No such module "Citation/CS1".
  84. Script error: No such module "citation/CS1".
  85. Template:Cite OEIS
  86. Template:Cite OEIS
  87. Script error: No such module "citation/CS1".
  88. For related results see The circle problem: number of points (x,y) in square lattice with x^2 + y^2 <= n.
  89. Script error: No such module "Citation/CS1".
  90. Other representations are available at The Wolfram Functions Site.
  91. Script error: No such module "Citation/CS1".
  92. Script error: No such module "citation/CS1".
  93. Script error: No such module "Template wrapper".
  94. Script error: No such module "citation/CS1".
  95. Script error: No such module "citation/CS1".
  96. Script error: No such module "citation/CS1".
  97. Script error: No such module "citation/CS1".
  98. Script error: No such module "citation/CS1".
  99. "PiFast timings"
  100. Script error: No such module "citation/CS1".