# How to find probability of the difference between a maximum and minimum of a set of random variables?

I understand that $$p(\min(X_1, X_2) \geq \alpha)$$ can be found by looking at the probability of each separate random variable being greater than or equal to $$\alpha$$, and similarly with $$\max$$. However, how I'm in the middle of a problem where it requires me to solve $$p(\max(X_1, X_2) - \min(X_1, X_2) \geq \alpha)$$. How would one go about finding this? Assume that $$X_1$$ and $$X_2$$ are independent and the PDFs are known.

• If $X_{1}\geq X_{2}$, then $\max\{X_{1},X_{2}\} - \min\{X_{1},X_{2}\} = X_{1} - X_{2}$. Similar result holds when $X_{2}\geq X_{1}$. Commented Mar 26, 2023 at 2:11
• @ÁtilaCorreia right, but the point of the notation is to keep those two equations in just one equation, so unless you can actually evaluate the probability given your simplification, that doesn't do anything.
– john
Commented Mar 26, 2023 at 2:15
• do you have any additional context which you could share with us? Commented Mar 26, 2023 at 2:15
• Sure, the problem is to evaluate the probability of two random cuts on a stick of length 1 generating three branches that can create a triangle. This equation comes from the probability that the middle branch will be at least the sum of the other branches, hence making a triangle impossible.
– john
Commented Mar 26, 2023 at 2:20

Let the pdfs of $$X$$ and $$Y$$ be written $$p(X)$$ and $$q(Y)$$. Now consider the probability that $$\max(X,Y)-\min(X,Y)\geq \alpha$$.
There are two cases. Either $$X>Y$$ in which case $$X - Y \geq \alpha$$, or $$X in which case $$Y-X \geq \alpha$$. The conditional probability of the first case is $$P_> = P\left(\max(X,Y)-\min(X,Y)\geq \alpha|X-Y>0\right)=\int \int p(x)q(y)H(x-y-\alpha) dx dy,$$ where $$H$$ is the Heaviside function, while the conditional probability of the second case is $$P_< = P\left(\max(X,Y)-\min(X,Y)\geq \alpha|Y-X>0\right) = \int \int p(x)q(y)H(y-x-\alpha) dx dy.$$ Now using the probabilities $$P(X>Y)$$ and $$P(Y>X)$$, defined by integrals $$P(X>Y) = \int \int p(x)q(y) H(x-y)dx dy$$ $$P(X we can write with the law of conditional probabilities $$P(\max(X,Y)-\min(X,Y)\geq \alpha) = P_> P(X>Y) +P_< P(X