This is an algorithm for efficient and exact calculation of hypergeometric probabilities using Chebyshev polynomials. For a fixed population size N and fixed sample size n, such calculations simultaneously produce distributions for all possible values of the population number of "successes" M.
The well-known hypergeometric distribution arises in the combinatorial problem in which a finite population of N ob-jects contains M of one kind which may be labeled "success." A sample of n objects is picked without replacement from this set of N objects and it is wished to find the probability that the sample contains exactly x objects labeled "success", where x = 0,1, ... ,N. The probability of observing exactly x such objects is given by The hypergeometric distribution is used for sampling without replacement:
p(x)=choose(M,x)choose(N-M,n-x)/choose(N,n)
where max(0,n-N+M)<=x<=min(n,M)
This algorthim calculate the exact probability even for large N of n, while other algorthims simply use binomial approximation.