Probability, Pokemon, Cards, Mathematics, Statistics.
scipy.stats import hypergeom import numpy as np # Supress scientific notation np.set_printoptions(suppress=True) def calculate(M, n, N): [M, n, N] = [M, n, N] rv = hypergeom(M, n, N) x = np.arange(0, n+1) return rv.pmf(x) * 100 calculate(60, 4, 7) This script outputs [60.05, 33.63, 5.93, 0.38, 0.01