Hypergeometric Distribution

The hypergeometric distribution may be seen as a variation on the binomial distribution.

A random variable X has a hypergeometric distribution and it is referred to as a hypergeometric random variable if and only if its probability distribution is given by
\[ h(x,n; N, m ) = \frac{\binom{m}{x} \binom{N-m}{n-x}}{binom{N}{n}} \qquad \mbox{ for } \ \max \left\{ 0, n+m-N \right\} \le x \le \min (n,m) . \]
R has four dedicated commands for density, distribution function, quantile function, and random generation for the binomial distribution with parameters size and prob: