import matplotlib.pyplot as plt
numargs = hypergeom.numargs
[ M, n, N ] = Replace with reasonable value * numargs
rv = hypergeom(M, n, N)

# Display frozen pdf

x = np.linspace(0, np.minimum(rv.dist.b, 3))
h = plt.plot(x, rv.pdf(x))

# Check accuracy of cdf and ppf

prb = hypergeom.cdf(x, M, n, N)
h = plt.semilogy(np.abs(x - hypergeom.ppf(prb, M, n, N)) + 1e-20)

# Random number generation

R = hypergeom.rvs(M, n, N, size=100)
