Let $X_1$ and $X_2$ be two independent random variables with distribution $U(0,1)$. Let $Y=|X_1-X_2|$. Find the distribution function and density of $Y$.
Solution: f(x1)=1 whenever x1 between 0 and 1 =0 Else where f(x2)=1 whenever x2 between 0 and 1 =0 Else where f(x1,x2)=1 whenever x1,x2 between 0 and 1 =0 Else where G(y)= P[-y <= x1-x2 <= y] =\int_{-y}^y \int_{x1_y}^{y+x1} 1 dx2 dx1 =\int_{-y}^y -2y dx1 =4y^2 when y between 0 and 1 =0 when y less than 0 =1 when y greater than 1 Thus, g(y)= \diff G(y) =8y Is it correct?