# Calculation with given accuracy

The problem:

Given real numbers $X$ and $\epsilon$, with $X\neq 0$ and $\epsilon > 0$, calculate the sum of the series with the accuracy $\epsilon$ (for $\epsilon = 10^{-3}, 10^{-4}, 10^{-5}, 10^{-6}$) and specify the number of summands. Put results into columns $\epsilon$, sum, $N$. Run the calculation only for the first 10 terms.

$$\sum_{k=0}^\infty\frac{(-1)^k}{((k+1)!)^2}\bigg(\frac{x}{2}\bigg)^{2(k+1)}$$

This actually is a problem for my programming class, but I can't understand math behind the problem. What is X here? How can I perform these calculations with the given accuracy. Pls. advice if possible. Thanks!!

-
Presumably the lower case $x$ in the sum is (intended to be) the same as the capital $X$ you mentioned earlier in the problem? – Zev Chonoles Dec 25 '12 at 14:18
Zev, yes it is. Sorry, I just did not pay attention to this when I was typing. – Serj Dec 25 '12 at 14:25

I believe the series converges to $1-J_0(x)$, where $J_0(x)$ is the Bessel function of the 1st kind of order 0, so you can use that result to compare various partial sums to the analytical result, which you may compute using any various algorithms that are valid over large real and complex sets of inputs.
Also note that since your series is convergent, the error in the $N$th partial sum is given by the $(N+1)$th term. Combining this result and the above provides a relative error.