MathGroup Archive 2004

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Hypergeometric functions and Sum error in 5.01?

  • To: mathgroup at
  • Subject: [mg51841] Re: Hypergeometric functions and Sum error in 5.01?
  • From: p-valko at (Peter Valko)
  • Date: Wed, 3 Nov 2004 01:25:17 -0500 (EST)
  • References: <clssqp$3km$>
  • Sender: owner-wri-mathgroup at

I think there is nothing wrong here, except that Mathematica seduces
people to use a bit more complicated syntax then absolutely necessary.

If I define the following two functions:
s1[n_, m_] = Gamma[1+n] Hypergeometric2F1[1,m-n,-n,2]/(Gamma[1+m]
s2[n_, m_] := Total[Table[Binomial[n - i, m]2^i, {i, 0, n - m}]]

then both s1[3,1]  and s2[3,1] give the same result that is 11.

Note that for s2 I use delayed definition, because I do not want
Mathematica to do anything before n and m have been completely

In your original post Sum was embedded in Table. I would not recommend
that, because Sum is sometimes a simple programming construct doing
summation as it is done in a procedural language, but Sum is also a
function that does a lot of symbolic things, and you just do not know
what is happening especially if you combine them with Replace.
However, I think the real killer in your original post was how you
evaluated your s1.
If you use first one substitution for n, then another for m,
Mathematica tries to generate intermediate results and can be derailed
(see ComplexInfinity). However, if you simply evalute

Gamma[1 + n]Hypergeometric2F1[1, m - n, -n, 2]/(Gamma[1 + m] Gamma[
        1 - m + n]) /. {n -> 3, m -> 1}
with simultanious substitution of n and m, then you get the right

I hope this helps.

"Richard Ollerton" <R.Ollerton at> wrote in message news:<clssqp$3km$1 at>...
> Mathematica 5.01 produces the following:
> In[1]:= s1=Sum[Binomial[n-i,m]2^i,{i,0,n-m}]
> Out[1]= Gamma[1+n] Hypergeometric2F1[1,m-n,-n,2] / (Gamma[1+m] Gamma[1-m+n])
> In[2]:= Table[{s1,Sum[Binomial[n-i,m]2^i,{i,0,n-m}]}/.n®3,{m,1,3}]
> Out[2]= {{-5,11},{-11,5},{-15,1}}
> Out[2] compares Mathematica's closed form with actual values.  There appears to be an error in the rules used by Sum when simplifying this expression.
> Richard Ollerton
> r.ollerton at

  • Prev by Date: Re: NMaximize woes
  • Next by Date: Re: Re: Zero divided by a number...
  • Previous by thread: Re: Hypergeometric functions and Sum error in 5.01?
  • Next by thread: Re: Re: Hypergeometric functions and Sum error in 5.01?