Pdf of the difference of random variables X and Y, both continuously, uniformly distributed on [0,1]

112 Views Asked by At

I tried to compute the pdf of the difference with the convolution formula and found that the pdf is x+1 for x ∈ [-1 ,0] and null otherwise, but my intuition tells me that I am missing the part where x ∈ [0,1]. Can anyone give me a hint what I got wrong?

1

There are 1 best solutions below

3
On BEST ANSWER

It makes a difference whether you want the pdf for the absolute difference $|u_1-u_2|$ for two uniform independent vars $u_k$ ($k=1,2$) or their actual difference $u_1-u_2$ (or $u_2-u_1$.)

For the absolute difference consider the unit square $[0,1] \times [0,1]$ and draw a picture to see that the cumulative $|u_1-u_2| \le t$ has area $t^2/2$ and derivative of that is $t$ for $0\le t \le 1$ which is one of results you mention. If considering the difference it would be a piecewise function as you hint at.

By OP comment, it is $u_1-u_2$ whose density is desired, where each of the $u_k$ is uniform on $[0,1]$ and they are independent. So if one considers the "unit square" $S=[0,1] \times [0,1]$ it follows that probabilities of regions correspond to their areas. Now the cumulative distribution of the difference is by definition $F(t)=P(u_1-u_2 \le t)$ which (viewing $u_1$ as the horizontal and $u_2$ the vertical) is the area in $S$ lying above the line $u_1-u_2=t.$ This area is zero if $t \le -1.$ Then for $-1 \le t \le 0$ it is $(1/2)(1+t)^2.$ Using symmetry of the square $S$ we see that for $0 \le t \le 1$ the required area is $1-(1/2)(1-t)^2.$ and finally is constant at $1$ for $t \ge 1.$

Taking the derivative of $F(t)$ to get the density (ignoring as we may a few finite values) gives the function $f(t)=1+t$ if $t \in [-1,0]$ and $f(t)=1-t$ if $t \in [0,1].$ Of course $f(t)=0$ when $t$ is not in $[-1,1].$