Let $p$ and $q$ be uniformly distributed on $[0,1]$. Define $x=\min\{p,q\}$, $y=1-\max\{p,q\}$ and $z=1-x-y$. What are the distribution functions of $x$,$y$ and $z$?
I've got $F_X(x) = 1 - (1-x)^2$ and $F_Y(x) = 1 - (1-y)^2$. But I cannot get my head around $z$.
My current attempt:
$f_Z(z) = P(1-x-y = z) = P(x+y = 1-z) = \int_{0}^{1-z} P(X = 1-z-k)P(Y = k)dk$. Is that right so far? I am asking because I cannot find a way to solve the resulting integral $\int_{0}^{1-z}\frac{2}{z+k} \frac{2}{1-k}dk$. Any ideas?
Thanks so much for your help! Best wishes, Leon
You can express $z$ as $\left|p-q\right|$. It is easier to determine distribution function directly rather than through density. $F_z(t)$ = probability that $|p-q|<t$. If $p$ and $q$ represent cartesian coordinates, the joint distribution is uniform on unit square in northeast quadrant. The required probability is the area of the portion of square between two lines, each with slope 1, one with horizontal intercept of $t$ and the other with vertical intercept of $t$. This equals the area 1 of square minus the area of two isosceles right triangles, each with area $(1-t)^2/2$. So $F_z(t)=1-(1-t)^2$.