Group Abstract Group Abstract

Message Boards Message Boards

0
|
4.6K Views
|
5 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Get right results with binomial functions in MMA 7?

Posted 9 years ago

Hello all,

I am using Mathematica version 7 and would like to ask a question to those using newer versions.

The expression

t1 = Sum[ j Binomial[A, j] Binomial[B, n - j], {j, 0, n}]

can be calculated by pencil and paper giving as result

A Binomial[ A + B - 1, n - 1]

while evaluating the expression for t1 (on my system) yields

-(((-1)^n A (-1 - A - B + n)!)/((-A - B)! (-1 + n)!))

Feeding numbers to it gives

In[58]:= A Binomial[ A + B - 1, n - 1] /. A -> 7 /. B -> 5 /. n -> 4

Out[58]= 1155

but

In[60]:= t1 /. A -> 7 /. B -> 5 /. n -> 4

Out[60]= 0

Obviously something is severely wrong!

The same thing comes along with

In[15]:= t2 = Sum[ j^2  Binomial[A, j] Binomial[B, n - j], {j, 0, n}]

    Out[15]= ((-1)^n A (B - n + A n) (-1 - A - B + n)!)/((1 - A - B)! (-1 + n)!)

which is evaluated by the paper and pencil method to

A (A - 1 + (A + B - 1)/(n - 1)) Binomial[A + B - 2, n - 2]

with striking differences when you feed numbers in.

What do the newer versions of Mma say to this?

Regards, Hans Dolhaine

POSTED BY: Hans Dolhaine
5 Replies

MMa 11 says:

In[1]:= t1 = Sum[j Binomial[A, j] Binomial[B, n - j], {j, 0, n}]

Out[1]= A Binomial[-1 + A + B, -1 + n]

In[2]:= % /. {A -> 7, B -> 5, n -> 4}

Out[2]= 1155

In[3]:= t2 = Sum[j^2 Binomial[A, j] Binomial[B, n - j], {j, 0, n}]

Out[3]= ((-1)^n A (B - n + 
   A n) (-1 - A - B + n)!)/((1 - A - B)! (-1 + n)!)

Hello, thanks. That is sort of much better, but the result for t2 is still, say, less than optimal. (Try to give numbers into t2 and compare this with the correct pencil&paper result)

POSTED BY: Hans Dolhaine

If this is an unknown bug, you must/can submit it to the support.

How to do this?

POSTED BY: Hans Dolhaine

You can use this link:

Support

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard