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:
p | Cummulative probability. |
---|---|
n | Sample size. |
N | Number of successes in population. |
M | Population size. |
x0 | Lower bound critical point. |
x1 | Upper 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:
Header:
int x0, x1;
hyperv(0.5, 10, 20, 30, &x1, &x2)
#include "discdist.h"