pHypergeometric

pHypergeometric(n, k, m, x, tail=False)

The cumulative probability function 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

xint, x\geq 0

The number of candidates in a draw

tailbool

Flag to tell if it is the CDF or its complement which is evaluated

Returns:
pfloat

The probability to get at most x candidates in a draw.

Notes

This method is based on a summation of the probability function toward the upper bound or the lower bound of the range depending on the position of x wrt the mode \left\lfloor\dfrac{(k+1)(m+1)}{n+2}\right\rfloor of the distribution, then take the complement if needed.

Examples

>>> import openturns as ot
>>> p = ot.DistFunc.pHypergeometric(10, 4, 7, 2)
>>> p = ot.DistFunc.pHypergeometric(10, 4, 7, 2, True)