rHypergeometric

rHypergeometric(*args)

Realization of an hypergeometric distribution.

Parameters
nint, n\geq 0

The population size

kint, 0\leq k\leq n

The number of candidates in the population

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 discrete disctribution.

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)