Understanding convolution formula for density function

84 Views Asked by At

Let $X$ and $Y$ be uniformly distributed, independent random variables on $[0,1]$. Put $Z = X-Y$. How can I obtain the density function of Z?

I understand the following solution by geometric observation: \begin{align} F_{Z}(z) &= P(Z\leq z) = P(X-Y \leq z) = P(Y \geq X -z)\\ &=\begin{cases} \frac{1}{2}(1+z)^2 & (z<0)\\ 1-\frac{1}{2}(1-z)^2 & (z \geq 0) \end{cases}\\ F_{Z}'(z) &= \begin{cases} 1+z & (z<0)\\ 1-z & (z \geq 0) \end{cases} = 1 - |z|. \end{align}

On the other hand, when it comes to the sum of two independent variables, we can use convolution formula. Let $f_{X,Y}(x,y)$ be the joint distribution of $X$ and $Y$. In this case, since $X$ and $Y$ are independent $$ f_{X,Y}(x,y) = f_{X}(x)f_{Y}(y) = 1 \cdot 1 = 1 $$ By the convolution formula, the density of $Z = X-Y$ is $$ f_{Z}(z) = \int_{0}^{1} f_{X,Y}(x,x-z)dx = \int_{0}^{1} dx = 1 ~ ?? $$

How can I get correct density function $f_{Z}(z) = 1-|z|$ using convolution formula?

Thank you for your great help!

1

There are 1 best solutions below

1
On BEST ANSWER

You have to keep the supports of your densities in mind when calculating the convolution. Due to independency, we have

$$ f_Z(z) = \int_{\mathbb{R}} f_{X,Y}(x, x-z) \,dx = \int_{\mathbb{R}} f_X(x)f_Y(x-z)\,dx =\int_{\mathbb{R}} I_{[0,1]}(x)I_{[0,1]}(x-z) \,dx = \int_{\mathbb{R}} I_{[0,1]}(x)I_{[z, 1+z]}(x) \,dx$$

looking at the intersections of the indicatorfunctions, we observe the following cases dependent on $z$ :

$$ \int_{\mathbb{R}} I_{[0,1]}(x)I_{[z,1+z]}(x) \,dx = \begin{cases} 0 , \text{ for } z<-1,\\ \int_{0}^{1+z}1 \,dx, \text{ for } -1 < z < 0,\\ \int_{z}^{1}1 \,dx, \text{ for } 0 < z < 1,\\ 0 , \text{ for } z > 1. \end{cases}$$