6
$\begingroup$

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?

$\endgroup$
3
  • 4
    $\begingroup$ Provide the code of your formula in Mathematica $\endgroup$
    – Artes
    Nov 1 '15 at 1:23
  • $\begingroup$ I just used the online wepage of mathematica, I plugged sum r=0,n binomial (n-r-1, n-r) $\endgroup$ Nov 1 '15 at 6:13
  • 1
    $\begingroup$ Wolfram Alpha is a very different beast from Mathematica. From your original question, you used the former, but called it the latter, so I corrected it. But once more: the two things are very different. $\endgroup$
    – J. M.'s torpor
    Nov 1 '15 at 7:31
5
$\begingroup$

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

enter image description here

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.

$\endgroup$
1
  • 1
    $\begingroup$ However, this doesn't explain why Mathematica fails for a symbolic 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. $\endgroup$
    – Coolwater
    Nov 1 '15 at 11:41
3
$\begingroup$

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}]]]
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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