superexacttestpy.tl.dhyper

superexacttestpy.tl.dhyper(x, w, b, n, logP)

Probability to getting x white balls out of n draws from an urn with w white balls and b black balls

Parameters:
x : int

Number of elements you want to take

w : int

Number of draws you have

b : int

Number of total elements with x characteristic

n : int

Number of total elements without x characteristic

logP : bool

The result should be with a log scale

Returns:

res – Probability of getting x white balls out of n draws from an urn with w white balls and b black balls

Return type:

float

Example

>>> dhyper(5,10,10,12,False)
...    0.2400571564658254
>>> dhyper(5,10,10,12,True)
...    -1.4268782320528786