How can I calculate the probability that one random variable is bigger than a second one? I have five random variables which are independent and each one of them has a continuous uniform distribution on the interval $ [0,2]:$
$$X_i = \operatorname{Uniform}[0,2].$$
I want to calculate the probability $$\Pr(\min(X_1, X_2, X_3)\gt \max(X_4, X_5)).$$
I'm aware there is combinatorial solution, but I'm trying to solve this problem using coordinates with $X$ as the minimum and $Y$ as the maximum, but I don't know how to sketch the function and calculate the function space in order to know the probability.


How can I calculate the probability that one random variable is bigger than a second one?


*

*You could integrate over the joint distribution in the area where the condition $X>Y$ is true.

*You could derive the distribution for the variable $X-Y$ and use it to compute $P(X-Y>0)$.

Below is an example of the first option

You variables $X = min(X_1,X_2,X_3)$ and $Y = max(X_4,X_5)$ are independent and follow the beta distribution with pdf's (without loss of generality I am scaling from [0,2] to [0,1])
$$\begin{array}{rcl} 
f_X(x) &=& 3(1-x)^2 \\ 
f_Y(y) &=& 2y
\end{array}$$
I've plotted a randomly generated sample of this in the image below. What you want to know is the probability that $X>Y$ and this corresponds to a point being on the bottom of the diagonal line $X=Y$.
You can find this probability by integrating the probability density of the points below that diagonal line.
$$\begin{array}{rcl}
P(X > Y) &=& \int_0^1 \int_0^x 6 (1-x)^2 y \, dy dx \\&=& \int_0^1 6(1-x)^2 \left[ \int_0^x   y \, dy \right] \, dx \\
&=& \int_0^1  3 (1-x)^2 x^2 \, dx \\
 &=& 3 \int_0^1 x^2 - 2x^3 + x^4 \, dx \\
 &=& 3 (\frac{1}{3} - \frac{2}{4} + \frac{1}{5}) \\
 & =& \frac{1}{10}
\end{array}$$


I believe that its is slightly more intuitive and easy than doing the quintuple integral. However, when your question would have been like $X = min(X_1,X_2,X_3)$ and $Y = max(X_3,X_4)$ then the variables are not independent and it may not be so easy to write down the joint pdf.
