If I calculate $e$ using the following formula.
$$e = \sum_{k=0}^{\infty}{\frac{1}{k!}}$$
Is it possible to predict how many correct decimal places I get when I stop summing at $n$ terms?
|
If I calculate $e$ using the following formula. $$e = \sum_{k=0}^{\infty}{\frac{1}{k!}}$$ Is it possible to predict how many correct decimal places I get when I stop summing at $n$ terms? |
|||||
|
|
If we use $n$ terms, the last term used is $\dfrac{1}{(n-1)!}$. The missing "tail" is therefore $$\frac{1}{n!}+\frac{1}{(n+1)!}+\frac{1}{(n+2)!}+\frac{1}{(n+3)!}\cdots.\tag{$1$}$$ Note that $(n+1)!=n!(n+1)$ and $(n+2)!\gt n!(n+1)^2$, and $(n+3)!\gt n!(n+1)^3$ and so on. So our tail $(1)$ is less than $$\frac{1}{n!}\left(1+\frac{1}{n+1}+\frac{1}{(n+1)^2}+\frac{1}{(n+1)^3}+\cdots \right).$$ Summing the geometric series, we find that the approximation error is less than $$\frac{1}{n!}\left(1+\frac{1}{n}\right).$$ |
|||||||||||||||||||
|
|
You can use the remainder term in Taylor's expansion |
|||||||
|
|
In this answer, it is shown, by comparison to a geometric series, that $$ 0\le n!\left(e-\sum_{k=0}^n\frac1{k!}\right)\le\frac1n $$ Therefore, the error after $n+1$ terms is at most $\frac1{nn!}$ . To $n$ decimal places: When asking for a number to $n$ decimal places, there are two common meanings
|
|||||||
|
|
No. There is in general no way of knowing how many leading digits of this partial sum are correct without computing subsequent terms. No particular upper bound on the error term will lead to a definite answer either. This is because there may be a string of $9$'s preceding the error term and adding subsequent terms may or may not carry those digits to $0$. One might hope for an upper bound on the number of subsequent terms that need to be considered to be certain of a particular number of correct leading digits, but although the expected value is constant (if the digits are assumed to be random), I am doubtful that any such upper bound is known. It isn't known whether or not $e$ is normal in any base and extremely long strings of $9$'s would coincide with its abnormality. |
|||||||||||
|
|
The series converges rapidly. If you stop at $\frac 1{ k!}$ you can bound the error by $\frac 1{k(k!)}$ by bounding the remaining terms with a geometric series. |
|||||
|
|
The $n$-th Taylor polynomial is $${P_n}(x) = f(0) + \frac{{f'(0)}}{{1!}}x + \frac{{f''(0)}}{{2!}}{x^2} + \cdots + \frac{{{f^{(n)}}(0)}}{{n!}}{x^n}$$ (in this case $f(x)$ is simply $e$) and the error we incur in approximating the value of $f(x)$ by $n$-th Taylor polynomial is exactly $$f(x) - {P_n}(x) + \frac{{{f^{(n + 1)}}(c)}}{{(n + 1)!}}{x^{n + 1}}$$ where $0 < c < x$. This form of the remainder can be used to find an upper bound on the error. If the difference above is positive, then the approximation is too low, and likewise if the error is negative, then the approximation is too high. We only need to find an appropriate $c$. |
|||||||||||||
|