# What is the probability that the $i$-th best student in a class of $m$ students do better than the $j$-th best student in a class of $n$ students?

Suppose I am a student in a class of $$m$$ students and I rank $$i$$-th among them, what is the probability that I do better than a student that ranks $$j$$-th in a class of $$n$$ different students? I modelled this problem assigning to each student his "incompetency", measured by a real number (so a student is better than another student if in this scale he scores less) and assuming that these scores are extracted for each student in i.i.d. manner from a fixed continuous distribution.

Formally, suppose $$X_1,X_2, X_3,\dots,Y_1,Y_2,Y_3,\dots$$ are i.i.d. real random variables with common distribution $$\mu$$, that we assume continuous, i.e. $$\forall x \in \mathbb{R}, \mu(\{x\}) = 0$$. If $$m\in \mathbb{N}$$, let $$X^1_m,X^2_m,\dots,X^m_m$$ denote respectively the reordering from $$X_1,\dots,X_m$$ such that $$X^1_m$$ is the smallest in the set $$\{X_1,\dots,X_m\}$$, $$X^2_m$$ is the second smallest in the set $$\{X_1,\dots,X_m\}$$, and so on (and so $$X^1_m \le X^2_m \le \dots \le X^m_m$$ and ties appear with zero probability, since $$\mu$$ is continuous). If $$n \in \mathbb{N}$$, define analogously $$Y_n^1,\dots,Y^n_n$$.

Given $$m,n \in \mathbb{N}, i \in \{1,\dots,m\}, j \in \{1,\dots,n\}$$, what it the probability of the event $$\{X^i_m \le Y^j_n\}?$$

Actually, I have in mind a simple strategy using brute force (i.e. disintegration, independence and integration by parts) to get to the result, but the calculations are a bit cumbersome... has anyone any idea how to get to the result in a simpler manner?

It seems to me that your problem is equivalent to this. Have a urn with $$m$$ white balls and $$n$$ black balls. You draw $$i+j-1$$ balls from it. These are your top $$i+j-1$$ students. We don't need the exact ranking amongst these $$i+j-1$$ and neither amongst the remaining balls. We just need to know that every drawn ball is better than any non-drawn ball. We pick $$i+j-1$$ balls because:
• we cannot have $$i$$ white balls and $$j$$ black balls at the same time;
• however, there must be either at least $$i$$ white balls or at least $$j$$ black balls (mutually exclusive).
So, if happens that you have at least $$i$$ white balls, it means that the $$i$$-th student of the first group is better than the $$j$$-th student of the second group. The other way around if you have $$j$$ or more black balls.
In the end, you just need to calculate the probability of having at least $$i$$ white balls amongst the balls drawn (hint: hypergeometric).
• Nice solution! This means the answer does not depend on $\mu$, does it? Aug 1, 2020 at 9:06