fbpx
Wikipedia

Bailey–Borwein–Plouffe formula

The Bailey–Borwein–Plouffe formula (BBP formula) is a formula for π. It was discovered in 1995 by Simon Plouffe and is named after the authors of the article in which it was published, David H. Bailey, Peter Borwein, and Plouffe.[1] Before that, it had been published by Plouffe on his own site.[2] The formula is

The BBP formula gives rise to a spigot algorithm for computing the nth base-16 (hexadecimal) digit of π (and therefore also the 4nth binary digit of π) without computing the preceding digits. This does not compute the nth decimal of π (i.e., in base 10).[3] But another formula discovered by Plouffe in 2022 allows extracting the nth digit of π in decimal.[4] BBP and BBP-inspired algorithms have been used in projects such as PiHex[5] for calculating many digits of π using distributed computing. The existence of this formula came as a surprise. It had been widely believed that computing the nth digit of π is just as hard as computing the first n digits.[1]

Since its discovery, formulas of the general form

have been discovered for many other irrational numbers , where and are polynomials with integer coefficients and is an integer base. Formulas of this form are known as BBP-type formulas.[6] Given a number , there is no known systematic algorithm for finding appropriate , , and ; such formulas are discovered experimentally.

Specializations

A specialization of the general formula that has produced many results is

 

where s, b, and m are integers, and   is a sequence of integers. The P function leads to a compact notation for some solutions. For example, the original BBP formula

 

can be written as

 

Previously known BBP-type formulae

Some of the simplest formulae of this type that were well known before BBP and for which the P function leads to a compact notation, are:

 
 

(In fact, this identity holds true for a > 1:

 .)

Plouffe was also inspired by the arctan power series of the form (the P notation can be also generalized to the case where b is not an integer):

 

The search for new equalities

Using the P function mentioned above, the simplest known formula for π is for s = 1, but m > 1. Many now-discovered formulae are known for b as an exponent of 2 or 3 and m as an exponent of 2 or it some other factor-rich value, but where several of the terms of sequence A are zero. The discovery of these formulae involves a computer search for such linear combinations after computing the individual sums. The search procedure consists of choosing a range of parameter values for s, b, and m, evaluating the sums out to many digits, and then using an integer relation-finding algorithm (typically Helaman Ferguson's PSLQ algorithm) to find a sequence A that adds up those intermediate sums to a well-known constant or perhaps to zero.

The BBP formula for π

The original BBP π summation formula was found in 1995 by Plouffe using PSLQ. It is also representable using the P function above:

 

which also reduces to this equivalent ratio of two polynomials:

 

This formula has been shown through a fairly simple proof to equal π.[7]

BBP digit-extraction algorithm for π

We would like to define a formula that returns the nth hexadecimal digit of π. A few manipulations are required to implement a spigot algorithm using this formula.

We must first rewrite the formula as

 

Now, for a particular value of n and taking the first sum, we split the sum to infinity across the nth term:

 

We now multiply by 16n, so that the hexadecimal point (the divide between fractional and integer parts of the number) is in the nth place:

 

Since we only care about the fractional part of the sum, we look at our two terms and realise that only the first sum is able to produce whole numbers; conversely, the second sum cannot produce whole numbers, since the numerator can never be larger than the denominator for k > n. Therefore, we need a trick to remove the whole numbers for the first sum. That trick is to reduce modulo  8k + 1. Our sum for the first fractional part then becomes

 

Notice how the modulus operator always guarantees that only the fractional sum will be kept. To calculate 16nk mod (8k + 1) quickly and efficiently, the modular exponentiation algorithm is used. When the running product becomes greater than one, the modulus is taken, just as for the running total in each sum.

Now to complete the calculation, this must be applied to each of the four sums in turn. Once this is done, the four summations are put back into the sum to π:

 

Since only the fractional part is accurate, extracting the wanted digit requires that one removes the integer part of the final sum and multiplies by 16 to "skim off" the hexadecimal digit at this position (in theory, the next few digits up to the accuracy of the calculations used would also be accurate).

This process is similar to performing long multiplication, but only having to perform the summation of some middle columns. While there are some carries that are not counted, computers usually perform arithmetic for many bits (32 or 64) and round, and we are only interested in the most significant digit(s). There is a possibility that a particular computation will be akin to failing to add a small number (e.g. 1) to the number 999999999999999, and that the error will propagate to the most significant digit.

BBP compared to other methods of computing π

This algorithm computes π without requiring custom data types having thousands or even millions of digits. The method calculates the nth digit without calculating the first n − 1 digits and can use small, efficient data types.

Though the BBP formula can directly calculate the value of any given digit of π with less computational effort than formulas that must calculate all intervening digits, BBP remains linearithmic ( ), whereby successively larger values of n require increasingly more time to calculate; that is, the "further out" a digit is, the longer it takes BBP to calculate it, just like the standard π-computing algorithms.[8]

Generalizations

D. J. Broadhurst provides a generalization of the BBP algorithm that may be used to compute a number of other constants in nearly linear time and logarithmic space.[9] Explicit results are given for Catalan's constant,  ,  , Apéry's constant  ,  , (where   is the Riemann zeta function),  ,  ,  , and various products of powers of   and  . These results are obtained primarily by the use of polylogarithm ladders.

See also

References

  1. ^ a b Bailey, David H.; Borwein, Peter B.; Plouffe, Simon (1997). "On the Rapid Computation of Various Polylogarithmic Constants". Mathematics of Computation. 66 (218): 903–913. doi:10.1090/S0025-5718-97-00856-9. MR 1415794.
  2. ^ Plouffe's website.
  3. ^ Gourdon, Xavier (12 February 2003). "N-th Digit Computation" (PDF). Retrieved 4 November 2020.
  4. ^ Weisstein, Eric W. "Digit-Extraction Algorithm". MathWorld.
  5. ^ "PiHex Credits". Centre for Experimental and Constructive Mathematics. Simon Fraser University. March 21, 1999. from the original on 2017-06-10. Retrieved 30 March 2018.
  6. ^ Weisstein, Eric W. "BBP Formula". MathWorld.
  7. ^ Bailey, David H.; Borwein, Jonathan M.; Borwein, Peter B.; Plouffe, Simon (1997). "The quest for pi". Mathematical Intelligencer. 19 (1): 50–57. doi:10.1007/BF03024340. MR 1439159. S2CID 14318695.
  8. ^ Bailey, David H. (8 September 2006). "The BBP Algorithm for Pi" (PDF). Retrieved 17 January 2013. Run times for the BBP algorithm ... increase roughly linearly with the position d.
  9. ^ D. J. Broadhurst, "Polylogarithmic ladders, hypergeometric series and the ten millionth digits of ζ(3) and ζ(5)", (1998) arXiv math.CA/9803067

Further reading

  • D. J. Broadhurst, "Polylogarithmic ladders, hypergeometric series and the ten millionth digits of ζ(3) and ζ(5)", (1998) arXiv math.CA/9803067

External links

  • Richard J. Lipton, "Making An Algorithm An Algorithm — BBP", weblog post, July 14, 2010.
  • Richard J. Lipton, "Cook’s Class Contains Pi", weblog post, March 15, 2009.
  • Bailey, David H. "A compendium of BBP-type formulas for mathematical constants, updated 15 Aug 2017" (PDF). Retrieved 2019-03-31.
  • David H. Bailey, "BBP Code Directory", web page with links to Bailey's code implementing the BBP algorithm, September 8, 2006.

bailey, borwein, plouffe, formula, formula, formula, discovered, 1995, simon, plouffe, named, after, authors, article, which, published, david, bailey, peter, borwein, plouffe, before, that, been, published, plouffe, site, formula, displaystyle, infty, left, f. The Bailey Borwein Plouffe formula BBP formula is a formula for p It was discovered in 1995 by Simon Plouffe and is named after the authors of the article in which it was published David H Bailey Peter Borwein and Plouffe 1 Before that it had been published by Plouffe on his own site 2 The formula is p k 0 1 16 k 4 8 k 1 2 8 k 4 1 8 k 5 1 8 k 6 displaystyle pi sum k 0 infty left frac 1 16 k left frac 4 8k 1 frac 2 8k 4 frac 1 8k 5 frac 1 8k 6 right right The BBP formula gives rise to a spigot algorithm for computing the nth base 16 hexadecimal digit of p and therefore also the 4nth binary digit of p without computing the preceding digits This does not compute the nth decimal of p i e in base 10 3 But another formula discovered by Plouffe in 2022 allows extracting the nth digit of p in decimal 4 BBP and BBP inspired algorithms have been used in projects such as PiHex 5 for calculating many digits of p using distributed computing The existence of this formula came as a surprise It had been widely believed that computing the nth digit of p is just as hard as computing the first n digits 1 Since its discovery formulas of the general form a k 0 1 b k p k q k displaystyle alpha sum k 0 infty left frac 1 b k frac p k q k right have been discovered for many other irrational numbers a displaystyle alpha where p k displaystyle p k and q k displaystyle q k are polynomials with integer coefficients and b 2 displaystyle b geq 2 is an integer base Formulas of this form are known as BBP type formulas 6 Given a number a displaystyle alpha there is no known systematic algorithm for finding appropriate p k displaystyle p k q k displaystyle q k and b displaystyle b such formulas are discovered experimentally Contents 1 Specializations 1 1 Previously known BBP type formulae 1 2 The search for new equalities 1 3 The BBP formula for p 1 3 1 BBP digit extraction algorithm for p 2 BBP compared to other methods of computing p 3 Generalizations 4 See also 5 References 6 Further reading 7 External linksSpecializations EditA specialization of the general formula that has produced many results is P s b m A k 0 1 b k j 1 m a j m k j s displaystyle P s b m A sum k 0 infty left frac 1 b k sum j 1 m frac a j mk j s right where s b and m are integers and A a 1 a 2 a m displaystyle A a 1 a 2 dots a m is a sequence of integers The P function leads to a compact notation for some solutions For example the original BBP formula p k 0 1 16 k 4 8 k 1 2 8 k 4 1 8 k 5 1 8 k 6 displaystyle pi sum k 0 infty left frac 1 16 k left frac 4 8k 1 frac 2 8k 4 frac 1 8k 5 frac 1 8k 6 right right can be written as p P 1 16 8 4 0 0 2 1 1 0 0 displaystyle pi P bigl 1 16 8 4 0 0 2 1 1 0 0 bigr Previously known BBP type formulae Edit Some of the simplest formulae of this type that were well known before BBP and for which the P function leads to a compact notation are ln 10 9 1 10 1 200 1 3 000 1 40 000 1 500 000 k 1 1 10 k k 1 10 k 0 1 10 k 1 k 1 1 10 P 1 10 1 1 displaystyle begin aligned ln frac 10 9 amp frac 1 10 frac 1 200 frac 1 3 000 frac 1 40 000 frac 1 500 000 cdots amp sum k 1 infty frac 1 10 k cdot k frac 1 10 sum k 0 infty left frac 1 10 k left frac 1 k 1 right right amp frac 1 10 P bigl 1 10 1 1 bigr end aligned ln 2 1 2 1 2 2 2 1 3 2 3 1 4 2 4 1 5 2 5 k 1 1 2 k k 1 2 k 0 1 2 k 1 k 1 1 2 P 1 2 1 1 displaystyle begin aligned ln 2 amp frac 1 2 frac 1 2 cdot 2 2 frac 1 3 cdot 2 3 frac 1 4 cdot 2 4 frac 1 5 cdot 2 5 cdots amp sum k 1 infty frac 1 2 k cdot k frac 1 2 sum k 0 infty left frac 1 2 k left frac 1 k 1 right right amp frac 1 2 P bigl 1 2 1 1 bigr end aligned In fact this identity holds true for a gt 1 ln a a 1 k 1 1 a k k displaystyle ln frac a a 1 sum k 1 infty frac 1 a k cdot k Plouffe was also inspired by the arctan power series of the form the P notation can be also generalized to the case where b is not an integer arctan 1 b 1 b 1 b 3 3 1 b 5 5 1 b 7 7 1 b 9 9 k 1 1 b k sin k p 2 k 1 b k 0 1 b 4 k 1 4 k 1 b 2 4 k 3 1 b P 1 b 4 4 1 0 b 2 0 displaystyle begin aligned arctan frac 1 b amp frac 1 b frac 1 b 3 3 frac 1 b 5 5 frac 1 b 7 7 frac 1 b 9 9 cdots amp sum k 1 infty left frac 1 b k frac sin frac k pi 2 k right frac 1 b sum k 0 infty left frac 1 b 4k left frac 1 4k 1 frac b 2 4k 3 right right amp frac 1 b P left 1 b 4 4 left 1 0 b 2 0 right right end aligned The search for new equalities Edit Using the P function mentioned above the simplest known formula for p is for s 1 but m gt 1 Many now discovered formulae are known for b as an exponent of 2 or 3 and m as an exponent of 2 or it some other factor rich value but where several of the terms of sequence A are zero The discovery of these formulae involves a computer search for such linear combinations after computing the individual sums The search procedure consists of choosing a range of parameter values for s b and m evaluating the sums out to many digits and then using an integer relation finding algorithm typically Helaman Ferguson s PSLQ algorithm to find a sequence A that adds up those intermediate sums to a well known constant or perhaps to zero The BBP formula for p Edit The original BBP p summation formula was found in 1995 by Plouffe using PSLQ It is also representable using the P function above p k 0 1 16 k 4 8 k 1 2 8 k 4 1 8 k 5 1 8 k 6 P 1 16 8 4 0 0 2 1 1 0 0 displaystyle begin aligned pi amp sum k 0 infty left frac 1 16 k left frac 4 8k 1 frac 2 8k 4 frac 1 8k 5 frac 1 8k 6 right right amp P bigl 1 16 8 4 0 0 2 1 1 0 0 bigr end aligned which also reduces to this equivalent ratio of two polynomials p k 0 1 16 k 120 k 2 151 k 47 512 k 4 1024 k 3 712 k 2 194 k 15 displaystyle pi sum k 0 infty left frac 1 16 k left frac 120k 2 151k 47 512k 4 1024k 3 712k 2 194k 15 right right This formula has been shown through a fairly simple proof to equal p 7 BBP digit extraction algorithm for p Edit We would like to define a formula that returns the nth hexadecimal digit of p A few manipulations are required to implement a spigot algorithm using this formula We must first rewrite the formula as p 4 k 0 1 16 k 8 k 1 2 k 0 1 16 k 8 k 4 k 0 1 16 k 8 k 5 k 0 1 16 k 8 k 6 displaystyle pi 4 sum k 0 infty frac 1 left 16 k right 8k 1 2 sum k 0 infty frac 1 left 16 k right 8k 4 sum k 0 infty frac 1 left 16 k right 8k 5 sum k 0 infty frac 1 left 16 k right 8k 6 Now for a particular value of n and taking the first sum we split the sum to infinity across the nth term k 0 1 16 k 8 k 1 k 0 n 1 16 k 8 k 1 k n 1 1 16 k 8 k 1 displaystyle sum k 0 infty frac 1 left 16 k right 8k 1 sum k 0 n frac 1 left 16 k right 8k 1 sum k n 1 infty frac 1 left 16 k right 8k 1 We now multiply by 16n so that the hexadecimal point the divide between fractional and integer parts of the number is in the nth place k 0 16 n k 8 k 1 k 0 n 16 n k 8 k 1 k n 1 16 n k 8 k 1 displaystyle sum k 0 infty frac 16 n k 8k 1 sum k 0 n frac 16 n k 8k 1 sum k n 1 infty frac 16 n k 8k 1 Since we only care about the fractional part of the sum we look at our two terms and realise that only the first sum is able to produce whole numbers conversely the second sum cannot produce whole numbers since the numerator can never be larger than the denominator for k gt n Therefore we need a trick to remove the whole numbers for the first sum That trick is to reduce modulo 8k 1 Our sum for the first fractional part then becomes k 0 n 16 n k mod 8 k 1 8 k 1 k n 1 16 n k 8 k 1 displaystyle sum k 0 n frac 16 n k bmod 8k 1 8k 1 sum k n 1 infty frac 16 n k 8k 1 Notice how the modulus operator always guarantees that only the fractional sum will be kept To calculate 16n k mod 8k 1 quickly and efficiently the modular exponentiation algorithm is used When the running product becomes greater than one the modulus is taken just as for the running total in each sum Now to complete the calculation this must be applied to each of the four sums in turn Once this is done the four summations are put back into the sum to p 4 S 1 2 S 2 S 3 S 4 displaystyle 4 Sigma 1 2 Sigma 2 Sigma 3 Sigma 4 Since only the fractional part is accurate extracting the wanted digit requires that one removes the integer part of the final sum and multiplies by 16 to skim off the hexadecimal digit at this position in theory the next few digits up to the accuracy of the calculations used would also be accurate This process is similar to performing long multiplication but only having to perform the summation of some middle columns While there are some carries that are not counted computers usually perform arithmetic for many bits 32 or 64 and round and we are only interested in the most significant digit s There is a possibility that a particular computation will be akin to failing to add a small number e g 1 to the number 999999999999999 and that the error will propagate to the most significant digit BBP compared to other methods of computing p EditThis algorithm computes p without requiring custom data types having thousands or even millions of digits The method calculates the nth digit without calculating the first n 1 digits and can use small efficient data types Though the BBP formula can directly calculate the value of any given digit of p with less computational effort than formulas that must calculate all intervening digits BBP remains linearithmic O n log n displaystyle O n log n whereby successively larger values of n require increasingly more time to calculate that is the further out a digit is the longer it takes BBP to calculate it just like the standard p computing algorithms 8 Generalizations EditD J Broadhurst provides a generalization of the BBP algorithm that may be used to compute a number of other constants in nearly linear time and logarithmic space 9 Explicit results are given for Catalan s constant p 3 displaystyle pi 3 p 4 displaystyle pi 4 Apery s constant z 3 displaystyle zeta 3 z 5 displaystyle zeta 5 where z x displaystyle zeta x is the Riemann zeta function log 3 2 displaystyle log 3 2 log 4 2 displaystyle log 4 2 log 5 2 displaystyle log 5 2 and various products of powers of p displaystyle pi and log 2 displaystyle log 2 These results are obtained primarily by the use of polylogarithm ladders See also EditApproximations of p Experimental mathematics Bellard s formulaReferences Edit a b Bailey David H Borwein Peter B Plouffe Simon 1997 On the Rapid Computation of Various Polylogarithmic Constants Mathematics of Computation 66 218 903 913 doi 10 1090 S0025 5718 97 00856 9 MR 1415794 Plouffe s website Gourdon Xavier 12 February 2003 N th Digit Computation PDF Retrieved 4 November 2020 Weisstein Eric W Digit Extraction Algorithm MathWorld PiHex Credits Centre for Experimental and Constructive Mathematics Simon Fraser University March 21 1999 Archived from the original on 2017 06 10 Retrieved 30 March 2018 Weisstein Eric W BBP Formula MathWorld Bailey David H Borwein Jonathan M Borwein Peter B Plouffe Simon 1997 The quest for pi Mathematical Intelligencer 19 1 50 57 doi 10 1007 BF03024340 MR 1439159 S2CID 14318695 Bailey David H 8 September 2006 The BBP Algorithm for Pi PDF Retrieved 17 January 2013 Run times for the BBP algorithm increase roughly linearly with the position d D J Broadhurst Polylogarithmic ladders hypergeometric series and the ten millionth digits of z 3 and z 5 1998 arXiv math CA 9803067Further reading EditD J Broadhurst Polylogarithmic ladders hypergeometric series and the ten millionth digits of z 3 and z 5 1998 arXiv math CA 9803067External links EditRichard J Lipton Making An Algorithm An Algorithm BBP weblog post July 14 2010 Richard J Lipton Cook s Class Contains Pi weblog post March 15 2009 Bailey David H A compendium of BBP type formulas for mathematical constants updated 15 Aug 2017 PDF Retrieved 2019 03 31 David H Bailey BBP Code Directory web page with links to Bailey s code implementing the BBP algorithm September 8 2006 Retrieved from https en wikipedia org w index php title Bailey Borwein Plouffe formula amp oldid 1115360974, wikipedia, wiki, book, books, library,

article

, read, download, free, free download, mp3, video, mp4, 3gp, jpg, jpeg, gif, png, picture, music, song, movie, book, game, games.