Macaulay2 » Documentation
Packages » Probability » ProbabilityDistribution » discreteProbabilityDistribution » hypergeometricDistribution
next | previous | forward | backward | up | index | toc

# hypergeometricDistribution -- hypergeometric distribution

- Usage:
    `hypergeometricDistribution(m, n, k)`
- Inputs:
  - m, an integer, nonnegative;
  - n, an integer, nonnegative;
  - k, an integer, between 0 and m + n;
- Outputs:
  - a discrete probability distribution,

## Description

The hypergeometric distribution, the number of white balls drawn after drawing k balls from an urn containing m white and n black balls.

    i1 : X = hypergeometricDistribution(5, 6, 4)

    o1 = HG(5,6,4)

    o1 : DiscreteProbabilityDistribution

    i2 : density_X 2

          5
    o2 = --
         11

    o2 : QQ

    i3 : probability_X 3

         65
    o3 = --
         66

    o3 : QQ

    i4 : quantile_X 0.4

    o4 = 2

    i5 : random X

    o5 = 3

## Caveat

Probability texts often use the total number of balls (our m + n) as one of the parameters of this distribution. Our definition is consistent with R.

## Ways to use hypergeometricDistribution:

- `hypergeometricDistribution(ZZ,ZZ,ZZ)`

## For the programmer

The object hypergeometricDistribution is a method function.

The source of this document is in /build/macaulay2-88fgJW/macaulay2-1.25.11+ds/M2/Macaulay2/packages/Probability.m2:1057:0.