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

Problem with Sum

1 view
Skip to first unread message

Michael Zedler

unread,
Aug 19, 2008, 9:25:46 AM8/19/08
to
Hello,

the following gives unfortunately an error in Maple12:

Sum(binomial(n,k)/binomial(2*n,k)/k!*(2*x)^k,k=0..n);
value(%);
simplify(%);

Can somebody shed some light onto what's going wrong there?
Michael

Preben Alsholm

unread,
Aug 19, 2008, 10:18:54 AM8/19/08
to
Michael Zedler skrev:

It seems to be a simple error. binomial(2*n,2*n+1) in the denominator of
the value should have been binomial(2*n,2*n-1):

S:=Sum(binomial(n,k)/binomial(2*n,k)/k!*(2*x)^k,k=0..n);
res:=value(S);
eval(res,n=10);
res1:=subs(binomial(2*n,2*n+1)=binomial(2*n,2*n-1),res);
plot(eval(S-res1,n=10),x=0..3);

How it originates, I don't know.

Preben Alsholm

G. A. Edgar

unread,
Aug 19, 2008, 10:16:12 AM8/19/08
to
In article <g8ehkt$lc9$1...@news.lrz-muenchen.de>, Michael Zedler
<michael...@tum.de> wrote:

What's wrong, I don't know. If you replace your value by
value(%) assuming n::posint;
we see that even Maple knows there is a problem in that case.

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

Preben Alsholm

unread,
Aug 19, 2008, 10:34:24 AM8/19/08
to
Preben Alsholm skrev:
> Michael Zedler skrev:

>> Sum(binomial(n,k)/binomial(2*n,k)/k!*(2*x)^k,k=0..n);
>> value(%);
>> simplify(%);
>>
>> Can somebody shed some light onto what's going wrong there?
>> Michael
>
> It seems to be a simple error. binomial(2*n,2*n+1) in the denominator of
> the value should have been binomial(2*n,2*n-1):
>

I'm afraid I was too hasty here. The numerator of the second term in the
result also vanishes. Although my remedy seems to cure the problem it
does so only because anything not vanishing in the denominator is Ok.

Preben Alsholm

Alec Mihailovs

unread,
Aug 19, 2008, 5:26:26 PM8/19/08
to
"Michael Zedler" <michael...@tum.de> wrote in message
news:g8ehkt$lc9$1...@news.lrz-muenchen.de...

> Sum(binomial(n,k)/binomial(2*n,k)/k!*(2*x)^k,k=0..n);


> Can somebody shed some light onto what's going wrong there?

This is 1 for n=0 and hypergeom([-n], [-2*n], 2*x) for integer n>0, which
can be also written as KummerM(-n,-2*n,2*x) and expressed in terms of
.associated Laguerre polynomials.

Maple is erroneously using formula for hypergeom([a],[b],2*x) with a>=0,
b>=0 which is wrong here.

Alec

Michael Zedler

unread,
Aug 20, 2008, 4:15:48 AM8/20/08
to
Alec Mihailovs schrieb:

Thank you very much. In the meantime I found that
T:=(n,x)->(2*x)^(n+1/2)*exp(x)*BesselK(n+1/2,x)*n!/(2*n)!/sqrt(Pi)
does the job for every non-negative integer n.

Is there a way using Maple to show that
T(n,x)-hypergeom([-n], [-2*n], 2*x);
is zero?
simplify(subs(n=n+1,%),symbolic) assuming n::posint;
doesn't work, unfortunately.

Thanks,
Michael

Alec Mihailovs

unread,
Aug 20, 2008, 4:42:32 AM8/20/08
to
> Is there a way using Maple to show that
> T(n,x)-hypergeom([-n], [-2*n], 2*x);
> is zero?

It can be, probably, done, either using recurrence relations, or
differential equations. If you know how to do that by hand, that, probably,
can be reproduced in Maple.

Frankly, I am surprised that somebody is still using Maple. I stopped using
it about 2-3 years ago.

Everybody that I know (I mean mathematicians) is using SAGE.

Alec

Alec Mihailovs

unread,
Aug 20, 2008, 5:17:23 AM8/20/08
to
"Michael Zedler" <michael...@tum.de> wrote in message
news:g8gjrn$r7j$1...@news.lrz-muenchen.de...

> Thank you very much. In the meantime I found that
> T:=(n,x)->(2*x)^(n+1/2)*exp(x)*BesselK(n+1/2,x)*n!/(2*n)!/sqrt(Pi)
> does the job for every non-negative integer n.
>
> Is there a way using Maple to show that
> T(n,x)-hypergeom([-n], [-2*n], 2*x);

One way of doing that is

gfun[holexprtodiffeq]((2*x)^(n+1/2)*exp(x)*BesselK(n+1/2,x)*n!/(2*n)!/sqrt(Pi),y(x));
/ 2 \
/d \ |d |
2 y(x) n + (-2 n - 2 x) |-- y(x)| + |--- y(x)| x
\dx / | 2 |
\dx /

gfun[holexprtodiffeq](hypergeom([-n],[-2*n],2*x),y(x));

/ 2 \
/d \ |d |
{2 y(x) n + (-2 n - 2 x) |-- y(x)| + |--- y(x)| x, y(0) = 1}
\dx / | 2 |
\dx /
The only thing that is left to be checked is that y(0)=1 for the first
expression.

Alec

G. A. Edgar

unread,
Aug 20, 2008, 7:44:48 AM8/20/08
to
>
> Frankly, I am surprised that somebody is still using Maple. I stopped using
> it about 2-3 years ago.
>

But why are you still posting in this newsgroup?

Thomas Richard

unread,
Aug 20, 2008, 12:04:43 PM8/20/08
to
On 20 Aug., 10:15, Michael Zedler <michael.zed...@tum.de> wrote:

> Thank you very much. In the meantime I found that
> T:=(n,x)->(2*x)^(n+1/2)*exp(x)*BesselK(n+1/2,x)*n!/(2*n)!/sqrt(Pi)
> does the job for every non-negative integer n.
>
> Is there a way using Maple to show that
> T(n,x)-hypergeom([-n], [-2*n], 2*x);
> is zero?

The shortest approach is probably:

convert(T(n,x),hypergeom) assuming n::nonnegint;

--
Thomas Richard
Maple Support
Scientific Computers GmbH
http://www.scientific.de

Axel Vogt

unread,
Aug 20, 2008, 12:58:24 PM8/20/08
to
Thomas Richard wrote:
> On 20 Aug., 10:15, Michael Zedler <michael.zed...@tum.de> wrote:
>
>> Thank you very much. In the meantime I found that
>> T:=(n,x)->(2*x)^(n+1/2)*exp(x)*BesselK(n+1/2,x)*n!/(2*n)!/sqrt(Pi)
>> does the job for every non-negative integer n.
>>
>> Is there a way using Maple to show that
>> T(n,x)-hypergeom([-n], [-2*n], 2*x);
>> is zero?
>
> The shortest approach is probably:
>
> convert(T(n,x),hypergeom) assuming n::nonnegint;

:-)

Alec Mihailovs

unread,
Aug 20, 2008, 1:58:20 PM8/20/08
to
> But why are you still posting in this newsgroup?

Just accidentally added it to the list of subscribed newsgroups. I didn't
post here for a long time, and, probably, won't post much again. It was
interesting to see some familiar names though.

Alec

Alec Mihailovs

unread,
Aug 20, 2008, 2:07:40 PM8/20/08
to
> The shortest approach is probably:
>
> convert(T(n,x),hypergeom) assuming n::nonnegint;

By the way, for n=0 it is a bug. T(0,x) = 1 and hypergeom([0],[0],2*x) =
exp(2*x).

Alec


Alec Mihailovs

unread,
Aug 20, 2008, 2:57:09 PM8/20/08
to
> The only thing that is left to be checked is that y(0)=1 for the first
> expression.

Actually, the differential equation is of 2nd order, so another thing also
has to be checked for both of them - that the derivative at 0 equals 1.

It is easy to do manually, but Maple has problems with that for the
expression with BesselK, as well as for finding its limit at 0.

Alec

Axel Vogt

unread,
Aug 20, 2008, 3:32:47 PM8/20/08
to

I think that is a limiting problem (using F instead of T as notation):

F(n,x)-hypergeom([-n], [-2*n], 2*x);
subs(n=0,%); subs(x=0, %);
value(%);


gives 0, since the first step gives 1 - exp(2*x)

But for x= 0 the first term F gets troubles

Alec Mihailovs

unread,
Aug 20, 2008, 4:36:55 PM8/20/08
to
"Thomas Richard" <t.ri...@scientific.de> wrote in message
news:e09862cf-4303-4bda...@z72g2000hsb.googlegroups.com...

> On 20 Aug., 10:15, Michael Zedler <michael.zed...@tum.de> wrote:
>
>> Thank you very much. In the meantime I found that
>> T:=(n,x)->(2*x)^(n+1/2)*exp(x)*BesselK(n+1/2,x)*n!/(2*n)!/sqrt(Pi)
>> does the job for every non-negative integer n.
>>
>> Is there a way using Maple to show that
>> T(n,x)-hypergeom([-n], [-2*n], 2*x);
>> is zero?
>
> The shortest approach is probably:
>
> convert(T(n,x),hypergeom) assuming n::nonnegint;

Here is another bug related to that. Let F be the first term in the answer
to the sum problem given by Maple,

F:=(n,x)->BesselI(-n-1/2,x)*GAMMA(-n+1/2)*x^(n+1/2)/2^(n+1/2)*exp(x);

Now, convert it to hypergeom using the same approach,

convert(F(n,x),hypergeom) assuming n::nonnegint;

hypergeom([-n], [-2 n], 2 x)

So what, F equals T?

is(convert(F(n,x)=T(n,x),hypergeom)) assuming n::nonnegint;

true

But it is obviously false. For example,

simplify(T(1,x)=F(1,x));

x + 1 = -(sinh(x) x - cosh(x)) exp(x)

which is clearly wrong.

Alec

Alec Mihailovs

unread,
Aug 20, 2008, 5:04:47 PM8/20/08
to
Conversion to BesselK is also wrong,

convert(F(n,x),BesselK) assuming n::nonnegint;
(n + 1/2)
(2 x) BesselK(n + 1/2, x) exp(x)
-----------------------------------------
1/2
Pi pochhammer(n + 1, n)

convert(%,factorial);

(n + 1/2)
(2 x) exp(x) BesselK(n + 1/2, x) n!
--------------------------------------------
1/2
(2 n)! Pi

T(n,x);

(n + 1/2)
(2 x) exp(x) BesselK(n + 1/2, x) n!
--------------------------------------------
1/2
(2 n)! Pi

The same answers. But we know that F is not equal to T.

Alec

Alec Mihailovs

unread,
Aug 23, 2008, 3:38:59 PM8/23/08
to
"Michael Zedler" <michael...@tum.de> wrote in message
news:g8ehkt$lc9$1...@news.lrz-muenchen.de...

Now, compare this thread with the thread that I started in Mathematica
group,

http://groups.google.com/group/comp.soft-sys.math.mathematica/browse_thread/thread/b84ac9c2a48f1bc1?hl=en#

Look at the Devendra Kapadia (Wolfram Research) response there.

What a difference comparing to Maplesoft (absent) reaction here, or in other
threads in this group or on Mapleprimes!

I got a very nice reply from Wolfram Research, the problem was addressed, a
workaround was suggested, and I wasn't even asked to fill the SCR (software
change request.)

Alec

0 new messages