I was solving the following problem:
How many terms do we need to find the sum of the indicated series to the given degree of accuracy (0.0399)? $$\sum_{n=1}^{\infty}\frac{\left(-1\right)^{\left(n+1\right)}}{n^{2}}$$
Using the alternating series error calculation formula, I did: $$\frac{1}{\left(n+1\right)^{2}}<0.0399$$
$$n>\sqrt{\frac{1}{0.0399}}-1$$ $$n>4.006$$ $$n=5$$
When I went to check my answer, it turned out n = 4 was also within the 0.0399 bound. I used desmos to calculate the following:
$$\left(\sum_{n=1}^{\infty}\frac{\left(-1\right)^{\left(n+1\right)}}{n^{2}}\right)-\left(\sum_{n=1}^{4}\frac{\left(-1\right)^{\left(n+1\right)}}{n^{2}}\right)=0.023856$$
Is there any explanation for this? I looked through my work and couldn't find mistakes.
Let $S=\sum_{n=1}^\infty a_n$ and $S_k=\sum_{n=1}^k a_n$.
The partial sums in an alternating (convergent) sum will straddle the limit. The plot above shows the first 5 partial sums in this case. So you can be sure that $$|S-S_n|<|a_{n+1}|$$
In this case we have $|a_5|=0.04$ and $|a_6|=0.0278$ so we know for sure that five terms will get us within $0.0399$ (because the sixth term is smaller than that). But it is quite likely that less than five terms will be enough. Normally you don't care about that. Even if you do, it is hard to do much about it if you don't know the exact limit.
But if you want to be sure of finding the smallest $n$ that will get you within 0.0399 of the limit, you just have to work backwards and check. In this case we have $$|S-S_3|=0.0386<0.0625=a_4$$ and $$|S-S_2|=0.07$$ So, as it happens, just three terms are enough