rHypergeometric

rHypergeometric(*args)

Realization of an hypergeometric distribution.

Parameters:
nint, n\geq 0

The size of the sample.

kint, 0\leq k\leq n

The number of candidates in the sample.

mint, 0\leq m\leq n

The number of individuals in a draw.

sizeint

The number of realizations to generate.

Returns:
realizationsint or Indices

The realizations of the distribution.

Notes

This method is based on the alias method.

Examples

>>> import openturns as ot
>>> ot.RandomGenerator.SetSeed(0)
>>> r = ot.DistFunc.rHypergeometric(10, 4, 7)
>>> r = ot.DistFunc.rHypergeometric(10, 4, 7, 10)