# Calculate the probability that $X_1 < X_2 < \cdots < X_n$ where $X_1, \ldots, X_n$ are IID random variables

Suppose that $$X_{1}, ..., X_{n}$$ are independent, identically-distributed random variables with marginal density function $$f(x)$$. Calculate $$P(X_{1} < X_{2} < \cdots < X_{n})$$.

I know with 2 independent random variables $$X$$ and $$Y$$, $$P(X < Y) = \int_{-\infty}^{\infty}\int_{-\infty}^yf(x)f(y)dxdy.$$

So by the same reasoning, I did $$P(X_{1} < \cdots < X_{n}) = \int_{x_{n}=-\infty}^\infty\int_{x_{n-1}=-\infty}^{x_{n}}\cdots\int_{x{_1}=-\infty}^{x_{2}}f_{X_1}f_{X_2}\cdots\ f_{X_n} dx_1dx_2\cdots dx_n.$$

Is what I have so far correct? If so, what should I do from there?

• Hint: you can make use of symmetry. Consider that any reordering of the variables gives the same joint density Commented Apr 28, 2023 at 19:47
• Continuous assumption and symmetricity will simplify calculations. (e.g. this probability would be 0 if X are Bernouilli and n > 2) Commented Apr 28, 2023 at 19:52
• All permutations being equally likely by iid-ness, no calculation is necessary Commented Apr 29, 2023 at 8:04

From the symmetry perspective, the answer is clearly $$1/n!$$, as $$X_1 < \cdots < X_n$$ is just one permutation of all $$n!$$ permutations with equal probabilities by the i.i.d. and absolutely continuous assumption.

This intuitive argument can be made rigorous, and you have made a good start. Finish the $$n = 2$$ case calculation first (where $$F$$ is the CDF of $$X_i$$): \begin{align} P(X < Y) = \int_{-\infty}^\infty f(y)\int_{-\infty}^yf(x)dxdy = \int_{-\infty}^\infty f(y)F(y)dy \overset{u = F(y)}{=} \int_0^1 udu = \frac{1}{2}. \end{align}

Let's add in one more term: \begin{align} & P[X_1 < X_2 < X_3] \\ =& \int_{-\infty}^\infty\int_{-\infty}^{x_3}\int_{-\infty}^{x_2}f(x_1)dx_1f(x_2)dx_2f(x_3)dx_3 \\ =& \int_{-\infty}^\infty\int_{-\infty}^{x_3}F(x_2)f(x_2)dx_2f(x_3)dx_3 \\ =& \frac{1}{2}\int_{-\infty}^\infty F(x_3)^2f(x_3)dx_3\\ =& \frac{1}{2}\int_0^1u^2du = \frac{1}{6}. \end{align}

Can you generalize this argument to the case of $$n$$ random variables? As you may have already noticed, the key recursive relation in the calculation is that \begin{align} \int_{-\infty}^{x_{k + 1}}F(x_{k})^{k - 1}f(x_k)dx_k = \int_0^{F(x_{k + 1})}u^{k - 1}du = \frac{1}{k}F(x_{k + 1})^k. \end{align}

• How did you get the limit of integration for u-substitution to be 0 to 1? Commented Apr 28, 2023 at 20:54
• @DragonFruit I added more details. Basically, make the substitution $u = F(y)$, then use the property $F(-\infty) = 0$ and $F(\infty) = 1$ for any CDF $F$. Commented Apr 28, 2023 at 20:57

It's a good exercise to fill the missing details in the following argument. If the probability of ties between the $$X_i$$'s is equal to zero (for instance, if the $$X_i$$'s are "continuous" random variables), then the sure event $$\Omega$$ can be written as the union of $$n!$$ disjoint and (by the symmetry implied by the IID condition) equiprobable events of the form $$\{X_{\pi(1)}, in which $$\pi:\{1,\dots,n\} \stackrel{\cong}{\longrightarrow} \{1,\dots,n\}$$ is a permutation. Hence, $$P\{X_1.