Alec Mihailovs

Dr. Aleksandrs Mihailovs

4495 Reputation

21 Badges

20 years, 342 days
Mihailovs, Inc.
Owner, President, and CEO
Tyngsboro, Massachusetts, United States

Social Networks and Content at Maplesoft.com

Maple Application Center

I received my Ph.D. from the University of Pennsylvania in 1998 and I have been teaching since then at SUNY Oneonta for 1 year, at Shepherd University for 5 years, at Tennessee Tech for 2 years, at Lane College for 1 year, and this year I taught at the University of Massachusetts Lowell. My research interests include Representation Theory and Combinatorics.

MaplePrimes Activity


These are replies submitted by Alec Mihailovs

One thing is that log2 should be log[2]. Even with that, Maple can't find the limit in general, which actually seems to be 0. Maple can find limits for particular values of p though,

f:=(p,x)->sum(p^k*(1-p)^(x-k)*log[2](binomial(x,k)), k = 0 .. x);

evalf(limit(f(0.1,x),x=infinity));
                                  0.
evalf(limit(f(0.5,x),x=infinity));
                                  0.
evalf(limit(f(0.9,x),x=infinity));
                                  0.

So trying to solve this limit for p which Maple understands as to find such p that the limit is 0, leads to nothing - it is 0 for any p (at least for p from 0 to 1.)

By the way, the expression in your first post was written in the best form. It can be copied and pasted into Maple. While maple tag may produce nice looking formulas, they can't be easily copied and pasted.

Alec

In this case, one of the solutions (if error messages are not desirable) is to use assigned,

inc:=(e::uneval)->assign(map(x->x=eval(x)+1,
    select(assigned,e))):

x,y:=10,20;
                            x, y := 10, 20
inc([x,y]);

x,y;
                                11, 21
inc([t,u]);

t,u;
                                 t, u

That is also not error-prone, because a variable with assumptions is also "assigned', but that gives an idea how that could be done properly.

Alec

In this case, one of the solutions (if error messages are not desirable) is to use assigned,

inc:=(e::uneval)->assign(map(x->x=eval(x)+1,
    select(assigned,e))):

x,y:=10,20;
                            x, y := 10, 20
inc([x,y]);

x,y;
                                11, 21
inc([t,u]);

t,u;
                                 t, u

That is also not error-prone, because a variable with assumptions is also "assigned', but that gives an idea how that could be done properly.

Alec

Certainly, I wouldn't do it that way if I needed something like that myself. At least, I would put it inside try-catch block.

It seems to be a kind of tradition on this site to skip try-catch (and/or other error handling technique) in examples.

Alec

Certainly, I wouldn't do it that way if I needed something like that myself. At least, I would put it inside try-catch block.

It seems to be a kind of tradition on this site to skip try-catch (and/or other error handling technique) in examples.

Alec

The difference is that constants, such as Pi, can not be entered by their name - numbers (or expressions evaluating to numbers, as I did) should be used instead. They don't have to be very precise (usually). In particular, 3.14 in place of Pi would work as well in this example. 

It may be considered as a bug, and there is no mentioning of that on the help page. The error message is misleading.

Alec 

The difference is that constants, such as Pi, can not be entered by their name - numbers (or expressions evaluating to numbers, as I did) should be used instead. They don't have to be very precise (usually). In particular, 3.14 in place of Pi would work as well in this example. 

It may be considered as a bug, and there is no mentioning of that on the help page. The error message is misleading.

Alec 

However, that doesn't produce the right picture. Something like following does (well, except wrong positioning of the outside circle which should be located in infinity),

addcoords(F, [Y1, Y2], 
    [(-2*ln(Y1))^(1/2)*cos(2*evalhf(Pi)*Y2), 
    (-2*ln(Y1))^(1/2)*sin(2*evalhf(Pi)*Y2)], 
    [0 .. 1, 0 .. 1, 5, 11, -4 .. 4, -4 .. 4]); 
plots:-coordplot(F, labelling = rear, axes = box);

Alec

However, that doesn't produce the right picture. Something like following does (well, except wrong positioning of the outside circle which should be located in infinity),

addcoords(F, [Y1, Y2], 
    [(-2*ln(Y1))^(1/2)*cos(2*evalhf(Pi)*Y2), 
    (-2*ln(Y1))^(1/2)*sin(2*evalhf(Pi)*Y2)], 
    [0 .. 1, 0 .. 1, 5, 11, -4 .. 4, -4 .. 4]); 
plots:-coordplot(F, labelling = rear, axes = box);

Alec

It works if the converted expression is assigned in Maple, and not typed by hand. For example,

s:=convert(hypergeom([a,b],[c],z),FormalPowerSeries, z);

s:= Sum( b[k]*a[k]*z^k/(c[k]*factorial(k)), k = 0 .. infinity )

convert(s, GAMMA);

Sum(GAMMA(b+k)*GAMMA(k+a)*GAMMA(c)*z^k/(GAMMA(b)*GAMMA(a)*GAMMA(c+k)*GAMMA(k+1)), k = 0 .. infinity)

should work OK.

Also, if the extended typesetting is turned off, such things as (z)n won't even appear - they would be displayed as pochhammer(z,n).

Alec

It works if the converted expression is assigned in Maple, and not typed by hand. For example,

s:=convert(hypergeom([a,b],[c],z),FormalPowerSeries, z);

s:= Sum( b[k]*a[k]*z^k/(c[k]*factorial(k)), k = 0 .. infinity )

convert(s, GAMMA);

Sum(GAMMA(b+k)*GAMMA(k+a)*GAMMA(c)*z^k/(GAMMA(b)*GAMMA(a)*GAMMA(c+k)*GAMMA(k+1)), k = 0 .. infinity)

should work OK.

Also, if the extended typesetting is turned off, such things as (z)n won't even appear - they would be displayed as pochhammer(z,n).

Alec

While the advice of replacing product with mul is correct, the cause of the error is different. It happens earlier, during evaluating the arguments of product. The error comes from

Z(k,pa,pb);
Error, (in Z) too many levels of recursion

mul doesn't evaluate arguments, so this problem doesn't occur in it.

That, by the way, can be checked by quoting the first argument in product, to prevent its premature evaluation,

Z:=(i, pa, pb)->if i=1 then (1-pa)*(1-pb) 
    else (((1-pa)*(1-pb))^((pa/(1-pa)+pb/(1-pb))^i))*
        product('1-Z(k, pa, pb)',k=1..i-1) end if;

also works OK, even if it is not the best way to do that. mul is better.

Alec

While the advice of replacing product with mul is correct, the cause of the error is different. It happens earlier, during evaluating the arguments of product. The error comes from

Z(k,pa,pb);
Error, (in Z) too many levels of recursion

mul doesn't evaluate arguments, so this problem doesn't occur in it.

That, by the way, can be checked by quoting the first argument in product, to prevent its premature evaluation,

Z:=(i, pa, pb)->if i=1 then (1-pa)*(1-pb) 
    else (((1-pa)*(1-pb))^((pa/(1-pa)+pb/(1-pb))^i))*
        product('1-Z(k, pa, pb)',k=1..i-1) end if;

also works OK, even if it is not the best way to do that. mul is better.

Alec

I've just installed Maple12 on my 64-bit Ubuntu 8.10 system, and got the same problem starting Maple - an empty grey screen without even toolbars.

The suggestions in the thread on ubuntuforums mentioned above didn't work. 

The suggestion given by Thomas Richard in this thread worked.

I did that as follows: opened ~/maple12/bin/maple file in a text editor and replaced lines 244 and 245,

 MAPLE_JRE_BIN="$MAPLE/jre.X86_64_LINUX/bin/"
 JRE_ROOT="$MAPLE/jre.X86_64_LINUX/lib"

with

 MAPLE_JRE_BIN="/usr/lib/jvm/java-6-sun/jre/bin/"
 JRE_ROOT="/usr/lib/jvm/java-6-sun/jre/lib"

Thus far (for a few minutes) everything seems to work fine, including plotting and help system.

Alec

Edit: Just updated Maple to version 12.01 and had to edit the ~/maple12/bin/maple file again (the same way), because it was replaced during the update. Again, everything looks fine thus far (for a few minutes) after that. -Alec

 

My computer was hacked at that time, so the IP may be the same. At that time I tried to install Maple (but didn't finish the installation) and slightly released my firewall restrictions - it seems as if one of the opened ports was used. The credit cards numbers and other sensitive information was encrypted, and it seems OK at this time, but few opened applications, including Firefox with opened Mapleprimes page seem to be getting explored.

Anyway, I think that it was just a practical joke of one of my hacker friends, because none of actual damage was done.

Alec

First 87 88 89 90 91 92 93 Last Page 89 of 180