Mathematica Playing Up: Solving for 1+1/1998!

  • Context: Mathematica 
  • Thread starter Thread starter Gib Z
  • Start date Start date
  • Tags Tags
    Mathematica
Click For Summary

Discussion Overview

The discussion revolves around the computation of the sum \(\sum_{n=1}^{1998} (-1)^{n+1} \frac{n+1}{n!}\) using Mathematica, with participants exploring the discrepancies between manual calculations and the output from the software. The scope includes technical explanations of the summation process and the behavior of Mathematica in handling such calculations.

Discussion Character

  • Technical explanation, Debate/contested, Mathematical reasoning

Main Points Raised

  • One participant reports that Mathematica returns a large number for the sum, while manual calculations suggest it simplifies to \(1 + \frac{1}{1998!}\).
  • Another participant notes that the large output is due to a misunderstanding of the fraction involved and suggests approximating it numerically to yield a result close to 1.
  • A participant expresses a desire for Mathematica to present the answer in simpler terms, specifically \(1 + \frac{1}{1998!}\).
  • Concerns are raised about the difficulty of recognizing large factorials in their expanded form, which can complicate understanding the results.
  • There is a discussion about whether Mathematica calculates directly or simplifies results, with a participant suggesting that it should recognize certain sums like \(\sum (1/n^2)\) leading to \(\pi^2/6\).
  • A later reply provides a code snippet to control the evaluation of the sum, indicating that the result could be simplified further with additional effort.
  • One participant expresses their inexperience with Mathematica, indicating they are new to the software.

Areas of Agreement / Disagreement

Participants express differing views on how Mathematica handles the summation and simplification processes, indicating that no consensus exists regarding its computational methods or the expected output format.

Contextual Notes

Some participants mention the complexity of factorials and the implications of using symbolic versus numerical limits in summation, highlighting potential limitations in understanding the software's output.

Gib Z
Homework Helper
Messages
3,341
Reaction score
7
I just tried doing [tex]\sum_{n=1}^{1998} (-1)^{n+1} \frac{n+1}{n!}[/tex] 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...
 
Physics news on Phys.org
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.
 
Ahh I see >.< thanks for that but I wish mathematicia would express the answer in what I would think is simpler terms- [tex]1+\frac{1}{1998!}[/tex]..
 
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!
 
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
 
Gib Z said:
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

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:
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.
 
Sorry about that then, I am new with mathematicia just got the trial version to see what its like. THanks
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 19 ·
Replies
19
Views
3K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 6 ·
Replies
6
Views
5K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
5K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
5K