Applied BBP-formula for the n-th digit of pi

  • Thread starter scienalc
  • Start date
  • Tags
    Applied Pi
In summary, the BBP formula can be used to calculate the n-th digit of pi in hexadecimal representation. The infinite part of the sum can be ignored as it does not contribute to the higher digits. The difference between a number and its representations is important to understand when using this formula. To extract a specific digit, a clever use of the modulo function is needed.
  • #1
scienalc
16
0
Hello everyone,

I have trouble understanding how to apply the BBP formula, i.e. actually compute the n-th digit of pi.

[itex]\pi[/itex]=[itex]\sum[/itex][itex]\frac{1}{16^{k}}[/itex]([itex]\frac{4}{8k+1}[/itex]-[itex]\frac{2}{8k+4}[/itex]-[itex]\frac{1}{8k+5}[/itex]-[itex]\frac{1}{8k+6}[/itex])

where the sum uses k from 0 to ∞.

I've read a few explanations how to adapt it, but have always failed to understand the following issues:
1) what is should be the expected returned value, i.e. what should I extract from it to get my n-th digit (I expect something fractional like [itex]\frac{p}{q}[/itex])?
2) what should I do with the infinite part of the sum? It seems illogical to me to approximate it somehow, since I expect the exact value of the desired digit
3) the above formula is supposed to calculate the hexadecimal formula of [itex]\pi[/itex]. What does that mean for the calculated digit? Is in that case the fractional part of [itex]\pi[/itex] regarded as a hexadecimal number?

Basically, I'm looking for an explanation how to apply the above formula and would be very thankful if someone of you could provide this explanation or a suitable link.

I'm not a professional mathematician, I'm an engineer, so I apologize in advance for any "foolish" questions/statements or if I've misplaced the question on the wrong forum.

Thanks for your understanding.

Regards
scienalc
 
Mathematics news on Phys.org
  • #2
The Wikipedia article goes into quite some detail on how to extract a particular digit. Essentially, it requires a clever use of the modulo function.
 
  • #3
Yes, the wiki article was one of the sources I consulted. However, it did not explain the issues I listed.

I did get the idea behind the use of the modulo function, though
 
  • #4
"2) what should I do with the infinite part of the sum? It seems illogical to me to approximate it somehow, since I expect the exact value of the desired digit"
--
1. As for the infinite part of the sums, they simply won't contribute to the value of the higher digits.

If you add three 0.0007s together, do those 7s add anything to the first three zeros?

Answer:
No, they don't!2. Thus, by careful budget balancing, you may IGNORE that infinite part as irrelevant for the digit value.
 
  • Like
Likes 1 person
  • #5
Thanks a lot, that helped me.

Could you clarify issue 3 a bit (since it effectively summarizes number 1 as well)?
 
  • #6
"3) the above formula is supposed to calculate the hexadecimal formula of π. What does that mean for the calculated digit? Is in that case the fractional part of π regarded as a hexadecimal number?"

Here, you need to understand the difference between a NUMBER, and the ways we may REPRESENT a number.

In binary REPRESENTATION, we have a number 1000. Now, AS A NUMBER, this is identical with its DECIMAL representation 8.

All properties that hold for 1000 holds for 8 as well, and vice versa.
----

Another way to understand the difference between a number and its representations is to have a meter stick as you "number".

Now, there are many different ways to chop up that stick, leading to widely different amounts of bits of stick and lengths of such bits.

But, a bag containing all the bits gained from one such method of chopping up the meter stick is a different REPRESENTATION of the number, but the same number as the unchopped stick.
 
  • #7
Hm... that part is perfectly clear. As you state, a 1000 binary and a 8 decimal are the same number, but a different representation. So, if we take the first few decimals of pi 3.1415926535... and I wanted to extract the fourth digit, in this case 5 (decimal), would I be correct to assume using the above formula would yield F (hexadecimal) as the hexadecimal representation of pi is 3.243F6A8885...?

When the formula is applied, the result is a fraction (sometimes even negative, if I'm not mistaken),
e.g. for the above case of the fourth digit, my result was 1.AE18C8D4F02D7 (1.68006568144499 decimal) using 200 members of the infinite progression. How do I extract my digit from this value?


PS: I really appreciate your patience, thanks a lot.
 

1. What is the BBP-formula for the n-th digit of pi?

The BBP-formula, also known as the Bailey–Borwein–Plouffe formula, is an algorithm for computing the n-th digit of pi. It was discovered by mathematicians David H. Bailey, Peter Borwein, and Simon Plouffe in 1995.

2. How does the BBP-formula work?

The BBP-formula uses a series of mathematical operations, including modular arithmetic and power series, to calculate the n-th digit of pi. It is based on the hexadecimal representation of pi, where each digit is represented by a number from 0 to 15. The formula then uses these numbers to calculate the desired digit.

3. What is the significance of the BBP-formula?

The BBP-formula is significant because it allows for the efficient and accurate calculation of individual digits of pi, without having to calculate all the previous digits. This makes it useful for applications that require specific digits of pi, such as cryptography and scientific research.

4. Is the BBP-formula the only way to calculate the n-th digit of pi?

No, there are other methods for calculating the n-th digit of pi, such as the Chudnovsky algorithm and the Gauss-Legendre algorithm. However, the BBP-formula is considered to be one of the most efficient and elegant methods.

5. Are there any limitations to the BBP-formula?

Yes, the BBP-formula can only be used to calculate the n-th digit of pi in base 16 (hexadecimal). It cannot be used to calculate digits in other bases, such as base 10 (decimal). Additionally, the formula can become more complex and computationally intensive for larger values of n.

Similar threads

Replies
4
Views
419
  • General Math
Replies
1
Views
777
Replies
6
Views
1K
Replies
17
Views
3K
Replies
6
Views
1K
  • Calculus and Beyond Homework Help
Replies
1
Views
349
Replies
1
Views
743
Replies
6
Views
2K
Replies
7
Views
1K
  • Math POTW for University Students
Replies
3
Views
599
Back
Top