hyperp

double hyperp(int x, int n, int N, int M);

Returns the probability from the Hypergeometric random variable distribution function with a population size M, containing N successes, with a sample of size n, and observing x or less successes.

Parameters:
xCritical point.
nSample size.
NNumber of successes in population.
MPopulation size.

Returns:
P(X ≤ x | n, N, M)

Errors:
NUM_ERRROR is raised if n > M, N > M, or n > N

Usage:
double p = hyperp(5, 10, 20, 30)

Header:
#include "discdist.h"