solution not found by Sum and gosper_sum #12018

Open
rwst opened this Issue Jan 4, 2017 · 0 comments

Projects

None yet

1 participant

@rwst
Contributor
rwst commented Jan 4, 2017

This should be found by gosper_sum. It is Exercise 5.7.11a from the A==B book.

>>> binomial(n + 1, k)/2**(n + 1) - binomial(n, k)/2**n
 -n - 1 ⎛n + 1⎞    -n ⎛n⎞
2      ⋅⎜     ⎟ - 2  ⋅⎜ ⎟
        ⎝  k  ⎠       ⎝k⎠
>>> Sum(_,(k,0,n))
  n                              
 ____                            
 ╲                               
  ╲   ⎛ -n - 1 ⎛n + 1⎞    -n ⎛n⎞⎞
   ╲  ⎜2      ⋅⎜     ⎟ - 2  ⋅⎜ ⎟⎟
   ╱  ⎝        ⎝  k  ⎠       ⎝k⎠⎠
  ╱                              
 ╱                               
 ‾‾‾‾                            
k = 0                            
>>> gosper_sum(binomial(n + 1, k)/2**(n + 1) - binomial(n, k)/2**n,k)
>>>
@skirpichev skirpichev added a commit to skirpichev/diofant that referenced this issue Jan 7, 2017
@skirpichev skirpichev Use cancel in hypersimp
The reveal some cases of hypergeometric terms.

Fixes sympy/sympy#12018

Please note that Sum.doit does the job too, but it doesn't
use Gosper algorithm in this case:

In [3]: n, k = Symbol('n', integer=True, positive=True), Symbol('k', integer=True)

In [4]: summation(binomial(n + 1, k)/2**(n + 1) - binomial(n, k)/2**n, (k, 0, n)).simplify()
Out[4]:
  -n - 1
-2
7504f51
@skirpichev skirpichev added a commit to skirpichev/diofant that referenced this issue Jan 8, 2017
@skirpichev skirpichev Use combsimp in hypersimp
The reveal some cases of hypergeometric terms.

Fixes sympy/sympy#12018

Please note that Sum.doit does the job too, but it doesn't
use Gosper algorithm in this case:

In [3]: n, k = Symbol('n', integer=True, positive=True), Symbol('k', integer=True)

In [4]: summation(binomial(n + 1, k)/2**(n + 1) - binomial(n, k)/2**n, (k, 0, n)).simplify()
Out[4]:
  -n - 1
-2
781023a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment