5
$\begingroup$

When I do the double sum using the sigma notation I get

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

$1 + e - \cosh[1]$

When I do the sums as below, I get the expected answer.

1 + Sum[Sum[1/((k + 2) k!), {k, n, Infinity}], {n, 0, Infinity}]  

$e$

Why the difference?

Edit for those who might like to see the only identity I could find:

Defer[1 + Sum[Sum[1/((k + 1)! + k!), {k, n, Infinity}], {n, 0, Infinity}]]
$\endgroup$
6
  • 1
    $\begingroup$ Could you explain what you mean by "doing" a sum "using the sigma notation"? $\endgroup$
    – whuber
    Apr 22, 2013 at 14:50
  • 2
    $\begingroup$ I guess he means this 1 + \!\( \*UnderoverscriptBox[\(\[Sum]\), \(n = 0\), \(\[Infinity]\)]\( \*UnderoverscriptBox[\(\[Sum]\), \(k = n\), \(\[Infinity]\)] \*FractionBox[\(1\), \(\((k + 1)\) \(k!\)\)]\)\). This by the way does not converge in Mathematica 9 and in place of 1 + e - Cosh[1] returns the input unchanged. The Sum version does converge to $\mathrm e$. $\endgroup$ Apr 22, 2013 at 14:54
  • 2
    $\begingroup$ This seems to work 1 + \!\( \*UnderoverscriptBox[\(\[Sum]\), \(n = 0\), \(\[Infinity]\)]\(( \*UnderoverscriptBox[\(\[Sum]\), \(k = n\), \(\[Infinity]\)] \*FractionBox[\(1\), \(\((k + 2)\)\ \(k!\)\)])\)\) $\endgroup$
    – user0501
    Apr 22, 2013 at 14:59
  • 2
    $\begingroup$ @whuber sigma, a Greek letter ;) $\endgroup$
    – BoLe
    Apr 22, 2013 at 14:59
  • 3
    $\begingroup$ The sigma notation is a red herring here. The difference is between 1 + Sum[Sum[1/((k + 2) k!), {k, n, Infinity}], {n, 0, Infinity}] and 1 + Sum[1/((k + 2) k!), {n, 0, Infinity}, {k, n, Infinity}] They should give the same answer but they don't. $\endgroup$ Apr 22, 2013 at 15:37

3 Answers 3

9
$\begingroup$

You can use Defer to see how to properly enter your "summation" type notation.

Defer[1 + Sum[Sum[1/((k + 2) k!), {k, n, Infinity}], {n, 0, Infinity}]]

You can then enter that output to see that it works. You must've entered something different.

enter image description here

$\endgroup$
4
  • $\begingroup$ +1, I didn't put the () around the second sum. $\endgroup$ Apr 22, 2013 at 15:08
  • $\begingroup$ Sum[1/((k + 2)*k!), {n, 0, Infinity}, {k, n, Infinity}] takes forever time on my MMA 9. I think there might be something more here than just mis-input? $\endgroup$
    – Silvia
    Apr 22, 2013 at 16:50
  • $\begingroup$ @FredKline If reverse the iterators does the work, I'd call it a bug. And it doesn't work in version 9. $\endgroup$
    – Silvia
    Apr 22, 2013 at 17:27
  • $\begingroup$ @FredKline Please see my answer, especially the note at the end. $\endgroup$
    – Silvia
    Apr 22, 2013 at 17:48
2
$\begingroup$

I think it's because in the sigma form the two sums are treated as a double sum with different order as the expression case:

In==> $$ \text{Hold}[\sum _{n=0}^{\infty } \sum _{k=n}^{\infty } \frac{1}{(k+2) k!}]//\text{InputForm} $$ Out==>

Hold[Sum[1/((k + 2)*k!), {n, 0, Infinity}, {k, n, Infinity}]]

and according to the documentation, the sum for n will be evaluate first.

In multiple sums, the range of the outermost variable is given first.

So if we interchange the two sigma, it would work:

in==> $$ 1+\sum _{k=n}^{\infty } \sum _{n=0}^{\infty } \frac{1}{(k+2) k!} $$ out==> $$ e $$

I'm using version 8 on Mac. Here is a screen shot:

enter image description here

$\endgroup$
6
  • 2
    $\begingroup$ Curious, interchanging the sigmas doesn't work here ... (Mma 9 on win) $\endgroup$ Apr 22, 2013 at 15:14
  • 1
    $\begingroup$ Pretty much exactly the opposite of what I did - very cool! $\endgroup$ Apr 22, 2013 at 15:33
  • 4
    $\begingroup$ @belisarius, exchanging the iterators shouldn't work. The correct way round is for the outermost variable to be given first. Compare Sum[1,{i,1,2},{j,1,i}] with Sum[1,{j,1,i},{i,1,2}] $\endgroup$ Apr 22, 2013 at 15:46
  • $\begingroup$ @SimonWoods why do you say that? Could you point out where is wrong in my answer? $\endgroup$
    – user0501
    Apr 22, 2013 at 16:04
  • 1
    $\begingroup$ Agree with Simon, the exchanging shouldn't work.(and it indeed does not work in my MMA 9.) By math notation convention, in nested summation, the most inner one (i.e. the rightest one) should be calculated first, as the range of any given iterator is restricted by every iterators to its left. (ref.) The nesting syntax of Sum is similar as Table. $\endgroup$
    – Silvia
    Apr 22, 2013 at 16:44
2
$\begingroup$

As we should expect the following identity (maybe under some certain mathematical assumptions, I'm not sure):

$$\sum _i \sum _j f(i,j)=\sum _i \left(\sum _j f(i,j)\right)\;\text{,}$$

which we can confirm in Mathematica 9 by the examples say:

enter image description here

However, the nested-iterator version of the summation in the original question takes forever time in my Mathematica 9:

Sum[1/((k + 2)*k!),
   {n, 0, Infinity}, {k, n, Infinity}]

while the nested-Sum version

Sum[
    Sum[1/((k + 2)*k!),
       {k, n, Infinity}],
   {n, 0, Infinity}]

as Mark McClure said in answer above, and user0501 said in comment, evaluates quickly to 1 + E.

So for the " Why the difference? ", my guessing is maybe Mathematica uses different algorithms and strategies for this two different kind of summations, which eventually make the former one unable to reach the answer for OP's problem.

Note

I believe it's a bug or something that in some Mathematica version exchanging the iterators works.

Have a look at the following snapshot taken from Mathematica 9:

enter image description here

The upper one, i.e. the iterator-exchanged one, has a lighter-green n under the most left $\sum$, which indicates it's a free global symbol, against the correct situation where it should be a iterator symbol with celadon colored. So $k$ gets wrongly out of the scope of $\sum_{n=0}^\infty$ here.

$\endgroup$
2
  • $\begingroup$ I see your point, that's cool to show that. By the way where do you get the second picture? $\endgroup$
    – user0501
    Apr 22, 2013 at 17:52
  • 1
    $\begingroup$ @user0501 It's in the preferences dialog box. $\endgroup$
    – Silvia
    Apr 22, 2013 at 17:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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