variance of a function of random variables

#1
Hi all,

I'm trying to calculate the variance of a function of two continuous random variables and could do with a nudge in the right direction seeing as its been a good few years since I did any probability theory work. You may also notice that my latex is a little ropey too...

Specifically I need to calculate var(z):

[math]z = x-y, x>y[/math]
[math]z= 0, x<y[/math]

where x and y are both iid uniform(a,b)

If it helps:
[math]E(z|x)=\frac{(x-a)^2}{2(b-a)}[/math]
[math]E(z)=\frac{b-a}{6}[/math]
[math]var(z|x)=\frac{(x-a)^3}{3(b-a)}-\frac{(x-a)^4}{4(b-a)^2}[/math]

Is the law of total variance relevant? Any help greatly appreciated
 

BGM

TS Contributor
#2
Without investigating any good tricks to solve this problem, you can always refer back to the fundamental definition:

[math] Var[Z] = E[Z^2] - E[Z]^2 [/math]

[math] = \int_a^b \int_y^b \frac {(x - y)^2} {(b - a)^2} dxdy
- E[Z]^2[/math]

provided that you already calculated [math] E[Z] [/math]