# Finding the distribution of $\frac{min(X,Y)}{max(X,Y)}$

Just need some hints on finding the distribution of $Z =\frac{min(X,Y)}{max(X,Y)}$

Where X and Y are iid ~ Unif(0,1).

$P(Z \gt z) = P(\frac{min(X,Y)}{max(X,Y)} \gt z) = P(min(X,Y) \gt z*max(X,Y))$

$= P(X \gt Y, min(X,Y) \gt z*max(X,Y)) + P(Y \gt X, min(X,Y) \gt z*max(X,Y))$

$= P(X \gt Y \gt z*X) + P(Y \gt X \gt z*Y)$

$= \int^x_{zx} 1 dy + \int^y_{zy} 1 dx$

$= x - zx + y - zy = x(1-z) + y(1-z) = (1-z)(x+y)$

Not sure if this is correct, especially the integral part. If anyone could help me out it would be appreciated. Thanks

$X$ and $Y$ are i.i.d. $U(0,1)$ and $Z = \frac{\min\{X,Y\}}{\max\{X,Y\}}$. The support of $Z$ is $[0,1]$

$Pr\left(Z=\frac{\min\{X,Y\}}{\max\{X,Y\}} > z\right), z \in [0,1]$

$= Pr(\{Y>zX\} \cap \{X>Y\}) + Pr(\{X>zY \cap \{X\le Y\})$

$= Pr(X>Y>zX) + Pr(Y\ge X>zY)$

Be noted that you are calculating $Pr(X>Y>zX)$ not $Pr(x>Y>zx)$, you have to add up the probability for all possible $x$. For $z \in [0,1]$,

$Pr(X>Y>zX)$

$=\int_0^1 \int_{zx}^x dy dx = \int_0^1 (x-zx) dx$ (Drawing a graph of $y$ against $x$ will help you a lot)

$=(1-z)\int_0^1 xdx$

$=\frac{1}{2}(1-z)$

and similarly,

$Pr(Y\ge X>zY) = \int_0^1 \int_{zy}^y dx dy = \frac{1}{2}(1-z)$

Thus,

$Pr(Z>z) = \left\{\begin{array}{l l}1 & z<0 \\ 1-z & 0 \le z \le 1 \\ 0 & z>1\end{array}\right.$

I know this has already been marked answered, but there's a much nicer way to do this! You don't need to do any integrals at all.

First, this problem is symmetrical in $X$ and $Y$, so we'll try to use that to simplify it a bit.

In fact, we can use the symmetry to show that the distribution of $Z$ does not change if we condition on $X > Y$. This is because $$P(Z < z) = P(Z < z \mid X < Y) P(X < Y) + P(Z < z \mid X > Y) P(X > Y) = \frac12 \left(P(Z < z \mid X < Y) + P(Z < z \mid X > Y)\right),$$ and $P(Z < z | X < Y) = P(Z < z | X > Y)$ by symmetry of $X$ and $Y$, so the above simplifies to $$P(Z < z) = P(Z < z \mid X > Y).$$

But under these conditions, $max(X, Y) = X$ and $min(X, Y) = Y$, so we have simply $Z = \frac{Y}{X}$. The easiest next step is probably to find the distribution of $Z$ conditional on what $X$ is, so that we can get rid of that nasty random division.

So now we'll condition on $X = a$ (in addition to $X > Y$). Under this condition, $Y \sim U(0, a)$, and so $Z = Y / X = Y/ a \sim U(0, 1)$. But this is the same for every $a$! So it doesn't matter that we conditioned on $a$, and we have $(Z | X = a, X > Y) = (Z | X > Y) = Z$ and hence $Z \sim U(0, 1)$ as well.