Why does Wolfram Alpha get this binomial coefficient sum wrong?

1k Views Asked by At

The sum I want to evaluate is $\sum_{i=2}^m \binom{p-1}{i-2} * \binom{n-k}{m-i}$. Here we have $p<k<=n$ and $m<=n$, all positive integers; I don't know how to communicate that to Wolfram Alpha though.

The correct answer (I think) is $\binom{n-k+p-1}{m-(k-p)+1}$.

Wolfram Alpha gives: $\frac{(-1)^m (-2 + k + m - n - p)!}{(-2 + m)! (k - n - p)!}$. Is this somehow equivalent to the correct answer? Why does it give factorials of negative integers? (admittedly, I didn't give Wolfram Alpha enough info to know these were negative integers, although $(k-n-p)!$ is pretty bad given I have $n-k$ as the top of a binomial coefficient in the sum).

https://www.wolframalpha.com/input/?i=sum_%7Bi%3D2%7D%5Em+%28%28p-1%29+choose+%28i-2%29%29+*+%28%28n-k%29+choose+%28m-i%29%29