Finding CDF of $|X-Y|$ when $X,Y$ are independent $U[0,1]$ variables

548 Views Asked by At

Let $X$ and $Y$ be independent variables, uniformly distributed in the interval $[0,1]$. Find the CDF of $|X-Y|$.

I tried the following:

$$P(|X-Y|\le z) = P((X-Y)\le z) + P((X-Y)\le -z) = 1 - P((X-Y)> z) + P((X-Y)\le -z).$$

Comparing with solution, it seems I have something extra. (I got $1-(1-z)^2)+...$ (not figured out what $P((X-Y)\le -z)$ is yet ). What have I done wrong?

1

There are 1 best solutions below

1
On

Since both $X$ and $Y$ have a uniform distribution, and they are independent, their joint distribution is just the uniform distribution on the square $[0,1]^2$. What portion of this square has the property that $|X-Y| \leq z$? Well, we can either have $0 \leq X-Y \leq z$ or $0 \leq Y-X \leq Z$. Drawing these things (unfortunately I do not know how to quickly draw in latex) shows that it is a strip around the first bisector. Hence, we are looking for the area of this strip. This is just one minus the area of the triangles we cut off, and those we can put together to form a smaller square of side length $1-z$.

This gives $P(|X-Y|\leq z) = 1-(1-z)^2 = 2z-z^2$.