Consider the sum
$$\sum_{r=0}^n \binom{n-r-1}{n-r}$$
This sum is not zero because when $r=n$, the result is $\binom{-1}{0} = 1$. However, plugging this formula into Wolfram Alpha does return zero. Why is this?
Consider the sum
$$\sum_{r=0}^n \binom{n-r-1}{n-r}$$
This sum is not zero because when $r=n$, the result is $\binom{-1}{0} = 1$. However, plugging this formula into Wolfram Alpha does return zero. Why is this?
Mathematica has no problem with specific values of n until n == 10^6
Table[{n,
Sum[
Binomial[n - r - 1, n - r],
{r, 0, n}]},
{n, 999998, 10^6}] // Grid
As stated in the documentation for Sum, "If the range of a sum is finite, i is typically assigned a sequence of values, with f being evaluated for each one." The problem apparently occurs with the switch from enumerating the sum to symbolically evaluating the sum.
n. In the symbolic case, it is actually not sum that fails, because the problem is due to fact that Binomial[n - r - 1, n - r] evaluates to 0.
– Coolwater
Nov 01 '15 at 11:41
As noted, this is due to the fact that the indefinite sum is $0$:
Sum[Binomial[n - r - 1, n - r], r]
0
One simple cure is to split off the "peculiar" term,
Sum[Binomial[n - r - 1, n - r], {r, 0, n - 1}] + Binomial[n - n - 1, n - n]
but an even better route is to flip the binomial coefficient:
Assuming[n ∈ Integers,
Simplify[Sum[(-1)^(n - r) Binomial[0, n - r], {r, 0, n}]]]