# Homework Help: Density function

1. Nov 15, 2007

### flybyme

hi..

1. The problem statement, all variables and given/known data
what's the density function for $$X-Y$$ if $$X$$ and $$Y$$ are independent and continously distributed on $$[0,1]$$?

2. Nov 15, 2007

### quasar987

hi,

you must show some work before getting help; what have you tried?

3. Nov 15, 2007

### ZioX

The answer of course depends on how X and Y are distributed. Are you given two specific distributions or do you want to calculate the answer in all its generality? See the Jacobi method to get a way of calculating the pdf of X-Y.

4. Nov 15, 2007

### flybyme

ok... here's my try...

$$X$$ has the uniform distribution $$f_X(x) = 1$$. to get the distribution for $$Y$$: $$F_{-Y}(y) = P(-Y \leq y) = P(Y \geq -y) = 1 - F_Y(-y) \Rightarrow f_Y(y) = f_Y(-y) = -1$$

the formula for convulsion in this case is $$f_Z(z) = \int_\infty^\infty f_X(z-y)f_Y(y)dy$$.

combining this with $$f_Y(y)$$ leads to $$f_Z(z) = -\int_0^1 f_X(z-y)dy$$

the integrand is zero if the condition 0 <= z-y <= 1 (z-1 <= y <= z) isn't fulfilled.

we get three cases:

1. if 0 <= z <= 1: $$f_Z(z) = -\int^z_0 dy = -z$$
2. if 1 < z <= 2: $$f_Z(z) = -\int^1_{z-1} dy = z - 2$$
3. if z < 0 or z > 2: $$f_Z(z) = 0$$

it seems correct to me, but i'm not sure..

5. Nov 16, 2007

### sprint

here is my hint:

1. first define X - Y as Z

2. then graph X - Y <= Z on a graph

3. find the limits of integration

4. solve it and this gives the cumulative distribution function

5. take the derivative of the CDF with respect to Z