Re: Issue 3175 in sympy: Sum with reversed limits gives wrong answer

1 view
Skip to first unread message

sy...@googlecode.com

unread,
Dec 17, 2012, 6:56:38 PM12/17/12
to sympy-...@googlegroups.com
Updates:
Labels: NeedsReview

Comment #7 on issue 3175 by asme...@gmail.com: Sum with reversed limits
gives wrong answer
http://code.google.com/p/sympy/issues/detail?id=3175

The doit issue (but not the evalf issue) is fixed at
https://github.com/sympy/sympy/pull/1696.

sy...@googlecode.com

unread,
Dec 18, 2012, 12:24:41 AM12/18/12
to sympy-...@googlegroups.com

Comment #8 on issue 3175 by asme...@gmail.com: Sum with reversed limits
There is debate over what these "reversed" sums should return (see the pull
request). There are four options:

- summation(n, (n, 4, 0)) should give 0.
- summation(n, (n, 4, 0)) should give the same thing as summation(n, (n, 0,
4)).
- summation(n, (n, 4, 0)) should give the same thing as -summation(n, (n,
0, 4)).
- summation(n, (n, 4, 0)) should raise ValueError.

One thing is clear, though: doit() and evalf() should agree.

sy...@googlecode.com

unread,
Dec 18, 2012, 12:25:41 AM12/18/12
to sympy-...@googlegroups.com
Updates:
Status: NeedsDecision

Comment #9 on issue 3175 by asme...@gmail.com: Sum with reversed limits
(No comment was entered for this change.)

sy...@googlecode.com

unread,
Dec 18, 2012, 5:02:07 AM12/18/12
to sympy-...@googlegroups.com

Comment #10 on issue 3175 by anders.kaseorg: Sum with reversed limits gives
wrong answer
http://code.google.com/p/sympy/issues/detail?id=3175

The third option is written incorrectly; it should be:

- summation(n, (n, 4, 0)) should give the same thing as -summation(n, (n,
1, 3)).

(Briefly, this is what naturally falls out of the identity summation(f(n),
(n, a, b)) = f(a) + summation(f(n), (n, a+1, b)), and it entails the empty
sum summation(f(n), (n, 1, 0)) = 0 as corollary. I have a more
comprehensive justification and citations on the pull request.)

sy...@googlecode.com

unread,
Dec 19, 2012, 2:09:33 PM12/19/12
to sympy-...@googlegroups.com
Updates:
Status: Valid

Comment #11 on issue 3175 by asme...@gmail.com: Sum with reversed limits
We are going with the Karr definition (corrected point three). See the
discussion on the pull request.

Reply all
Reply to author
Forward
0 new messages