sympy/sympy

Open
opened this Issue Jan 4, 2017 · 0 comments

None yet

1 participant

Contributor
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) >>> ``````
added a commit to skirpichev/diofant that referenced this issue Jan 7, 2017
 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`
added a commit to skirpichev/diofant that referenced this issue Jan 8, 2017
 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`