Mathematica Playing Up

1. May 8, 2007

Gib Z

I just tried doing $$\sum_{n=1}^{1998} (-1)^{n+1} \frac{n+1}{n!}$$ in mathematicia and it gives me some fat long long big number, But I did it manually by splitting the numerator and it seemed to give me a telescoping series which solved to 1+ 1/(1998!), so the answer should be around 1 shouldn't it...

2. May 8, 2007

Moo Of Doom

I did it in Mathematica and was surprised by the huge number as well... until I realized that there is a / in the middle, and it's really a fraction. Approximate it numerically and you'll get 1.

3. May 8, 2007

Gib Z

Ahh I see >.< thanks for that but I wish mathematicia would express the answer in what I would think is simpler terms- $$1+\frac{1}{1998!}$$..

4. May 9, 2007

Crosson

The problem is the difficulty of recognizing the factorial in its long form.

With 5028 digits, that would be quite a number to guess at formulae for!

5. May 9, 2007

Gib Z

Does mathematicia calculate directly, then attempt a simplification? I always used to think it was just somehow smart, like knowing that the sum of (1/n^2) to infinity it pi^2/6. How does it get that...Anyway, I would have thought mathematicia would have done the same trick I did >.< damn

6. May 9, 2007

Crosson

In this case the calculation is direct. If you like, do the Sum as n goes from 1 to some finite integer h. The result (after some simplification) is in terms of the Gamma functions (factorial since the arguments are integers). This code is an attempt to control the evaluation a bit:

Code (Text):
Hold[Evaluate[Sum[((-1)^(1 +
n)*(1 + n))/n!, {n, 1, h}] // FullSimplify]] /. h -> 1998
The result is not as simple as possible, but with some more work controlling the evaluation it could be. The moral of the story is:

1) Use Sum when the upper limit is a symbol, or infinity.

2) When the upper limit is a number, use NSum.

7. May 9, 2007

Gib Z

Sorry about that then, Im new with mathematicia just got the trial version to see what its like. THanks