Let $X$ and $Y$ be independent random variables, uniformly distributed in the interval $[0,1]$. Find the CDF and the PDF of $|X - Y|$?
Attempt Let $Z = |X - Y|$, so for $z \geq 0$, the CDF $F_{Z}(z) = \mathbf{P}(Z \leq z) = \mathbf{P}(|X - Y| \leq z) = \mathbf{P}(-z \leq X - Y \leq z)$, which is where the algebra becomes confusing. Since they are independent, the joint pdf of $X$ & $Y$ is simply 1, as long as $(X,Y)$ belong to the unit square. The solution suggests a plot the event of interest as a subset of the unit square and find its area. Any hints?