4

Using the series $\displaystyle \sum_{k=0}^{\infty}\frac{(-1)^{k}}{k!}=\frac{1}{e}$, evaluate the first $3$ decimal digits of $1/e$.

Attempt. In alternating series $\displaystyle \sum_{k=0}^{\infty}(-1)^{k+1}\alpha_n$, where $\alpha_n \searrow 0$, if $\alpha$ is the sum of the series then $$|s_n-\alpha|\leq \alpha_{n+1}.$$ So, in our case we need to find $n$ such that $|s_n-1/e|<0.001$, where $\displaystyle s_n=\sum_{k=0}^{n-1}\frac{(-1)^{k}}{k!}$ and it is enough to find $n$ such that $\dfrac{1}{n!}<0.001$, so $n\geq 7$. Therefore:

$$s_7=\sum_{k=0}^{6}\frac{(-1)^{k}}{k!}=0.36805\ldots$$

so I would expect $\dfrac{1}{e}=0.368\ldots$. But: $\dfrac{1}{e}=0.36787944\ldots$.

Where am I missing something?

Thanks in advance.

Nikolaos Skout
  • 5,329
  • 2
  • 16
  • 40
  • 2
    0.3678+0.0002=0.368 and 0.0002<0.001. – Régis Oct 23 '18 at 22:39
  • Ι see. When we want to approximate a number $\alpha$ by $\alpha_n$ up to $k$ decimal digits, we take $|\alpha_n-\alpha|<10^{-k}$. In this case how many of the digits we evaluate by $\alpha_n$ are the exact digits of $\alpha$? $k-1$ maybe? – Nikolaos Skout Oct 23 '18 at 22:54
  • "so I would expect $\frac 1e=0.368….$ But: $\frac 1e=0.36787944….$" And those two numbers are equal to be first three decimal places. If you round $\frac 1e=0.36787944….$ to the nearest $0.001$ you get $0.368$, don't you? – fleablood Oct 23 '18 at 23:26
  • " In this case how many of the digits we evaluate by αn are the exact digits of α? k−1 maybe?" If you round down then you expect them all to be the same. If you round up it depends on how many trailing 9s you have. The trailing 9s go to 0 and the last non 9 goes up by 1. And all the earlier ones are exactly the same. – fleablood Oct 24 '18 at 00:04
  • This is the calculator age, I guess..... To round you don't just cut off after the the first k digits. $1.58673948605903$ to the first five digits isn't $1.58673$ with the $948605903$ cut off. Because the $0.00000948605903$ is closer to $0.00001$ than it is to $0.00000$ so you round $0.00000948605903$ to $0.00001$ and not to $0.00000$ so $1.58673948605903$ is $1.58674$ and not the $3$. There's no reason to expect the digits to be the same. Just withing $10^{-k}$ Which could be none of the digits. $1.999999857385205$ rounds to $2.000$ and not to $1.999$. – fleablood Oct 24 '18 at 00:25
  • Strictly speaking, the problem of "find however many correct decimal digits" is not very well posed; you gain exactly correct digits in a very erratic way as your approximations improve. All you can really ensure with a tolerance of $10^{-k}$ is that the $k$th digit is either correct or correct or off by 1 in either direction. But if your "proposed" last digit is either $0$ or $9$, then that rounding error could turn into a carry, which means digits even before the $k$th one could turn out wrong. – Ian Oct 24 '18 at 00:38
  • (Cont.) This means you really need to stop your approximation at a digit that is neither $0$ nor $9$...which could require much more accuracy than you "really want". For instance here you would really need a guess for $e^{-1}$ of, say, $0.3679 \pm 0.0001$ in order to guarantee the third digit is exactly correct rather than possibly off by 1. This is why "get this many digits exactly correct" is usually not the thing we actually want to do in practice. It's also why the concept of significant figures isn't really the right way to propagate uncertainty. – Ian Oct 24 '18 at 00:38
  • You may simply use that $$ 0 < \int_{0}^{1} x^4(1-x)^4 e^{-x},dx = 24024-\frac{65304}{e} < \frac{1}{4^4}, $$ from which it follows that the difference between $e$ and $\frac{2721}{1001}$ is less than $2\cdot 10^{-7}$. – Jack D'Aurizio Oct 24 '18 at 13:26
  • You are just missing that your answer is right. –  Oct 24 '18 at 15:24

5 Answers5

5

To know the first three digits in the decimal expansion of $e^{-1}$ you don't want $n$ such that $$|s_n-e^{-1}|<0.001,$$ but in stead you want $n$ such that $|s_n-e^{-1}|$ is strictly less than the part of $e^{-1}$ after the first three digits. Denoting the fractional part of a real number $x$ by $\{x\}$, this can be formally described as $$|s_n-e^{-1}|<\left|s_n-\frac{\{10^3s_n\}}{10^3}\right|,$$ so it suffices to find $n$ such that $$\frac{1}{n!}<\left|s_n-\frac{\{10^3s_n\}}{10^3}\right|.$$ As your computations show $n=7$ does not suffice; you've found that $$s_7=0.3680555...\qquad\text{ but }\qquad 0.0000555...<\frac{1}{7!}.$$ A little more work shows that $n=8$ does suffice; indeed $$s_8=0.3678571...\qquad\text{ and }\qquad 0.0001428...>\frac{1}{8!}.$$

Servaes
  • 63,261
  • 7
  • 75
  • 163
1

Where am I missing something?

Um... nowhere?

$|s_7 - \frac 1e| = |0.36805.... - 0.36787944| \approx 0.00017056... < 0.001$

And $|0.368 - \frac 1e| = .00012055882855767840447622983853913..... < 0.001$

So... why do you think you are missing something?

fleablood
  • 124,253
  • Because, in general, by setting $|s_n-\alpha|<10^{-k}$ i was expecting the k first decimal digits of $s_n$ and $\alpha$ to be exactly the same. It seems that this is not the case. Really, how many digits does someone expect to be exactly the same by taking $|s_n-\alpha|<10^{-k}$? – Nikolaos Skout Oct 23 '18 at 23:40
  • " i was expecting the k first decimal digits of sn and α to be exactly the same." The first two are exactly the same. and the last one depends on if you have to round up or down. As the fourth decimal of 0.3678944.... is $8$ and $8 \ge 5$ we round 0.36 7 8944... *UP* to 0.36 8. So you got EXACTLY the answer you would have expected. – fleablood Oct 23 '18 at 23:53
  • "Really, how many digits does someone expect to be exactly the same by taking |sn−α|<10−k?" You expect the first $k-1$ to be exactly the same and you expect the $k$ one to be exactly the same if you round down and to be one greater if you round up. Oh.. You might expect some of the first $k -1$ to be round from ...a999999 to ...(a+1)00000. – fleablood Oct 24 '18 at 00:00
0

so we know: $$S=\sum_{n=0}^\infty\frac{(-1)^n}{n!}=\frac{1}{e}$$ and we want to know this $\frac1e$. To do this we simply evaluate terms of the sequence until it is consistant to 3 decimal decimal places. $$a_0=\frac11=1$$ $$a_0+a_1=1+\frac{-1}1=0$$ $$a_0+a_1+a_2=0+\frac{1}{2}=\frac{1}{2}=0.5$$ $$a_0+a_1+a_2+a_3=\frac{1}{2}+\frac{-1}{6}=\frac{1}{3}\approx0.333$$ $$a_0...+a_4=\frac{1}{3}+\frac{1}{24}=\frac{3}{8}=0.375$$ $$a_0...+a_5=\frac{3}{8}+\frac{-1}{120}\approx0.367$$ If you continue this in the way that you did then you do indeed end up with $0.368$ which is correct to 3 decimal places, so you have missed nothing

Henry Lee
  • 12,215
0

Making the problem more general, you want to compute $p$ such that $$S_p=\sum_{k=0}^{p}\frac{(-1)^{k}}{k!}$$ such that $$\frac{1}{(p+1)!} \le 10^{-n}$$ $n$ being the number of significant decimal places you need.

If you look at this question of mine, you will see a magnificent approximation by @robjohn for the inverse of the factorial function.

Applied to your case $(a=1)$, this would give $$\color{blue}{p=\frac{n \log (100)-\log \left({2 \pi }\right)}{2 W\left(\frac{n \log (100)-\log \left({2 \pi }\right)}{2 e}\right)}-\frac 32}$$ where appears Lambert function that you can evaluate using the expansions given in the linked Wikipedia page.

For $n=3$, this would give, as a real number, $p=5.17$. So, you need to use $p=6$. Let us check : $\frac 1 {7!}=\frac{1}{5040}\approx 0.00020$ while $\frac 1 {6!}=\frac{1}{720}\approx 0.00139$.

0

Note $$\bigg|\sum_{k=0}^{n}\frac{(-1)^{k}}{k!}-\frac{1}{e}\bigg|=\bigg|\sum_{k=n+1}^{\infty}\frac{(-1)^{k}}{k!}\bigg|\le\sum_{k=n+1}^\infty\frac{1}{3^{k}}\le\frac{1}{2\cdot3^{n}}.$$ Let $\frac{1}{2\cdot3^{n}}<0.001$ and then $n>\frac{\ln500}{\ln 3}\approx5.65678$. Now set $n=6$ and then $$ \bigg|\sum_{k=0}^{6}\frac{(-1)^{k}}{k!}-\frac{1}{e}\bigg|<0.001. $$ In fact, it is easy to see $$ \bigg|\sum_{k=0}^{5}\frac{(-1)^{k}}{k!}-\frac{1}{e}\bigg|=0.001212774505,\bigg|\sum_{k=0}^{6}\frac{(-1)^{k}}{k!}-\frac{1}{e}\bigg|=0.0001761143841<0.001. $$ So $n=6$ is the small number such that $|s_n-\frac1e|<0.001$.

xpaul
  • 44,000