This appears to be a bug in Maxima.

(%i1) load(simplify_sum);
<snip>
(%i3) simplify_sum(sum(binomial(n,k)*binomial(k-1,j)*(-1)**(k-1-j),k,j
+1,n));

(%o3)                                  0
(%i4) simplify_sum(sum(binomial(5,k)*binomial(k-1,3)*(-1)**(k-1-3),k,
4,5));
(%o4)                                  1
(%i5) 5*1*1+1*4*(-1);
(%o5)                                  1

In fact, the answer appears to always be 1 or 0.  Is that true?

On Jul 27, 1:17 am, Henryk Trappmann <bo198...@googlemail.com> wrote:
> 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)
> 0
> sage: (n,j)=(5,3)
> sage: sum(binomial(n,k)*binomial(k-1,j)*(-1)**(k-1-j) for k in range(j
> +1,n+1))
> 1
>
> The symbolic sum being 0 is only trivially valid for n<j+1.

This also discovers another issue:


sage: n = 20
sage: j = 5
sage: var('k')
k
sage: sum(binomial(n,k)*binomial(k-1,j)*(-1)**(k-1-j),k,j+1,n)
TypeError: Either m or x-m must be an integer

Because

sage: binomial(x,3)
1/6*(x - 2)*(x - 1)*x
sage: binomial(3,k)
---------------------------------------------------------------------------
TypeError: Either m or x-m must be an integer

Is this a bug?  I would say yes, because

sage: binomial(x,k)
binomial(x, k)

works, but maybe we want to have it be a specific integer if the top
number is given?  Any input?

- kcrisman

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to