[Numpy-discussion] random.hypergeometric bug

Chris listservs@mac....
Sun Dec 2 22:25:54 CST 2007


There appears to be a bug in numpy's hypergeometric
random number generator. Here is an example -- if I 
generate 1000 hg samples with 4 draws from a space
with 30 successes and 10 failures:

In [39]: x = hg(30, 10, 4, 1000)

I should get a mean value of:

In [40]: 4*30./40
Out[40]: 3.0

But the sample mean is way to small:

In [41]: mean(x)
Out[41]: 0.996





More information about the Numpy-discussion mailing list