# Difference between two $U(0,1)$

Problem: Person $X$ and $Y$ are having a meeting. Person $X$ arrives at a meeting somewhere between $9$ and $10$, the arrival time is uniformly distributed. Person $Y$ arrives at a meeting somewhere between $9$ and $10$, the arrival time is uniformly distributed. What is the distrubtion of the waiting time for the person whom arrives first? Person $X$ are independent of person $Y$.

Attempt 1: Let $X \sim U(0,1)$ and $Y \sim U(0,1)$, $X$ and $Y$ are independent. Find the distribution for $T = \text{abs}(X - Y)$. But $\text{abs}()$ is hard so first let $V=X-Y$. We use the convolution formula to find that PDF(V) is a triangle with corners $(-1,0), (1,1), (0,1)$. PDF(-V) is the same. Since $V$ and $-V$ have the same pdf, $T$ has this PDF also (simply because $\text{abs}(a-b)=\max[ a-b, -(a-b) ]$.)

Attempt 2: Let $X \sim U(0,1)$ and $Y \sim U(0,1)$, $X$ and $Y$ are independent.. Find the distribution for $T = T_2 - T_1 = \max(X,Y) - \min(X,Y)$. We see that the CDF is $F_{T_2}(t) = t^2$ and $F_{T_2}(t) = 2t - t^2$ but then I cannot go further.

• – Henry Sep 15 '16 at 13:29

If $X,Y$ are independent and uniformly distributed over $[0,1]$ then the PDF of $Z=X-Y$ is supported on $[-1,1]$ and given by $f_Z(u)=1-|u|$. It follows that the PDF of $W=|Z|$ is supported on $[0,1]$ and given by $f_W(u) = 2-2u$.
• @jack-daurizio I see that the $f_Z(u)$ follows from math.stackexchange.com/questions/344844/… – jacob Oct 10 '15 at 13:53
• @jacob: if the PDF of $X$ is given by $f_X(u)$, the PDF of $|X|$ is given by $f_X(u)+f_X(-u)$, isn't it trivial? – Jack D'Aurizio Oct 10 '15 at 13:54