pHypergeometric

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

Cumulative distribution function 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.

xint, x\geq 0

The number of candidates in a draw.

tailbool, optional

Tail flag. If True, the complementary CDF is computed.

Returns:
pfloat

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

Notes

This method is based on a summation of the probability distribution function towards 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)