# Negative binomial distribution

A negative binomial experiment is a statistical experiment that has the following properties:

- The experiment consists of x repeated trials
- Each trial can result in just two possible outcomes: success or failure
- The probability of success, denoted by P, is the same on every trial
- The trials are independent: that is, the outcome on one trial does not affect the outcome on other trials
- The experiment continues until r successes are observed, where r is specified in advance.

Consider the following statistical experiment. You flip a coin repeatedly and count the number of times the coin lands on heads. You continue flipping the coin until it has landed 5 times on heads. This is a negative binomial experiment because:

- The experiment consists of repeated trials. We flip a coin repeatedly until it has landed 5 times on heads.
- Each trial can result in just two possible outcomes - heads or tails
- The probability of success is constant - 0.5 on every trial
- The trials are independent; that is, getting heads on one trial does not affect whether we get heads on other trials.
- The experiment continues until a fixed number of successes have occurred; in this case, 5 heads.

## Notation

- x: The number of trials required to produce r successes in a negative binomial experiment
- r: The number of successes in the negative binomial experiment
- P: The probability of success on an individual trial
- Q: The probability of failure on an individual trial (this is equal to 1 - P)
- b*(x; r, P): Negative binomial probability - the probability that an x-trial negative binomial experiment results in the
*rth*success on the*xth*trial, when the probability of success on an individual trial is*P*