Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

How do you persuade Mathematica to give simple identities involving binomial sums. For example

Sum[Binomial[a,i]*Binomial[b,i],{i,0,n}]

where n is bigger than both a and b.

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

Use Assumptions to get the result you expected.

In[1]:= $Assumptions = 
 n > a > 0 && n > b > 0 && a \[Element] Integers && b \[Element] Integers;


In[2]:= Sum[Binomial[a, i]*Binomial[b, i], {i, 0, n}]
Out[2]= Gamma[1 + a + b]/(Gamma[1 + a] Gamma[1 + b])

In[3]:= FullSimplify[%]
Out[3]= (a + b)!/(a! b!)

Note that it does give a generally valid result without these assumptions too. Here the assumptions helped us obtain a simpler result. I used the $Assumptions global variable here to avoid typing the assumptions twice, for Sum and FullSimplify.

share|improve this answer
    
Thank you. Out of interest, can it persuaded to give Binomial[a+b,a] as the output? –  Anush Jan 31 at 20:34
    
@Anush I don't know if it can do that automatically. As you see, FullSimplify doesn't. –  Szabolcs Jan 31 at 20:36
1  
@Anush: If that particular result for this particular case is the desired end result, you can use something like Assuming[n > a > 0 && n > b > 0 && {a, b} \[Element] Integers, FullSimplify[ Sum[Binomial[a, i]*Binomial[b, i], {i, 0, n}]]] /. (x_ + y_)!/(x_! y_!) :> Binomial[x + y, x] to get it. –  rasher Feb 1 at 0:41
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.