Items tagged with bug

Feed

L := sum( 1/ln(k), k=2..n ) * ln(n)/n;
        
limit(L, n=infinity);
                               0
# Should be 1

Just curious: in Maple 2017, is it OK?

 

The is and coulditbe commands of Maple are known to be buggy.
Here are some math inventions done by these commands in Maple 2016.2.

restart; assume(x::real, y::real);
is(exp(x+I*y) <> 0);
                             false
coulditbe(exp(x+I*y) = 0);
                              true
coulditbe(exp(x+I*y) = infinity);
                              true
coulditbe((x+I*y)^2 = infinity);
                              true

It should be noticed that

is((-infinity)::real);
                             false

though

exp(-infinity+0*I);
                               0

The latter means

limit(exp(x),x=-infinity);
                                   0

, no more and no less.

Let us consider 

sol := pdsolve({diff(u(x, t), t)-(diff(v(x, t), x))+u(x, t)+v(x, t) = (1+t)*x+(x-1)*t^2, diff(v(x, t), t)-(diff(u(x, t), x))+u(x, t)+v(x, t) = (1+t)*x*t+(2*x-1)*t}, {u(0, t) = 0, u(x, 0) = 0, v(0, t) = 0, v(x, 0) = 0}, time = t, numeric, timestep = 0.1e-1, spacestep = 0.1e-1, range = 0 .. 1); 
sol:-plot3d(v(x, t), x = 0 .. 1, t = 0 .. 1);

A nice plot similar to the one produced by Mma (see the  attached pdf file pdesystem.pdf) is expected. 
The exact solutions u(x,t)=x*t,v(x,t)=x*t^2 are known

pdetest({u(x, t) = x*t, v(x, t) = x*t^2}, {diff(u(x, t), t)-(diff(v(x, t), x))+u(x, t)+v(x, t) =
(1+t)*x+(x-1)*t^2, diff(v(x, t), t)-(diff(u(x, t), x))+u(x, t)+v(x, t) = (1+t)*x*t+(2*x-1)*t});
                              {0}

But the wrong result

               module() ... end module         
Error, (in pdsolve/numeric/plot3d) unable to compute solution for t>HFloat(0.26000000000000006):
solution becomes undefined, problem may be ill posed or method may be ill suited to solution

is obtained. Also 

sol:-plot3d(v(x, t), x = 0 .. 1, t = 0 ..0.1);


 

The plot 

sol:-plot3d(v(x, t), x = 0 .. .5, t = 0 .. .1);

is not better.


 

restart;

Digits:=10;
to 10 do
evalf(add(sin(k), k = 1 .. 10000)) od;

10

 

1.633891035

 

1.633891035

 

1.633891035

 

1.633891046

 

1.633891046

 

1.633891046

 

1.633891012

 

1.633891012

 

1.633891012

 

1.633891049

(1)

restart;   # execute several times to obtain randomness

interface(version);

`Standard Worksheet Interface, Maple 2016.2, Windows 7, January 13 2017 Build ID 1194701`

(2)

Digits:=18;

18

(3)

to 10 do  
evalf(add(sin(k), k = 1 .. 10000)) od;

1.63389102179246197

 

1.63389102179246223

 

1.63389102179246223

 

1.63389102179246233

 

1.63389102179246233

 

1.63389102179246242

 

1.63389102179246242

 

1.63389102179246371

 

1.63389102179246371

 

1.63389102179246410

(4)

 

Let us consider 

with(Statistics);
U := RandomVariable(DiscreteUniform(-10, 10)):
V := RandomVariable(DiscreteUniform(-10, 10)):
Probability(U^2-V^2 <= 1/9, numeric);
  0.

, whereas a positive number greater than 1/21 is expected. 

 

Let us consider the example from Maple help to ?ProbabilityFunction (also see ?Geometric)

with(Statistics):
ProbabilityFunction(Geometric(1/3), 5);
                              32 /729
                             

Let us continue the investigation

ProbabilityFunction(Geometric(1/3), 5.1);
0.4215152817e-1
ProbabilityFunction(Geometric(1/3), 5.12);
0.4181109090e-1
ProbabilityFunction(Geometric(1/3), 51/10)
(32/2187)*2^(1/10)*3^(9/10)

whereas the result 0 is expected in all the three cases up to Wiki. I am aware of the line

"t-algebraic; point (assumed to be an integer)"

in the help. However, 

ProbabilityFunction(Geometric(1/3), -.5);
                               0

The same issue with the DiscreteUniform distribution. This bug lasts from  at least Maple 16. The question arises: may we trust Maple?

Hello;

Maple can't translate this valid Mathematica expression, it gives error

restart;
with(MmaTranslator):
eq:=FromMma(`x^2(a+y[x])^2 y'[x]==(1+x^2)(a^2+y[x]^2)`);

Error, (in MmaTranslator:-FromMma) The form, a^b^c, is found in the expression. It means either (a^b)^c or a^(b^c). Please use parentheses to clarify the meaning


But there is nothing wrong with the above expression. It is valid Mathematica expression. I found why Maple is confused. It needed a SPACE after the first x^2. So the following works in Maple

eq:=FromMma(`x^2 (a+y[x])^2 y'[x]==(1+x^2)(a^2+y[x]^2)`);

And now the error went away.  But a space not needed in Mathematica. It works either way.

Maple 2016.1 on windows.

 

 

Let us consider

restart; Digits := 20; evalf(Int(abs(cos(1/t)), t = 0 .. 0.1e-1), 3);
   -0.639e-2

Pay your attention to the minus sign. Simply no words. Mma produces 0.006377.

evalf@Int.mw

Let us consider 

Student[Precalculus]:-LimitTutor(sqrt(x), x = 2);

One expects a nice illustration of the result sqrt(2). But instead of that one reads "f(x) approaches 1.41 as x approaches 2". This is simply ignorant and forms a wrong understanding of limits. It should also be noticed that all the entries (left, 2-sided, and right) produce the same animation. The same issue with other limits I tried, e.g.

Student[Precalculus]:-LimitTutor(sqrt(x), x = 1);

. I think this command should be completely rewritten or excluded from Maple. 

Let us consider 

Statistics:-Mode(Binomial(n, p));
                        floor((1 + n) p)

Up to Wiki, the output is not correct. Simply no words.

There seems to be a bug in determining the folowing integral analytically:

integrate(-(3/2*(exp(-(1/4)*x)*x-sqrt(Pi)*erf((1/2)*sqrt(x))*sqrt(x)))/(sqrt(x)*sqrt(Pi)*erf((1/2)*sqrt(x))), x = 0..1)

Maple gives as a result

3/2

However, numerically integrating it

integrate(-(3/2*(exp(-(1/4)*x)*x-sqrt(Pi)*erf((1/2)*sqrt(x))*sqrt(x)))/(sqrt(x)*sqrt(Pi)*erf((1/2)*sqrt(x))), x=0..1,numeric)

gives

0.1195461293

In fact, integrating it from a to b,

integrate(-(3/2*(exp(-(1/4)*x)*x-sqrt(Pi)*erf((1/2)*sqrt(x))*sqrt(x)))/(sqrt(x)*sqrt(Pi)*erf((1/2)*sqrt(x))), x=a..b)

gives

-3/2 a + 3/2 b

suggesting that Maple thinks the integrand is just 3/2. If one plots it, then it becomes obvious that this is not the case.


 

with(Statistics):````

X := Statistics:-RandomVariable(Normal(0, 1)):

PDF(sin(X), t)

piecewise(t <= -1, 0, t < 1, 2^(1/2)*exp(-(1/2)*arcsin(t)^2)/(Pi^(1/2)*(-t^2+1)^(1/2)), 1 <= t, 0)

(1)

int(%, t = -1 .. 1)

2*erf((1/4)*Pi*2^(1/2))

(2)

evalf(%)

1.767540069

(3)

``


There were recently submitted a dozen Maple bugs by me and others. Maplesoft have brought no responses. They keep strategic silence. True merit is not afraid of criticism.

Download Bug_in_Statistics_PDF.mw


 

I found a strange bug in int.
For some functions f(x), Maple is able to compute the antiderivative (correctly) but refuses to compute the definite integral.
Or, computes the integral over 0..1  and  0..2  but refuses to compute over 1..2.

int(exp(x^3), x);  #ok

-(1/3)*(-1)^(2/3)*((2/3)*x*(-1)^(1/3)*Pi*3^(1/2)/(GAMMA(2/3)*(-x^3)^(1/3))-x*(-1)^(1/3)*GAMMA(1/3, -x^3)/(-x^3)^(1/3))

(1)

int(exp(x^3), x=1..2); #?

int(exp(x^3), x = 1 .. 2)

(2)

int(exp(x^3), x=1..2, method=FTOC); #??

int(exp(x^3), x = 1 .. 2, method = FTOC)

(3)

int(exp(x^3), x=0..2); #?

int(exp(x^3), x = 0 .. 2)

(4)

int(exp(-x^3), x);  #ok

(3/4)*x*exp(-(1/2)*x^3)*WhittakerM(1/6, 2/3, x^3)/(x^3)^(1/6)+exp(-(1/2)*x^3)*WhittakerM(7/6, 2/3, x^3)/(x^2*(x^3)^(1/6))

(5)

int(exp(-x^3), x=0..2);  #ok

(3/4)*2^(1/2)*exp(-4)*WhittakerM(1/6, 2/3, 8)+(1/8)*2^(1/2)*exp(-4)*WhittakerM(7/6, 2/3, 8)

(6)

int(exp(-x^3), x=0..1);  #ok

(3/4)*exp(-1/2)*WhittakerM(1/6, 2/3, 1)+exp(-1/2)*WhittakerM(7/6, 2/3, 1)

(7)

int(exp(-x^3), x=1 .. 2);  #???

int(exp(-x^3), x = 1 .. 2)

(8)


 

Download !strange-bug-int.mw

Let us consider 

restart; J := int(cos(a*x)^2/(x^2-1), x = -infinity .. infinity, CPV);
-(1/4)*Pi*sin(2*a)*csgn(I*a)-(1/4)*Pi*sin(2*a)*csgn(I/a)

This result is not true for a=I:

eval(J, a = I);
                               0

In this case the integral under consideration diverges because of 

cos(I*x)^2;
                                
                            cosh(x) ^2

 

Let us consider 

MultiSeries:-series(Psi((2*x+1)/(2*x))-Psi((x+1)/(2*x)), x = 0);

x-(1/2)*x^2+(1/4)*x^4-(1/2)*x^6 +O(x^7)

The above result contradicts 

MultiSeries:-limit(diff(Psi((2*x+1)/(2*x))-Psi((x+1)/(2*x)), x), x = 0);
                           undefined
MultiSeries:-limit((Psi((2*x+1)/(2*x))-Psi((x+1)/(2*x)))/x, x = 0, right);
                               1
MultiSeries:-limit((Psi((2*x+1)/(2*x))-Psi((x+1)/(2*x)))/x, x = 0, left);
                           undefined
plot((Psi((2*x+1)/(2*x))-Psi((x+1)/(2*x)))/x, x = -0.1e-1 .. 0.1e-2, discont, y = -5 .. 5);

1 2 3 4 5 6 7 Last Page 1 of 10