# What is P(X1>X2,X1>X3,…,X1>Xn)P(X_1>X_2 , X_1>X_3,… , X_1>X_n)?

All $X$ are mutually independent and from normal distributions, each with its own mean and variance. If it’s easier, $P(X_1 \geq X_i \forall i \in \{1, ..., n\})$ is fine although I suspect it’s the same. If it matters, $n$ is between 5 and 20.

I found three similar questions:

1. The answer to this one is for only three random variables.
2. The answer to this one is for only mean 0 and variance 1.
3. I’m unsure if this one applies. If it does, I don’t know how to apply it. Its top answer is for three random variables.

(This is not homework.)

For $n \gt 2$ this needs numeric integration, as indicated in several of the links.

To be explicit, let $\phi_i$ be the PDF of $X_i$ and $\Phi_i$ be its CDF. Conditional on $X_1 = t$, the chance that $X_1 \gt X_i$ for the remaining $i$ is the product of the individual chances (by independence):

Integrating over all values of $t$, using the distribution function $\phi_1(t)dt$ for $X_1$, gives the answer

For $n=20$, the integral takes 5 seconds with Mathematica, given vectors $\mu$ and $\sigma$ of the means and SDs of the variables:

\[CapitalPhi] = MapThread[CDF[NormalDistribution[#1, #2]] &, {\[Mu], \[Sigma]}];
\[Phi] = PDF[NormalDistribution[First[\[Mu]], First[\[Sigma]]]];
f[t] := \[Phi][t] Product[i[t], {i, Rest[\[CapitalPhi]]}]
NIntegrate[f[t], {t, -Infinity, Infinity}]


The value can be checked (or even estimated) with a simulation. In the same five seconds it takes to do the integral, Mathematica can do over 2.5 million iterations and summarize their results:

m = 2500000;
x = MapThread[RandomReal[NormalDistribution[#1, #2], m] &, {\[Mu],\[Sigma]}]\[Transpose];
{1, 1./m} # & /@ SortBy[Tally[Flatten[Ordering[#, -1] & /@ x]], First[#] &]


For instance, we can generate some variable specifications at random:

{\[Mu], \[Sigma]} = RandomReal[{0, 1}, {2, n}];


In one case the integral evaluated to $0.152078$; a simulation returned

{{1, 0.152387}, … }

indicating that the first variable was greatest $0.152387$ of the time, closely agreeing with the integral. (With this many iterations we expect agreement to within a few digits in the fourth decimal place.)