# Order statistics: probability random variable is k-th out of n when ordered.

Given a random variable $X_1$ drawn from a distribution with cdf $F$, and random variables $X_2, \cdots,X_n$ drawn from another distribution with cdf $G$, what is the formula for the probability that $X_1$ is the $k$-th out of the $n$ variables, when they are sorted in order. If it helps, assume that $F$ and $G$ are both defined on [0,1], with positive density everywhere.

-

Suppose that $X_1$ is supported on $[a,b]$ with density function $f$, and that $X_2,\ldots,X_n$ are i.i.d., independent also of $X_1$, with distribution function $G$. Let $P_k$ denote the probability that $X_1$ is the $k$th largest among the $n$ rv's. Then, with a somewhat loose notation, $P_k = {n-1 \choose k-1}{\rm P}([X_1>X_2,\ldots,X_{n-k+1}],[X_1<X_{n-k+2},\ldots,X_n]).$ (The $k-1$ comes from $n-(n-k+2)+1$.) By the law of total probability (conditioning on $X_1$), we get, using the independence assumptions, $P_k = {n-1 \choose k-1} \int _a^b {[G(s)]^{n - k} [1 - G(s)]^{k - 1}f(s)\,{\rm d}s}.$