negativeBinomialDistribution

Negative binomial distribution and its inverse

Returns the sum of the terms 0 through k of the negative binomial distribution:

$(BIGSUM j=0, k) $(CHOOSE n+j-1, j-1) pn (1-p)j

In a sequence of Bernoulli trials, this is the probability that k or fewer failures precede the n-th success.

The arguments must be positive, with 0 < p < 1 and r>0.

The inverse finds the argument y such that negativeBinomialDistribution(k,n,y) is equal to p.

The Geometric Distribution is a special case of the negative binomial distribution.

geometricDistribution(k, p) = negativeBinomialDistribution(k, 1, p);

References: http://mathworld.wolfram.com/NegativeBinomialDistribution.html

real
negativeBinomialDistribution
(
int k
,
int n
,
real p
)

Meta