The Distribution of max(X,1/X)

If $X \sim \text{U}(0,1)$, what is the distribution of $Y = \max(X,1/X)$? I know for this particular problem, $Y = \max(X,1/X) = 1/X$, whose distribution can be easily attained directly. However, I've been trying another approach by starting with this

$$P(Y \leq y) = P(X \leq y,\frac{1}{X} \leq y)=P(\frac{1}{X}\leq y| X \leq y)P(X \leq y),$$

and I've been stuck. I would be appreciate if someone could show me how it could be proceeded. Thank you very much.

• Is $X$ really Uniform(0,1)? Because in that case, max($X, 1/X$) is always $1/X$. – Cliff AB Jun 25 '18 at 3:43
• Yes, I've mentioned that for this particular case, max(X,1/X) would be 1/X, but I'm trying a more general way to deal with this kind of problem. – diidoobiib Jun 25 '18 at 3:44
• If you tried $X \sim U(0,2)$, you could come up with a nice solution that might generalize (depending on what you want to generalize too). – Cliff AB Jun 25 '18 at 3:53
• @CliffAB so supposing that X~U(0,2), how can I derive the distribution of max(X,1/X)? – diidoobiib Jun 25 '18 at 4:04

As you have acknowledged in your question, this problem is trivial in the case where $0 < X < 1$. In the more general case (taking $\tfrac{1}{0} = +\infty$ for definiteness) you have:

$$Y = \max(X, \tfrac{1}{X}) = \begin{cases} \tfrac{1}{X} & & \text{if }X < -1 \\[6pt] X & & \text{if }-1 \leqslant X < 0 \\[6pt] +\infty & & \text{if } X = 0 \\[6pt] \tfrac{1}{X} & & \text{if }0 < X < 1 \\[6pt] X & & \text{if }X \geqslant 1 \\[6pt] \end{cases}$$

If you restrict this to the case where $X>0$ (which includes the last two categories), you have:

\begin{aligned} F_y(y) \equiv \mathbb{P}(Y \leqslant y) &= \mathbb{P}(\max (X, \tfrac{1}{X}) \leqslant y) \\[6pt] &= \mathbb{P}(X \geqslant \tfrac{1}{y}, 0 < X < 1) + \mathbb{P}(X \leqslant y, X \geqslant 1) \\[6pt] &= \mathbb{P}(\tfrac{1}{y} \leqslant X < 1) + \mathbb{P}(1 \leqslant X \leqslant y). \\[6pt] \end{aligned}

And of course, in the case where $0<y<1$ this probability is zero, as expected.