Question: Trouble Multiplying Random Variables

I have two random variables:  x and y.  I want to multiply them and get the resulting Probability Density Function, z.  If you look below, Example 1 works as expected.  When I try Example 2, however, I get disappointing results.

Clearly, Example 2 involves nonzero lower boundaries, which is messing me up.  Does anyone have any suggestions for Example 2?

Example 1

with(Statistics)

x := RandomVariable(Uniform(0, 1))

_R

(1)

y := RandomVariable(Uniform(0, 2))

_R0

(2)

z = PDF(x*y, t)

z = piecewise(t < 0, 0, t <= 2, (1/2)*ln(2)-(1/2)*ln(t), 2 < t, 0)

(3)

 

 

Example 2

x := RandomVariable(Uniform(1, 2))

_R1

(4)

y := RandomVariable(Uniform(2, 3))

_R2

(5)

z := PDF(x*y, t)

int(piecewise(_t < 1, 0, _t < 2, 1, 2 <= _t, 0)*piecewise(t/_t < 2, 0, t/_t < 3, 1, 0)/abs(_t), _t = -infinity .. infinity)

(6)
 

NULL

Download MultiplyPDFFunctions.mw

Please Wait...