0
$\begingroup$

Basically I was told that this "the Solve function generally doesn't handle infinite series very well.

Choose some values of n and see how large the error is, then see if you can find a value of $n$ where the error is close to 0.001". The series is $1/k!$.

I am confused about how I can use the solve function to find an error at all. I tried this

Solve[Sum[1/k!, {k, 1, ∞}] == -1 + E, k]

It doesn't even give me an error.

$\endgroup$
  • 1
    $\begingroup$ This tells you that n can be taken as 6 or 7: In[535]:= n /. FindRoot[Sum[1/k!, {k, n, Infinity}] == 1/1000, {n, 10}] Out[535]= 6.25056872869 $\endgroup$ – Daniel Lichtblau Feb 7 at 16:27
  • 1
    $\begingroup$ Sum[1/k!, {k, 1, Infinity}] == -1 + E evaluates to True so the Solve correctly states that any value of k works. Look at Solve[Sum[1/k!, {k, 1, \[Infinity]}] == -1 + E, k] // Trace $\endgroup$ – Bob Hanlon Feb 7 at 19:08
1
$\begingroup$

You ask for an error, so I presume you want to compare partial sums with the (known) value of the infinite sum. So you could do things like the following:

N[Sum[1/k!,{k,1,n}]-(E-1)]/.n->5

Table[{n, N[Sum[1/k!, {k, 1, n}] - (E - 1)]}, {n, 10}] // TableForm

ListLinePlot[Table[Sum[1/k!, {k, 1, n}] - (E - 1), {n, 10}]]
| improve this answer | |
$\endgroup$
1
$\begingroup$

Pick an upper bound for n, 10, 20, 100 whatever you feel is big enough. Then put bounds on n and Solve over the Integers:

Min[n /. Solve[
   Abs[Sum[1/k!, {k, 1, n}] - (-1 + E)] < 1/1000 && 0 < n < 100, n, 
   Integers]]

(*  6  *)
| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.