0

I have a function F(x) that is an infinite sum that I know converges. I want to evaluate F(x) for a certain value of x and I have a tolerance. To give an example, let's say I have a formula for pi expressed as infinite series as the following:

enter image description here

And let's imagine, I have no idea what pi is! I want to use this infinite series to determine pi , let's say for ten decimal places (or within 0.01% of the exact value), is there any algorithm that will allow me to decide when to stop?

I have posted this question before. People have downvoted it and I deleted it. Hope I have expressed my question properly this time.

  • 2
    If the terms alternate in sign then the next term is a bound on the error, but there is no general method. If you look at the argument that tells you that any particular series converges there may be information there. – Ethan Bolker Sep 12 '22 at 20:28
  • 1
    What you are looking for is often called a modulus of convergence, a function that given $\epsilon > 0$ tells you how far have to go to be within $\epsilon$ of the limit. There are convergent sequences of rational numbers called Specker sequences that provably have no computable modulus of convergence. So we can prove that there is no general algorithm to do what you are looking for. – Rob Arthan Sep 12 '22 at 20:52
  • Ethan Bolker forgot the condition that the absolute values of an alternating sequence should be decreasing, for the next term to serve as a bound on the error. More generally, your best bet is to find a bounding series whose tails you can compute. I.e. some series $\sum_n b_n$ for which, if $F = \sum_n f_n$, then you know for all $n, |f_n| \le b_n$, and further, you can calculate $\sum_{n > k} b_n$ for each $k$. Then you find $N$ such that $\sum_{n>N} b_n$ is less than your tolerance, and you will be okay to calculate $F(x) \approx \sum_{n \le N} f_n(x)$. – Paul Sinclair Sep 13 '22 at 18:27

0 Answers0