binomialv

double binomialv(double pp, int n, double p, int *x0, int *x1);

Returns two critical points of the Binomial random variable distribution function with n trials and p chance of success such that P(X ≤ x0) ≤ pp ≤ P(X ≤ x1).

Parameters:
ppCummulative probability.
nNumber of trials.
pProbability of success.
x0Lower bound critical point.
x1Upper bound critical point.

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

Errors:
NUMERICS_ERROR is raised if p ≤ 0, p ≥ 1, pp ≤ 0, pp ≥ 1, or n ≤ 1

Usage:
int x0, x1;
binomialv(0.5, 10, 0.75, &x0, &x1)

Header:
#include "discdist.h"