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 = {n1 \choose k1}{\rm P}([X_1>X_2,\ldots,X_{nk+1}],[X_1<X_{nk+2},\ldots,X_n]).$ (The $k1$ comes from $n(nk+2)+1$.) By the law of total probability (conditioning on $X_1$), we get, using the independence assumptions, $ P_k = {n1 \choose k1} \int _a^b {[G(s)]^{n  k} [1  G(s)]^{k  1}f(s)\,{\rm d}s}.$ Remark: This answer was composed completely independently of the one given at stats.stackexchange. 


stats.stackexchange 

