Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

A hypergeom evaluation

22 views
Skip to first unread message

Peter Luschny

unread,
Jan 4, 2012, 12:22:09 PM1/4/12
to
F := (n,m) -> (m/n)*2^(n-m)*binomial(2*n-m-1,n-m)*hypergeom([1/2+m/2,m/
2,m-n],[m,1+m-2*n],2);
round(evalf(F(1,1),64));

Maple VR5 gives the value -I. Is this correct?

Cheers, Peter

Joe Riel

unread,
Jan 4, 2012, 1:42:02 PM1/4/12
to
with Maple 15:

simplify(F(1,1));
-I

--
Joe Riel

Axel Vogt

unread,
Jan 4, 2012, 1:59:46 PM1/4/12
to
Yes, it simplifies to 1/sqrt( 1 - z ) and z=2 gives it.

Peter Luschny

unread,
Jan 4, 2012, 2:08:13 PM1/4/12
to
On 4 Jan., 19:42, Joe Riel <j...@san.rr.com> wrote:
> Peter Luschny <peter.lusc...@googlemail.com> writes:

> > F := (n,m) -> (m/n)*2^(n-m)*binomial(2*n-m-1,n-m)*hypergeom([1/2+m/2,m/
> > 2,m-n],[m,1+m-2*n],2);
> > round(evalf(F(1,1),64));
> > Maple VR5 gives the value -I. Is this correct?

> with Maple 15:
> simplify(F(1,1));
-I

Thank you Joe! Wolfram Alpha computes 1.

Table[(m/n) 2^(n - m) Binomial[2 n - m - 1, n - m]
HypergeometricPFQ[{1/2 + m/2, m/2, m - n}, {m, 1 + m - 2 n}, 2], {n,
4}, {m, n}]
{{1}, {3, 1}, {14, 6, 1}, {77, 37, 9, 1}}

G. A. Edgar

unread,
Jan 5, 2012, 8:21:09 AM1/5/12
to
In article
<6d7f5214-ccd9-4a00...@v14g2000yqh.googlegroups.com>,
Since 2 is outside the radius of convergence, you will have to read the
documentation to find out what each of these systems does.

--
G. A. Edgar http://www.math.ohio-state.edu/~edgar/

Axel Vogt

unread,
Jan 5, 2012, 8:47:37 AM1/5/12
to

Peter Luschny

unread,
Jan 5, 2012, 1:01:30 PM1/5/12
to
On 5 Jan., 14:47, Axel Vogt <&nore...@axelvogt.de> wrote:

> http://www.wolframalpha.com/input/?i=HypergeometricPFQ%28{1%2C+1%2F2%2C+0}%2C{1%2C+0}%2Cx%29
> That shows the bug - giving 1 for all x.

Hi Axel,

I get the impression there is more than a single bug lurking beneath
all that.

First of all here is the expression which does what I want:

G := (n,m) -> (m/n)*2^(n-m)*binomial(2*n-1-
m,n-1)*hypergeom([1/2+1/2*m, m-n, 1/2*m],[m, 1+m-2*n],2)
-1/2*binomial(-m+1+2*n,n)*binomial(n-2,n-1)*hypergeom([1,1,-1/2*m
+3/2+n,-1/2*m+1+n],[-m+2+n, n+1,-n+2],2);

for n from 1 to 5 do seq(round(evalf(G(n,m))),m=1..n) od;
1
3, 1
14, 6, 1
77, 37, 9, 1
462, 238, 69, 12, 1

However, when I use 'simplify' (like Joe) instead of 'evalf' I get

for n from 1 to 5 do seq(simplify(G(n,m)),m=1..n) od;

1
-3 I, 1
-14 I, -8 - 14 I, 1
-77 I, -40 - 77 I, -60 - 93/2 I, 1
-462 I, -224 - 462 I, -336 - 288 I, -336 - 114 I, 1

Peter

Axel Vogt

unread,
Jan 5, 2012, 1:44:05 PM1/5/12
to
On 05.01.2012 19:01, Peter Luschny wrote:
> On 5 Jan., 14:47, Axel Vogt<&nore...@axelvogt.de> wrote:
>
>> http://www.wolframalpha.com/input/?i=HypergeometricPFQ%28{1%2C+1%2F2%2C+0}%2C{1%2C+0}%2Cx%29
>> That shows the bug - giving 1 for all x.
>
> Hi Axel,
>
> I get the impression there is more than a single bug lurking beneath
> all that.
...
> Peter

I meant, that Mathematica has a bug, since in the unit
disc that stands for 1/sqrt(1-x).

Sorry for the odd link, HypergeometricPFQ([1, 1/2, 0], [1, 0], x)
is what you have to enter at Wolframalpha, it is f(1,1, x) where

f:= (n,m, x) -> (m/n)*2^(n-m)*binomial(2*n-m-1,n-m)*
Hypergeom([1/2+m/2,m/2,m-n],[m,1+m-2*n],x); # Upper Case !

Maple writes it as Hypergeom([1, 1/2, 0],[1, 0],x). Either using
'value' or considering that in the unit disc as series it cab be
written as hypergeom([1/2],[],x), since the same nominators and
denominators cancel out.

Using simplify (or looking up books) this can be seen as square
root.

For the other part in your post I will answer separately.

Axel Vogt

unread,
Jan 5, 2012, 2:05:29 PM1/5/12
to
On 05.01.2012 19:01, Peter Luschny wrote:
Hm, in Maple 15 that code does not execute, G(2,1) gives me
"Error, (in hypergeom/check_parameters) function doesn't exist,
found the number 0 in the second list of parameters"

So I used

g := (n,m,x) -> (m/n)*2^(n-m)*binomial(2*n-1-m,n-1)*
Hypergeom([1/2+1/2*m, m-n, 1/2*m],[m, 1+m-2*n],x)
-1/2*binomial(-m+1+2*n,n)*binomial(n-2,n-1)*
Hypergeom([1,1,-1/2*m+3/2+n,-1/2*m+1+n],[-m+2+n, n+1,-n+2],x);

Then it works and gives me:

for n from 1 to 5 do seq(round(evalf(g(n,m,2))),m=1..n) od;

1
3, 1
14, 6, 1
77, 37, 9, 1
462, 238, 69, 12, 1

for n from 1 to 5 do seq(simplify(value( g(n,m,2) )),m=1..n) od;

1
3, 1
14, 6, 1
77, 37, 9, 1
462, 238, 69, 12, 1

What I can imagine (you have an old version and Maple certainly
worked on that hypgeom part as well):

Usually pFq for p=q+1 (as in your case) has a branch cut on the
real axis, starting in x=1, so your x=2 is *in* the branch cut.

Now Maple extends into the branch cut _counterclockwise_ seen
from the branch point (which x=1), if I remember correctly.
And that means: from below, i.e. limit(..., 2 + I*y, y=0,right).

May be there happens some difference between the (old) numerical
way and the symbolic way.

You may try by looking at 2 +- I* 2^(-k), k = 8,9,10, ...

But that may only affect the imaginary part (example: g(2,1,x)).

However in Maple 15 it works (up to notations as above).

Peter Luschny

unread,
Jan 5, 2012, 2:57:22 PM1/5/12
to
> On 5 Jan., 19:44, Axel Vogt <&nore...@axelvogt.de> wrote:
> I meant, that Mathematica has a bug, since in the unit
> disc that stands for 1/sqrt(1-x).

Yes, I understood this. So let us look at the culprit
hypergeom([1/2+m/2,m/2,m-n],[m,1+m-2*n],2);

According to the definition this is
H := (n,m,x) -> sum(pochhammer(1/2+m/2,k)*pochhammer(m/
2,k)*pochhammer(m-n,k)/(pochhammer(m,k)*pochhammer(1+m-2*n,k))*(x^k/
k!),k=0..infinity);

Let us evaluate H(1,1,x) in three different ways.

(1) H(n,1,x); simplify(%);subs(x=2,%); gives
hypergeom([1/2, 1-n],[2-2*n],2)

At n=1 the lower parameter is zero and thus the function is not well
defined at n=1.

(2) H(1,m,x); simplify(%);subs(x=2,%); gives
(1/2-1/2*I)*(1/2+1/2*I)^(-m)
which is -I at m=1. This is the value Maple returns.

(3) limit(H(n,m,x),n=1);subs(x=2,%);subs(m=1,%);evalf(%);
.5000000000-.5000000000*I

Why is (2) 'more correct' :) than (1) or (3)?

Peter Luschny

unread,
Jan 5, 2012, 3:17:10 PM1/5/12
to
On 5 Jan., 20:05, Axel Vogt <&nore...@axelvogt.de> wrote:

> Hm, in Maple 15 that code does not execute, G(2,1) gives me
> "Error, (in hypergeom/check_parameters) function doesn't exist,
> found the number 0 in the second list of parameters"

Makes sense according to the first case in my last message.

> So I used
>g := (n,m,x) -> (m/n)*2^(n-m)*binomial(2*n-1-m,n-1)*
> Hypergeom([1/2+1/2*m, m-n, 1/2*m],[m, 1+m-2*n],x)
> -1/2*binomial(-m+1+2*n,n)*binomial(n-2,n-1)*
> Hypergeom([1,1,-1/2*m+3/2+n,-1/2*m+1+n],[-m+2+n, n+1,-n+2],x);

Why Hypergeom and not hypergeom?

> Then it works and gives me:
> for n from 1 to 5 do seq(round(evalf(g(n,m,2))),m=1..n) od;

Ok, so in this case there is no difference to my results.

> for n from 1 to 5 do seq(simplify(value( g(n,m,2) )),m=1..n) od;
> However in Maple 15 it works (up to notations as above).

So they fixed at least one bug in the last 10 releases :)
But why does my version G(2,1) not work any more?

Axel Vogt

unread,
Jan 5, 2012, 5:02:22 PM1/5/12
to
On 05.01.2012 21:17, Peter Luschny wrote:
> On 5 Jan., 20:05, Axel Vogt<&nore...@axelvogt.de> wrote:
>
>> Hm, in Maple 15 that code does not execute, G(2,1) gives me
>> "Error, (in hypergeom/check_parameters) function doesn't exist,
>> found the number 0 in the second list of parameters"
>
> Makes sense according to the first case in my last message.
>
>> So I used
>> g := (n,m,x) -> (m/n)*2^(n-m)*binomial(2*n-1-m,n-1)*
>> Hypergeom([1/2+1/2*m, m-n, 1/2*m],[m, 1+m-2*n],x)
>> -1/2*binomial(-m+1+2*n,n)*binomial(n-2,n-1)*
>> Hypergeom([1,1,-1/2*m+3/2+n,-1/2*m+1+n],[-m+2+n, n+1,-n+2],x);
>
> Why Hypergeom and not hypergeom?

It does not evaluate ... Like "Int" and "int". Used some HYP
as dummy function before to see what happens to binomial.
A kind of reflex to get rid of the specific situation (which
once I was educated to do).

>
>> Then it works and gives me:
>> for n from 1 to 5 do seq(round(evalf(g(n,m,2))),m=1..n) od;
>
> Ok, so in this case there is no difference to my results.
>
>> for n from 1 to 5 do seq(simplify(value( g(n,m,2) )),m=1..n) od;
>> However in Maple 15 it works (up to notations as above).
>
> So they fixed at least one bug in the last 10 releases :)
> But why does my version G(2,1) not work any more?

Do not know, can not think 10 releases back :-)

Will (try to) answer the other post tomorrow ...

BTW: Gutes Neues! Axel

Axel Vogt

unread,
Jan 6, 2012, 5:37:34 AM1/6/12
to
Your H(n,m,x) is the Gaussian series 3F2(a,b,c, x) and H(n,1,x) is some
2F1(a,b,c, x), where I re-write it using Upper Case Sum (avoiding evaluation)
http://en.wikipedia.org/wiki/Gaussian_hypergeometric_series

A power series converges in a disc around x=0 within it radius of convergence r.
In general one has r=1 and it does not converge on the closed disc. However in
special cases depending on parameters it converges in x=+1 (Gauss).

So one can not simply insert x=2 in general,

H(n,1,x); convert(%, GAMMA);
eval(%, n=4/3); eval(%, x=2); value(%);

will give infinity.

Now extend it as 2F1=hypergeom([1/2, 1-n],[2-2*n],x) from the unit disc
by using the 'value' command, the Maple will refuse to handle n=1.

This is your way (1).

However writing the series as H(n,1,x); convert(%, GAMMA); one sees,
that it has the term GAMMA(2-2*n)/GAMMA(1-n) and the limit in n=1 is
1/2, which Maple uses for the following:

H(n,1,x); #convert(%, GAMMA);
limit(%, n=1);
value(%);

1/2 * 1/sqrt(1-x)

This was your way (3). While you way (2) can be written as

H(1,m,x); #convert(%, GAMMA);
limit(%, m=1);
value(%);

1/sqrt(1-x)

Thus you are taking limits in the parameters in different orders,
I would say.

Note however, that for x=2 taking those limits is questionable

r:=4;
H(1 + 1/2^r,1, 2); value(%);
H(1, 1 + 1/2^r, 2); value(%);

both are infinite.

Thus all that is usually understood as function in x, not in the
parameters, as it behave quite odd (guess that is one reason, why
Maple refuses its work for the way (1)).

Peter Luschny

unread,
Jan 6, 2012, 6:51:22 AM1/6/12
to
Axel, I agree with most of what you said.

> H(n,1,x); #convert(%, GAMMA);
> limit(%, n=1);
> value(%);
> 1/2 * 1/sqrt(1-x)
> This was your way (3). While you way (2) can be written as
> H(1,m,x); #convert(%, GAMMA);
> limit(%, m=1);
> value(%);
> 1/sqrt(1-x)
> Thus you are taking limits in the parameters in different orders,

The question here is: What is the reason that Maple V choose (2) over
(3)? Is this justified? The problem as stated -- H(n,m,x) -- does not
indicate that one parameter is to preferred over the other.

I am tending towards the answer (1). By definition the hypergeometric
sum is

H := (n,m,x) -> sum(pochhammer(1/2+m/2,k)*pochhammer(m/
2,k)*pochhammer(m-n,k)/(pochhammer(m,k)*pochhammer(1+m-2*n,k))*(x^k/
k!),k=0..infinity);

and this function is not well defined at n=1,m=1. Thus what you
reported

>> Hm, in Maple 15 that code does not execute, G(2,1) gives me
>> "Error, (in hypergeom/check_parameters) function doesn't exist,
>> found the number 0 in the second list of parameters"

looks reasonable for me (and makes the answer of Mathematica
incomprehensible).

Axel Vogt

unread,
Jan 6, 2012, 8:47:44 AM1/6/12
to
On 06.01.2012 12:51, Peter Luschny wrote:
> Axel, I agree with most of what you said.
...
> The question here is: What is the reason that Maple V choose (2) over
> (3)? Is this justified? The problem as stated -- H(n,m,x) -- does not
> indicate that one parameter is to preferred over the other.
....

I do not know, but these are different ways

(3*) limit(hypergeom([1/2, 1-n, 1],[1, 2-2*n],2),n = 1);
evalf[10](%);

Even if I do not know, what Maple does in evalf/limit to accelerate
it will certainly evaluate n close (but not identical) to 1, which
is ~ 0.5 + 0.5*I, thus the answer.

(2*) hypergeom([m-n, 1/2*m, 1/2+1/2*m],[m, 1+m-2*n],x)
eval(%, n=1);
simplify(%);subs(x=2,%);
eval(%, m=1);

through the 2nd command 'cancels' identical terms in the first and
the second parameter list, a kind of 'lifting away the problem',
the simplify converts it to a square root.





G. A. Edgar

unread,
Jan 7, 2012, 8:10:57 AM1/7/12
to
In article <9moccv...@mid.individual.net>, Axel Vogt
I do recall that a hypergeom need not be continuous (as a function of
the parameters) when a parameter passes an integer.
0 new messages