Derivation of the Hypergeometric Distribution The derivation of the hypergeometric refers to the following example: An urn contains N white balls, M black balls and we draw $n\le N+M$ balls without replacement. Let X be the number of white balls, we are looking for the probability that $X=x$ where $x$is an arbitrary fixed integer.

If we number the balls from $1$ to $N+M$, we may think about an outcome being a subset of $\{ 1,.....,N+M\}$, therefore, $\Omega$ is the family of all subsets with n points, the total number of outcomes being:$ \# \Omega= {N+M\choose{n}}$.

Now, we can consider that all possible outcomes are equally likely, so that P is uniform on $\Omega$. The quantity X is a random variable.

I get confused here:

The set $X^{-1}(\{x\})$ contains $N \choose x$$ M \choose {n-x}$ points. I really don't understand what this set is? Could someone give me an example of this?
To take an example, suppose there are $N=3$ white balls, $M=2$ black balls, you draw $n=3$ balls without replacement, and you are looking at the probability that the drawn balls have $x=2$ white and $n-x=1$ black.

Then if the five original balls are labelled $w_1,w_2,w_3,b_1,b_2$ then the possibilities for the three drawn balls of which two are white are:   $$X^{-1}(\{x\}) =$$ $$ \{\{w_1,w_2,b_1\}, \{w_1,w_3,b_1\}, \{w_2,w_3,b_1\}, \{w_1,w_2,b_2\}, \{$w_1,w_3,b_2\}, \{$w_2,w_3,b_2\} \}$$  

with cardinality $6= {3 \choose 2}{2 \choose 1}$ as expected.
How many ways to pick exactly $x$ white balls?  You have to pick $x$ of the $N$ white balls (which can be done in ${N\choose x}$ ways and for each such way there are $M\choose n-x$ ways to pick the remaining $n-x$ balls from the $M$ black balls.