# Hypergeometric Distribution

I hate to be that guy who comes here and asks one question, however I've been stuck on this problem for quite some time, and I'm going to assume that I shouldn't even be using the binomial theorem at this point

I was given this question:

A teacher was asked by her principal to select 7 students at random from her class to take a standardized math test, which will be used to determine how well students at that school are doing with respect to math (and correspondingly, how well the teacher is doing at teaching math). The teacher previously had rank ordered her students on the basis of their performance in her class on math tests, and divided the class into quartiles, such that there were 5 students in the upper quartile and 15 students in the lower three quartiles. When the teacher handed the principal the names of the students she had randomly selected from the class, the number of students from the upper quartile was 5, and the number of students from the lower three quartiles was 2. Is there any statistical evidence that the teacher is biased toward selecting students from the upper quartile?

The first question given was:

Compute the probability that, of the students selected, 0 are upper quartile students. Round off to 4 decimal places.

I was able to answer that question with the answer 0.0830, this i was able to answer by doing (15/20)(14/19)(13/18)(12/17)(11/16)(10/15)(9/14), however when it asks a question such as computing the probability that of the students selected, 2 are upper quartile students, I get stuck, I tried using the binomial theorem, but to no avail, perhaps I'm doing something wrong, I can't find a fast enough way to determine all of the sequences that will produce two upper quartile students of the 7 draws.

• The probability of exactly $n$ upper quartile students is a hypergeometric distribution, not binomial. – Tyler Oct 14 '13 at 16:32

The hypergeometric distribution is the probability of having $k$ successes in $n$ draws without replacement, if the total population size is $N$ and there are $K$ successes. For our problem, we'll call a draw a success if we choose an upper quartile student. That means $N = 20$, $K = 5$, $n = 7$, and $k = 2$ since we have $20$ total students, $5$ are in the upper quartile, we are choosing a group of $7$ students, and we want exactly $2$ to be upper quartile.
For the hypergeometric distribution, we have $P(X=k)= \frac{{K \choose k}{N \choose n-k}}{N \choose n}$.
Now, $P(X=2)= \frac{{5 \choose 2}{15 \choose 5}}{20 \choose 7}$ for our given values, which is just the # of ways to choose the group so that it has $2$ of the $5$ upper quartile students and $5$ of the $15$ lower quartile students (which adds up to the $7$ total in the selected group) divided by the total number of possible groups. Can you see why?
There are $20 \choose 7$ ways for the teacher to choose $7$ students, and there are ${5 \choose 5} {15 \choose 2} = {15 \choose 2}$ ways that 5 chosen students are from the 5 in the upper-quartile, and the remaining 2 are from the 15 in the lower quartiles. The ratio of these two quantities is the probability the teacher could have made this choice by random chance, without bias. This is answering the original quoted question at the top of the post.