4

It really doesn't seem to do so. It just oscillates wildly while increasing in magnitude. wtf?

$e^{-\infty }$ should approach 0, but that doesn't seem to be the case here.

https://www.wolframalpha.com/input/?i=sum+from+0+to+111+of+%28-10000%29%5En%2Fn%21

5201314
  • 2,227
O.S.
  • 592
  • I don't know for sure, but maybe you are just not taking enough terms? – Command Master Apr 10 '21 at 04:55
  • 7
    You are not taking enough terms. – copper.hat Apr 10 '21 at 04:59
  • how many terms does it need to converge? shouldn't 100 or even 1000 terms be enough? – O.S. Apr 10 '21 at 05:03
  • 1
    You need an arbitrarily large number depending on your choice of $x$. – copper.hat Apr 10 '21 at 05:08
  • but the thing is no matter how high i go it doesn't even appear to be converging to a certain value. the magnitude just keeps growing – O.S. Apr 10 '21 at 05:10
  • 1
    Applying the ratio test shows that the Power series representation of $e^x$ has an interval of convergence all real numbers. Do you know how many terms a powerseries has? – imranfat Apr 10 '21 at 05:11
  • 1
    infinitely many, i'm well aware of that. but the behavior of the series even for high amounts of terms (millions) does not approach 0 (or just a small real in this case). how can a series that oscillates and grows in magnitude ever converge? does the behavior of the series just magically change for sufficiently high amounts of terms? – O.S. Apr 10 '21 at 05:15
  • 2
    "does the behavior of the series just magically change for sufficiently high amounts of terms?" In a word: yes. – Andrew L Apr 10 '21 at 06:01
  • 1
    What do you mean by “grows in magnitude”? Even for a very larged value of $|x|$, the terms $x^n/n!$ will eventually start decreasing very quickly towards zero (once $n$ gets large enough), since $n!$ grows much faster than $|x|^n$ as $n \to \infty$. – Hans Lundmark Apr 10 '21 at 07:05
  • 2
    You wanted to check $ \ e^{-10000} \ $ , and you only took the first $ \ 112 \ $ terms?! Start with a smaller experiment: try this out for, say, $ \ e^{-3} \ $ , or even $ \ e^{-10} \ $ , to see how far out you have to go to begin getting terms with diminishing absolute-value. There are many series where the first $ \ n \ $ terms increase (which was $ \ n \sim 2·10^6 \ $ for one series I had) before later terms start to "shrink"; in an infinite series, it's only what the "infinite tail" does that determines convergence or divergence. –  Apr 10 '21 at 08:08

2 Answers2

7

The problem is to know how many terms you need to sum for a given accuracy.

In other words, adding $(n-1)$ terms you want to know $n$ such that $$\frac {x^n}{n!} < 10^{-k}\implies n!>x^n\, 10^k$$ If you look at this question of mine, you will see a magnificent approximation by @robjohn for the inverse of the factorial (have a look here).

$$\bbox[5px,border:2px solid #C0A000]{n\sim ex\exp\left(\operatorname{W}\left(\frac k{ex}\log(10)-\frac1{2ex}\log(2\pi x)\right)\right)-\frac12}$$ where $W(\cdot)$ is Lambert function.

Using this approximation for $x=10^4$ and $k=6$ would give $n=27190.6084224$ while the exact solution is $n=27190.6084239$

Checking $$\frac{(10^4)^{27190}}{27190!}=1.84\times 10^{-6} > 10^{-6}$$ $$\frac{(10^4)^{27191}}{27191!}=6.76\times 10^{-7} < 10^{-6}$$

vitamin d
  • 5,783
6

You don't expect to see the $n^\text{th}$ partial sums starting to converge until the $n^\text{th}$ term starts to approach $0$.

Your example attempts to compute $e^{-10000}$ using only terms up to $n=111$. But $(-10000)^{111}$ is greater in magnitude than $111!$ by a large margin. So you won't be seeing anything like convergence yet.

For an instructive example, compute the individual terms in the expansion of $e^{-10}$. Here's a table $$ \begin{array}{r|r||r|r} n & \frac{(-10)^n}{n!} & n & \frac{(-10^n}{n!}\\ \hline 0 & 1.00000000000000 & 18 & 156.192069685862\\ 1 & -10.0000000000000 & 19 & -82.2063524662433\\ 2 & 50.0000000000000 & 20 & 41.1031762331217\\ 3 & -166.666666666667 & 21 & -19.5729410633913\\ 4 & 416.666666666667 & 22 & 8.89679139245057\\ 5 & -833.333333333333 & 23 & -3.86817017063068\\ 6 & 1388.88888888889 & 24 & 1.61173757109612\\ 7 & -1984.12698412698 & 25 & -0.644695028438447\\ 8 & 2480.15873015873 & 26 & 0.247959626322480\\ 9 & -2755.73192239859 & 27 & -0.0918368986379555\\ 10 & 2755.73192239859 & 28 & 0.0327988923706984\\ 11 & -2505.21083854417 & 29 & -0.0113099628864477\\ 12 & 2087.67569878681 & 30 & 0.00376998762881591\\ 13 & -1605.90438368216 & 31 & -0.00121612504155352\\ 14 & 1147.07455977297 & 32 & 0.000380039075485474\\ 15 & -764.716373181982 & 33 & -0.000115163356207719\\ 16 & 477.947733238739 & 34 & 0.000033871575355211\\ 17 & -281.145725434552 & 35 & -0.00000967759295863189\\ \end{array} $$ You can see that if you were to take only the first ten or so terms you would be seeing wild fluctuations in the partial sums, but that by the time you get to $n=35$ things are starting to settle down.

To figure out how many terms you need to take, you can use Stirling's approximation, $n!\sim\sqrt{2\pi n}\left(\frac{n}{e}\right)^n$. So for $\frac{a^n}{n!}$ to be small, you need $\frac{ae}{n}$ to be small.

Will Orrick
  • 18,220