#9635: symbolic sum gives wrong answer
--------------------------------------------------------------+-------------
       Reporter:  Henryk.Trappmann                            |         Owner:  
burcin
           Type:  defect                                      |        Status:  
new   
       Priority:  major                                       |     Milestone:  
      
      Component:  calculus                                    |    Resolution:  
      
       Keywords:                                              |   Work issues:  
      
Report Upstream:  Fixed upstream, in a later stable release.  |     Reviewers:  
      
        Authors:                                              |     Merged in:  
      
   Dependencies:                                              |      Stopgaps:  
      
--------------------------------------------------------------+-------------
Changes (by kcrisman):

  * upstream:  Reported upstream. Developers acknowledge bug. => Fixed
               upstream, in a later stable release.


Comment:

 The
 
[http://sourceforge.net/tracker/?func=detail&aid=3036579&group_id=4933&atid=104933
 bug report] got updated over a year ago.

 In the current Sage:
 {{{
 (%i1) load(simplify_sum);
 (%o1) /Users/karl-
 dietercrisman/Downloads/sage-5.0/local/share/maxima/5.26.0/s\
 hare/contrib/solve_rec/simplify_sum.mac
 (%i2) simplify_sum(sum(binomial(n,k)*binomial(k-1,j)*(-1)**(k-1-j),k,j
 +1,n));

 Is  j + 1  positive, negative, or zero?

 pos;
 (%o2)                                  1
 }}}
 So just need a doctest.
 {{{
 sage: (n,k,j)=var('n,k,j')
 sage: sum(binomial(n,k)*binomial(k-1,j)*(-1)**(k-1-j),k,j+1,n)
 -sum((-1)^(-j + k)*binomial(k - 1, j)*binomial(n, k), k, j + 1, n)
 sage: assume(j>-1)
 sage: sum(binomial(n,k)*binomial(k-1,j)*(-1)**(k-1-j),k,j+1,n)
 1
 sage: forget()
 sage: assume(n>=j)
 sage: sum(binomial(n,k)*binomial(k-1,j)*(-1)**(k-1-j),k,j+1,n)
 -sum((-1)^(-j + k)*binomial(k - 1, j)*binomial(n, k), k, j + 1, n)
 sage: forget()
 sage: assume(j==-1)
 sage: sum(binomial(n,k)*binomial(k-1,j)*(-1)**(k-1-j),k,j+1,n)
 1
 sage: forget()
 sage: assume(j<-1)
 sage: sum(binomial(n,k)*binomial(k-1,j)*(-1)**(k-1-j),k,j+1,n)
 -sum((-1)^(-j + k)*binomial(k - 1, j)*binomial(n, k), k, j + 1, n)
 }}}
 Was the original report here wrong?  Maxima currently says that the sign
 of `j+1` is all that matters, which sort of makes sense

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/9635#comment:3>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to