

   TThhee HHyyppeerrggeeoommeettrriicc DDiissttrriibbuuttiioonn

        dhyper(x, N1, N2, n)
        phyper(q, N1, N2, n)
        qhyper(p, N1, N2, n)
        rhyper(nobs, N1, N2, n)

   AArrgguummeennttss::

        x,q: vector of quantiles.

         N1: the number of white balls in the population.

         N2: the number of black balls in the population.

          n: the number of balls drawn from the urn.

          p: probability, it must be between 0 and 1.

       nobs: the number of observations to be generated.

   VVaalluuee::

        These functions provide information about the hypergeo-
        metric distribution with parameters `N1', `N2' and `n'.

        `dhyper' gives the density, `phyper' gives the distri-
        bution function `qhyper' gives the quantile function
        and `rhyper' generates random deviates.

        The hypergeometric distribution is used for sampling
        without replacement.  It has density

           p(x) =
           Choose(N1, x) Choose(N2, n-x) / Choose(N1+N2, n)

        for x = 0, ..., n.

   EExxaammpplleess::

        N1 <- 10; N2 <- 7; n <- 8
        x <- 0:N1
        rbind(phyper(x, N1, N2, n), dhyper(x, N1, N2, n))
        all(phyper(x, N1, N2, n) == cumsum(dhyper(x, N1, N2, n)))
        # FALSE
        # Relative Error :
        formatC(signif((phyper(x, N1, N2, n) / cumsum(dhyper(x, N1, N2, n)) - 1), 2),
                format='g', dig=2)

