This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.

# NegativeBinomialDistribution

 NegativeBinomialDistribution represents a negative binomial distribution with parameters n and p.
• The probability for value in a negative binomial distribution is for non-negative integers, and is zero otherwise. »
• If n is a positive integer, NegativeBinomialDistribution gives the distribution of the number of failures in a sequence of trials with success probability p before n successes occur.
Probability density function:
Cumulative distribution function:
Mean and variance:
Probability density function:
 Out[1]=
 Out[2]=

Cumulative distribution function:
 Out[1]=
 Out[2]=

Mean and variance:
 Out[1]=
 Out[2]=
 Scope   (7)
Generate a set of pseudorandom numbers that have a negative binomial distribution:
Compare its histogram to the PDF:
Distribution parameters estimation:
Estimate the distribution parameters from sample data:
Compare the density histogram of the sample with the PDF of the estimated distribution:
Skewness:
For large n, the distribution becomes symmetric:
Limiting values:
Kurtosis:
For large values of n, kurtosis gets close to the kurtosis of the standard NormalDistribution:
Limiting values:
Different moments with closed forms as functions of parameters:
Closed form for symbolic order:
Hazard function:
Quantile function:
 Applications   (7)
The CDF of NegativeBinomialDistribution is an example of a right-continuous function:
The number of tails before getting 4 heads with a fair coin:
Plot the distribution of tail counts:
Compute the probability of getting at least 6 tails before getting 4 heads:
Compute the expected number of tails before getting 4 heads:
A coin was flipped 10 times and the 8 head occurred at the 10 flip. Find the probability of such an event if the coin is fair:
Assuming the coin may not be fair, find the most likely value for :
A basketball player shoots free throws until he hits 4 of them. His probability of scoring in any one of them is 0.7. Simulate the process:
Find the number of shots the player is expected to shoot:
Find the probability that the player requires 4 shots:
Assume the probability of fouling for each minute interval is 0.1 independently. Simulate the fouling process for 30 minutes:
A basketball player fouls out after 6 fouls. Find the expected playing time until foul out:
A shipment of products is inspected in batches of 60 and each batch is inspected up to rejection when the 10 defective item is found. What is the probability of a batch being rejected if 20% of the items are defective?
Alternatively, compute the same result by truncating the distribution:
Simulate the number of non-defective products in rejected batches:
Illustrate the ratio in each batch:
Find the average ratio of non-defective to defective products in rejected batches:
A data stream containing data packets is repeatedly sent without order information. Find the distribution of the number of unordered data stream arrivals until all the packets arrive in the right order for the second time:
Find the probability that packets will arrive the second time in the correct order after at most 18 fails:
Find the average number of fails until the second ordered data stream:
Simulate the number of fails until the second ordered data stream:
NegativeBinomialDistribution converges to a normal distribution when n->∞:
Sum of variates from negative binomial distribution follows negative binomial distribution:
The limit of negative binomial distribution when the mean is fixed is PoissonDistribution:
Relationships to other distributions:
Negative binomial distribution simplifies to GeometricDistribution:
Negative binomial distribution and PascalDistribution differ by a shift:
Sum of n independent variables from GeometricDistribution has negative binomial distribution:
General proof for an arbitrary number of sum components:
A univariate NegativeMultinomialDistribution is a negative binomial distribution:
BetaNegativeBinomialDistribution is a mixture of negative binomial distribution and BetaDistribution:
NegativeBinomialDistribution is not defined when n is non-positive:
NegativeBinomialDistribution is not defined when p is not between zero and one:
Substitution of invalid parameters into symbolic outputs gives results that are not meaningful:
New in 6