Comment #24 on issue 3128 by [email protected]: Sum and Product manipulations
http://code.google.com/p/sympy/issues/detail?id=3128

Agree, reversed limits is definitely a corner case for students. I think it's a corner case for almost everybody. I think that's a good reason not to break with intuition.

2. Let S(k) be the set of integers between a(k) and b(k), including the end points. Let M be the multiset composed of the join of the sets S(k), for k = 0 .. n. How big is M? This is a very reasonable general math question. In conventional notation, the answer should be Sum( Sum(1,(i,a(k),b(k))), (k,0,n) ). However, the Karr convention imposes a directionality on the sum, such that sometimes this will give the wrong answer now. An explicit case is when a(k)=k-2, b(k)=2-k, n=4.

[ Sum((Sum(1,(i,-2+k,2-k))),(k,0,j)).doit() for j in [0,1,2,3,4]]
[5, 8, 9, 8, 5]

The answer should be [5, 8, 9, 12, 17]. Note that the problem is not ``easily fixed'' either, by say, inserting an absolute value. In that case,

[ Sum(abs(Sum(1,(i,-2+k,2-k))),(k,0,j)).doit() for j in range(5)]
[5, 8, 9, 10, 13]

which is still wrong. Of course, for this particular example, we can do the math out by hand, but that would be missing the point. And there is another version of this problem for which the Karr convention will give the correct solution.

The Karr convention appeats to me to be a very nice self-consistent resolution to a potential ambiguity for some problems where oriented sums are needed. But it is not the unique solution, nor is it the ``intuitive solution'' (IMO, data needed).

--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy-issues.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to