Let $(X_1,X_2)$ be uniformly distributed in $[0,1]^2$ and define $Y_1=\max(X_1,X_2)$, $Y_2=\min(X_1,X_2)$. What is then the distribution of $M:=Y_1-Y_2$ ?
To find the joint distribution we take a test function $g$, which is Borel. Then:
now I'm stuck. Can you help please ?