5

Bug introduced in 9.0 or earlier and persisting through 11.0.1 or later


To evaluate $ \sum_{\substack{\text{even }k\\ 2\leq k\leq m-2}} \binom{m-2}{k-1}(k-1) $, where $m$ is an even integer.

Running the following in Mathematica 10.3.0 (October 9, 2015)

Simplify[Sum[Binomial[m - 2, k - 1] (k - 1), {k, 2, m-2, 2}], m/2 \[Element] Integers && m > 10]

gives

0

which is obviously wrong. It may not have a closed form but it shouldn't return 0.

user58955
  • 617
  • 3
  • 9
  • Seems like a bug Is that your question? – Dr. belisarius Feb 08 '16 at 22:26
  • @Dr.belisarius Yes – user58955 Feb 08 '16 at 23:11
  • Note that the Simplify is irrelevant. This sort of problem has been noted before. Example: http://mathematica.stackexchange.com/questions/78945/strange-evaluation-of-an-sum-involving-binomial-coefficients – Michael E2 Feb 09 '16 at 01:26
  • In my original answer I had made a mistake in the conversion between Binomail and Factorial. With the correction Sum[ (m - 2)!/((k - 2)! (m - k - 1)!), {k, 2, m - 2, 2}, Assumptions -> m/2 \[Element] Integers && m > 10] also returns 0 which is wrong. It appears that there is indeed a bug here. I have removed the original answer. – Jack LaVigne Feb 09 '16 at 08:14
  • Bug still exists in 10.4 – user58955 Mar 26 '16 at 04:06

3 Answers3

6

This is a bug in Sum.

In addition to the nice workarounds proposed by others, the substitution $m = 2p$ also leads to a correct answer for this example.

In[1]:= Sum[
   Binomial[2 p - 2, k - 1] (k - 1), {k, 2, 2 p - 2, 2}] /. {p -> 
    m/2} // Simplify


Out[1]= 2^(-4 + m) (-2 + m)

Sorry for the inconvenience caused by this problem.

J. M.'s missing motivation
  • 124,525
  • 11
  • 401
  • 574
Devendra Kapadia
  • 1,404
  • 10
  • 11
3

I would suggest defining your sum as a function

f[m_?NumericQ] := Sum[Binomial[m - 2, k - 1] (k - 1), {k, 2, m, 2}] /; EvenQ[m];

This evaluates fine and does not give zero when given numeric values.

The root of the problem seems to me to have to do with the definition of Binomial internaly as a combination of Gamma functions.

"In general,Binomial[n,m] is defined by [CapitalGamma] (n+1)/([CapitalGamma](m+1)[CapitalGamma](n-m+1)) or suitable limits of this."

As evidence, the expression

Sum[Binomial[m - 2, k - 1] (k - 1), {k, 2, m, 2}]

Evaluates to zero.

Lior Blech
  • 852
  • 5
  • 15
3

As a workaround for this incorrect simplification, you could use FindSequenceFunction on a sample of concrete results:

Clear[m,n,k];
Simplify[FindSequenceFunction[
   Table[
    Sum[Binomial[m - 2, k - 1] (k - 1), {k, 2, m, 2}], {m, 2, 12, 2}],
    n] /. n -> m/2]

(* ==> 2^(-4 + m) (-2 + m) *)

This is similar to the answer by @Coolwater here.

Jens
  • 97,245
  • 7
  • 213
  • 499