# Uniform Spacing—Probability

Let $X= \min( U, V)$ and $Y= \max(U, V)$ for independent uniform $(0,1)$ variables $U$ and $V$. Find the distribution of $Y-X$.

I'm studying for Exam P with Pitman's text Probability. This is from 5.2.13.

I know the answer is $2(1-x)$ but I'm not sure how to start. I'm looking for a simple approach as I already found a complicated explanation to this problem.

Thank you.

I guess I'm going to have to settle with viewing it as points in a plane. I thought it was simpler than this. Thanks again.

-
The maximum minus the minimum equals the bigger number minus the smaller number. And that equals the absolute value of the difference. So $Y-X=|U-V|$. –  Michael Greinecker May 28 '12 at 21:49
Draw the square $[0,1]\times[0,1]$, and identify the straight lines that correspond to the same absolute value of the difference (following what Michael said). Because the law of $(U,V)$ is uniform on the square, the probability will be proportional to the lenght of the lines. –  Juan Simões May 28 '12 at 22:00
This is a multi-duplicate. –  Did May 28 '12 at 22:14
Taking Michael Greinecker's comment: look at the distribution of $U-V$. This is a symmetric triangular distribution on $[-1,1]$ and has a density of $1-|x|$.
So $Y-X = \max(U,V) - \min(U,V) = |U-V|$ is a distribution on $[0,1]$ with density $(1-|-x|) + (1-|x|) = 2(1-|x|) = 2(1-x)$ since $x$ is non-negative.