I think your expected answer must be wrong, because it cannot contain k, since it is the summation variable.
I would check the various expressions (the unevaluated summation, the result before combsimp, the result after combsimp, and the expected result) numerically for various values of n. The results from the unevaluated Sum should be considered to be the true values, since those are just evaluated numerically. That will at least show which of Sum.doit, combsimp, and your expected result are right and wrong. Aaron Meurer On Sat, Sep 28, 2013 at 1:29 AM, Pablo Puente <[email protected]> wrote: > Hi, > > > Wester test case R4 sum(binomial(n, k)/2^n - binomial(n + 1, k)/2^(n + 1), > k) should return 2**(-n-1)*binomial(n,k-1). > > > Sympy is returning -2**(-n)/2 > > > I am making a mistake or do we have a bug here? > > n,k = symbols('n,k', integer=True, positive=True) > > sk = binomial(n, k)/(2**n) - binomial(n + 1, k)/(2**(n + 1)) > > S = Sum(sk, (k,1,oo)) > > T = S.doit() > > assert T.combsimp() == 2**(-n-1)*binomial(n,k-1) # returns -2**(-n)/2 > > > Thanks, > > Pablo Puente > > -- > You received this message because you are subscribed to the Google Groups > "sympy" 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. > For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups "sympy" 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. For more options, visit https://groups.google.com/groups/opt_out.
