hyperv

double hyperv(double p, int n, int N, int M, int* x0, int* x1);

Returns two critical points of the Hypergeometric random variable distribution function with a population size M, containing N successes, with a sample of size n, such that P(X ≤ x0) ≤ p ≤ P(X ≤ x1).

Parameters:
pCummulative probability.
nSample size.
NNumber of successes in population.
MPopulation size.
x0Lower bound critical point.
x1Upper bound critical point.

Returns:
On exit, x0 and x1 are set such thate P(X ≤ x0 | n, N, M) ≤ p ≤ P(X ≤ x1 | n, N, M)

Errors:
NUM_ERRROR is raised if n > M, N > M, n > N, p ≤ 0, or p ≥ 1

Usage:
int x0, x1; hyperv(0.5, 10, 20, 30, &x1, &x2)

Header:
#include "discdist.h"