Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2004
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2004

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

Search the Archive

Re: Hypergeometric functions and Sum error in 5.01?

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

Richard,
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]
Gamma[1-m+n])
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
specified!

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
answer.


I hope this helps.
Peter


"Richard Ollerton" <R.Ollerton at uws.edu.au> wrote in message news:<clssqp$3km$1 at smc.vnet.net>...
> 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 uws.edu.au


  • 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?