vv

13922 Reputation

20 Badges

10 years, 7 days

MaplePrimes Activity


These are replies submitted by vv

@one man 

If a parametrization is there, then please use it to plot the surface, instead of using implicitplot3d. As I said, it would be very useful but unfortunately I don't see it and I don't think it will be easy to obtain.

I think you ask too much from Maple, the PDF for sin(X) seems to be hard to compute.

Let's take a much simpler distribution where Maple also fails but which can be easily computed.

X := RandomVariable(Uniform(0, 4*Pi));

Maple says that the PDF for sin(X) is

f := piecewise(t < 0, 0, t = 0, 5/(4*Pi), t < 1, 1/(sqrt(-t^2+1)*Pi), 1 <= t, 0)

but the correct PDF is 2*f.

@one man 

You have parametrized two curves (red an green, lying on the surface), but you have not parametrized the surface.

@one man 

No need for other examples of animated curves, you already posted dozens.
If you can, show us a real (approximate) parametrization for this surface, this would be useful.

Then it's a bug at least in documentation.

@Axel Vogt 

@one man 

If you really want to help the OP, why don't you state clearly in the worksheet:
the parametization for this surface is given by ...
(in the worksheet there isn't any parametrization, the surface is ploted by implicitplot3d).

In this case, an exact parametrization is:

plot3d([
(2 + cos(t))^(1/4) * signum(cos(u))*sqrt(abs(cos(u))),
(2 + cos(t))^(1/4) * signum(sin(u))*sqrt(abs(sin(u))),
signum(sin(t))*sqrt(abs(sin(t)))],
t=-Pi..Pi, u=-Pi..Pi, style=surface);


 

#maximize(int(exp(-x^4), x = k .. 3*k), location);

Jk:=int(exp(-x^4), x = k .. 3*k):

 

 

k0:=solve(diff(Jk,k),k,explicit)[1];

k0 := (1/10)*(5^(1/2)*(5^(1/2)*ln(3)^(1/2))^(1/2))

(1)

F:=int(exp(-x^4),x):

F:=simplify(convert(F,hypergeom)):

J:=simplify(eval(F,x=3*k0)-eval(F,x=k0));

J := GAMMA(5/4, (1/80)*ln(3))-GAMMA(5/4, (81/80)*ln(3))

(2)

evalf(J);

.5128436618

(3)

evalf(eval(Jk,k=k0));

.5128436616

(4)

 

 

 

 

One must change the variable.

f:=Psi((2*x+1)/(2*x))-Psi((x+1)/(2*x)):

MultiSeries:-series(eval(f,x=-x), x = 0);

series(Pi*cos((1/2)*Pi/x)/sin((1/2)*Pi/x)+Pi*sin((1/2)*Pi/x)/cos((1/2)*Pi/x)-x-(5/2)*x^2-6*x^3-(55/4)*x^4-30*x^5+O(x^6),x,6)

(1)

MultiSeries:-series(eval(convert(%,polynom),x=-x),x);

series((-Pi*cos((1/2)*Pi/x)/sin((1/2)*Pi/x)-Pi*sin((1/2)*Pi/x)/cos((1/2)*Pi/x))+x-(5/2)*x^2+6*x^3-(55/4)*x^4+30*x^5+O(x^6),x,6)

(2)

 

I have not verified if it agrees with Mathematica in this case.

 

 

Ok, I'll reply, even if it's probably a waste of time.
1. About directional limits/series:

f:= x -> piecewise(x<0,sin(x),cos(x));

proc (x) options operator, arrow; piecewise(x < 0, sin(x), cos(x)) end proc

(1)

MultiSeries:-series(f(x), x = 0);

series(1-(1/2)*x^2+(1/24)*x^4-(1/720)*x^6+O(x^7),x,7)

(2)

MultiSeries:-series(f(-x), x = 0);

series(-x+(1/6)*x^3-(1/120)*x^5+O(x^7),x,7)

(3)

2. Maple and Mathematica expansions agree for x>0.

 

All Maple's answers here are mathematically correct.
(It would be easier to see this for the similar function f(x) = Psi(1/x) - Psi(2/x)).

Facts:

  • x = 0 is an essential non-isolated singularity (more exactly there is a sequence of poles at x_n, x_n < 0,  x_n --> 0) 
    So, the limit at 0 does not exist. The same (of course) for its derivative.
  • The series given by MultiSeries is for x>0 (recall that it uses directional limits) and it is a "generalized series", not a Taylor one.
    (Note that the standard :-series refuses to give the expansion and invites to use asympt).

 

@Christopher2222 

No need to check, the expression is symmetric in x and y.

@Christopher2222 

A double integral must be computed:

with(Statistics):
X := RandomVariable(Normal(0, 1)): Y := RandomVariable(Uniform(-2, 2)):
#Probability(X*Y < 0);
f:=t->PDF(X,t);  g:=t->PDF(Y,t);
int(Heaviside(-s*t)*f(s)*g(t), s=-infinity..infinity, t=-infinity..infinity);

      1/2

 

@epostma 

But wouldn't this be just an ad hoc patch?
I think it would be interesting to investigate why those undefined and Dirac have appeared under int.
(And also why int is sometimes unable to compute an integral containing Heaviside without a convert/piecewise.)
 

Yes, I did not noticed that X3,X4 are uniform.
Then the CDF of Z is of course
CDF(X1, t)^2*CDF(X3, t)^2;

So, with assumptions Maple is correct.
Strange bug anyway.

@Christopher2222 

Unfortunately, all are wrong.
The correct CDF is:
CDF(X1,t)^4;
==>  (1/2+(1/2)*erf((1/2)*t*sqrt(2)))^4
(so, Mathematica's answer is ok).
Note that Maple also fails for  CDF(max(X1,X2,X3), t)
for which it results a limit at infinity < 0.6 (!)
but strangely, CDF(max(X1,X2), t) is correct.

 

First 132 133 134 135 136 137 138 Last Page 134 of 176