TITLE: If $X$ and $Y$ are uniformly distributed on $(0,1)$, what is the distribution of $\max(X,Y)/\min(X,Y)$?
QUESTION [5 upvotes]: Suppose that $X$ and $Y$ are chosen randomly and independently according to the uniform distribution from $(0,1)$. Define $$ Z=\frac{\max(X,Y)}{\min(X,Y)}.$$
Compute the probability distribution function of $Z$.
Can anyone give me some hints on how to proceed?
I can only note that $\mathbb{P}[Z\geq 1]=1$ and $$F_Z(t)= \mathbb{P}[Z \leq t]=\mathbb{P}[X\leq Y, Y\leq tX]+\mathbb{P}[Y \leq X, x\leq tY]$$

REPLY [2 votes]: We find the cdf $F_Z(x)$ of the random variable $Z$. By symmetry, it is enough to find $\Pr(Z\le z|Y\gt X)$, that is, 
$$\frac{\Pr((Z\le z) \cap (Y\gt X))}{\Pr(Y\gt X)}.$$ The denominator is $\frac{1}{2}$. so we concentrate on the numerator.
The rest of the argument is purely geometric, and will require a diagram. Draw the square with corners $(0,0)$, $(1,0)$, $(1,1)$, and $(0,1)$.
Draw the line $x+y=1$ joining $(1,0)$ and $(0,1)$.
For a fixed $z$ (make it $\gt 1$) draw the line $y=zx$. 
We will need labels. Let $P$ be the point where the lines $x+y=1$ and $x+y=1$ meet. Let $Q$ be the point where the line $y=zx$ meets the line $y=1$, and let $R=(0,1)$.  Let $A=(1,0)$ and $B=(1,1)$.  The quadrilateral $ABQP$ is the region where $Y\ge X$ and $Y\le zX$. So the probability that $Y\gt X$ and $Z\le z$ is the area of this region. 
It is easier to first find the area of $\triangle PQR$. One can show that $QR=z$ and that the height of $\triangle PQR$, with respect to $P$, is $\frac{1}{1+z}$. Thus  $\triangle PQR$ has area $\frac{1}{2}\frac{z}{1+z}$.
It follows that the area of $ABQP$ is $\frac{1}{2}-\frac{1}{2}\frac{1}{1+z}$. Divide by $\frac{1}{2}$ and simplify. We find that $\Pr(Z\le z)=\frac{z}{1+z}$.
Thus $F_Z(z)=\frac{z}{1+z}$ (for $z\gt 1$). If we want the density function, differentiate.