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

  • Mathematica
  • Thread starter Gib Z
  • Start date
  • Tags
    Mathematica
In summary, the problem is that when inputting a numerator and denominator of a factorial, the computer may not be able to simplify it to 1+1/(1998!). However, by splitting the numerator and denominator manually and approximating it numerically, the answer is still around 1.
  • #1
Gib Z
Homework Helper
3,351
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
  • #2
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
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]..
 
  • #4
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
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
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.
 
  • #7
Sorry about that then, I am new with mathematicia just got the trial version to see what its like. THanks
 

1. How do I solve for 1+1/1998 in Mathematica?

To solve for 1+1/1998 in Mathematica, you can simply type in the equation "1+1/1998" into the input field and press Enter. Mathematica will automatically calculate and display the result, which is approximately equal to 1.00050025.

2. Can Mathematica handle more complex equations involving fractions?

Yes, Mathematica is capable of handling a wide range of mathematical equations, including those involving fractions. It has advanced algorithms and built-in functions that allow it to solve even the most complex equations quickly and accurately.

3. What if I want to solve for 1+1/1998 in a specific number format?

You can specify the number format you want Mathematica to use when solving equations by adding the option "NumberFormat" to your input. For example, if you want the result of 1+1/1998 to be displayed in scientific notation, you can type in the equation "1+1/1998, NumberFormat -> ScientificForm" and press Enter.

4. Is there a way to check the accuracy of the solution provided by Mathematica?

Yes, you can use the built-in function N to check the numerical accuracy of the solution provided by Mathematica. Simply type in "N[1+1/1998]" and press Enter to see the result in decimal form.

5. Can I use Mathematica to solve equations symbolically?

Yes, Mathematica has powerful symbolic computation capabilities that allow it to solve equations in terms of variables or symbols instead of numerical values. To do this, you can use the built-in function Solve and specify the variables you want to solve for. For example, if you want to solve for x in the equation x+2=5, you can type in "Solve[x+2=5, x]" and press Enter.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
1K
  • Precalculus Mathematics Homework Help
Replies
10
Views
2K
Replies
2
Views
410
  • Linear and Abstract Algebra
Replies
2
Views
882
  • Precalculus Mathematics Homework Help
Replies
1
Views
1K
  • Calculus and Beyond Homework Help
Replies
7
Views
958
Replies
4
Views
284
  • Differential Equations
Replies
5
Views
2K
Back
Top