simplifying combinatorial sum

51 views
Skip to first unread message

Nico Schlömer

unread,
Nov 23, 2017, 4:43:33 AM11/23/17
to sympy
Given natural numbers n, r, 0<=r<=n, I'm dealing with the expression


I have the strong suspicion that this can be simplified to a product of binomial coefficients. Is there any way that sympy can help me here?

Aaron Meurer

unread,
Nov 23, 2017, 2:15:55 PM11/23/17
to sy...@googlegroups.com
You can try using combsimp(). I think it has also received some improvements in master. 

You can also try using SymPy to evaluate the sum.

Aaron Meurer

--
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 sympy+unsubscribe@googlegroups.com.
To post to this group, send email to sy...@googlegroups.com.
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/4bc2df75-3944-4e69-abe2-eada30c3fc64%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Nico Schlömer

unread,
Nov 26, 2017, 9:23:08 AM11/26/17
to sy...@googlegroups.com
Turns out the sum is always 1(!). I wasn't able to prove this with sympy though. This
```
import sympy

n = sympy.Symbol('n')
r = sympy.Symbol('r')
i = sympy.Symbol('i')
j = sympy.Symbol('j')

s = sympy.Sum(sympy.Sum(
    (-1)**(i+j)
    * sympy.binomial(n+r+1, i) * sympy.binomial(n-r, i)
    * sympy.binomial(n+r+1, j) * sympy.binomial(n-r, j)
    / sympy.binomial(2*n+1, i+j),
    (j, 0, n-r)), (i, 0, n-r))
```
isn't very cooperative with `doit()`.

On Thu, Nov 23, 2017 at 8:15 PM Aaron Meurer <asme...@gmail.com> wrote:
You can try using combsimp(). I think it has also received some improvements in master. 

You can also try using SymPy to evaluate the sum.

Aaron Meurer

On Thu, Nov 23, 2017 at 2:43 AM, Nico Schlömer <nico.sc...@gmail.com> wrote:
Given natural numbers n, r, 0<=r<=n, I'm dealing with the expression


I have the strong suspicion that this can be simplified to a product of binomial coefficients. Is there any way that sympy can help me here?

--
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 sympy+un...@googlegroups.com.

To post to this group, send email to sy...@googlegroups.com.
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/4bc2df75-3944-4e69-abe2-eada30c3fc64%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "sympy" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sympy/J2pjEQZnSsc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sympy+un...@googlegroups.com.

To post to this group, send email to sy...@googlegroups.com.
Visit this group at https://groups.google.com/group/sympy.
Reply all
Reply to author
Forward
0 new messages