vv

13837 Reputation

20 Badges

9 years, 325 days

MaplePrimes Activity


These are replies submitted by vv

@mmcdara 

I expect from PDF to return at least the (double) integral (not necessarily a closed form, of course, even if such a closed form exists). This can be easily done for the toy example because Maple is able to solve Z < z:

SolveTools:-SemiAlgebraic({x^2 + y^2 + a*x*y<z},[x,y], 'parameters'=[a,z]);

(not to mention the case when a is fixed, e.g. a=1/2 or a=3).

So, I don't agree about "Not really a severe limitation".

 

 

 

 

 

@Alger 

It is not clear what you are trying to do. If you want to find an orthogonal system in a function space, the simplest way is to start with a known one e.g. cos(nx), sin(nx), in L2([0,2*Pi], 1)  and use the Fact above for some h.

 

 

@Rouben Rostamian  

The fact applied here is simple:

If un(x) are orthogonal in L2([x1,x2], w(x))  (here w is the weight) and h : [t1, t2] --> [x1,x2] is a diffeomorphism
then   un(h(t))  are orthogonal in L2([t1,t2], w(h(t))*|h'(t)|).

 

@minhthien2016 

Thank you for the new recurrence.
Have you tried to replace the new coefficients in the provided answer?

@Mariusz Iwaniuk 

On my systems (Maple 2017 or 2018, Win 7, 64 bit) it works in all situations: 1D/2D, Document/Worksheet.

@Carl Love 

FAIL/FAIL and even FAIL/0 or 0/FAIL returns FAIL, so the previous version seems to be ok (with the typo corrected).

If d=0 why have you decided to return 1? It should be FAIL (or remain 0/0, hence error) because in this case the definition of the conditional probability is different, so not handled by the formula.

@tomleslie 

It was just a remark. I agree with you of course that the results of the two parsers should be the same.

Using complex numbers the proof is even shorter:

P[5]:=P[1]:
for i to 4 do Q[i] := P[i] + (P[i+1]-P[i])*exp(-I*Pi/4)/sqrt(2) od:
is( Q[3]-Q[1] = I* (Q[2]-Q[4]) );

        true

n dots (n>=2) surrounded by spaces (which is probably the preferable syntax) are interpreted as  ..  in both 1D and 2D.
seq(-3 ... 3);  seq(-3 .... 3);

@Markiyan Hirnyk 

The typo is obvious and the line was shown.

Conditioned:= proc(
   event::{relation, set(relation)},
   cond::{relation, set(relation)}, 
   rv::
      {name= RandomVariable &under Statistics:-RandomVariable,
       {set,list}(name= RandomVariable &under Statistics:-RandomVariable)
      }
) 
uses St= Statistics;
local 
   Event:= `if`(not event::set, {event}, event),
   #Cond:= `if`(not cond::set, {cond}, event),   #typo
   Cond:= `if`(not cond::set, {cond}, cond), 
   RV:= `if`(not rv::{set,list}, [rv], [rv[]]) 
;
   if nargs=3 then 
      (Event,Cond):= 
         subs(lhs~(RV)=~ St:-RandomVariable~(rhs~(RV)), [Event, Cond])[]
   fi;
   #union used rather than intersection because Probability considers a set
   #of relations the represent the intersection of the corresponding events. 
   St:-Probability(Event union Cond)/St:-Probability(Cond)
end proc:

Conditioned({2*X+4*Y <= 1}, {4*X+2*Y <= 1}, {X = Uniform(0, 1), Y = Uniform(0, 1)});

      FAIL

@Markiyan Hirnyk 

After correcting the mentioned typo it will return FAIL.
P.S. If Probability works for not necessarily independent vars, then Conditioned would be ok.

@Markiyan Hirnyk 

Probability cannot compute
Probability({X+Y<=2,X+Y>=1});

An easy example which can be computed geometrically at once is

Conditioned({2*X+4*Y <= 1}, {4*X+2*Y <= 1}, {X = Uniform(0, 1), Y = Uniform(0, 1)});

the result should be 2/3.

Edit. It seems that in Probability({...})  the set of all random variables must be independent.
Note that {X,Y} are independent but {X+Y, X-Y} are not.
(X+Y is a random variable even if it is not a "variable" in the Maple sense).

 

@Carl Love 

You have a typo in

Cond:= `if`(not cond::set, {cond}, event),

And indeed, Probability cannot compute

Probability({X^2+Y<=2,X+Y>=1}); #FAIL

A workaround would be to compute the double integral directy. Or wait for a more capable Probability.

 

@shakuntala 

filename contains the name of the temporary file. It must be in any directory with write permission.
Unfortunately I am not sure whether exportplot and plot/background is available in Maple 15. If not, you will have to see the links to older posts Acer has provided above. 

You use strangely the "dimension".
The 1st solve gives a 1-dimensional (linear) subspace in R^3  (or C^3 if a,b,c are considered in C) i.e. a straight line thru 0.

The 2nd solve gives the union of two such 1-dimensional (linear) subspaces; the topological dimension of the union is still 1.

First 85 86 87 88 89 90 91 Last Page 87 of 176