The negative binomial distribution is a discrete probability distribution that describes the probability of a given number of failures occurring before a given number of successes in a sequence of independent and identically distributed Bernoulli trials. It is often used to model the number of failures that occur before a certain number of successes in a sequence of independent trials, such as the number of times a coin needs to be flipped before getting heads a certain number of times.

## Properties of Negative Binomial Distribution:

The negative binomial distribution is defined by two parameters: the number of successes (r) and the probability of success (p). It has several important properties, including:

**Discrete values:**The negative binomial distribution only takes on integer values. This means that the number of successes in a given number of trials can only be an integer, such as 0, 1, 2, etc.**Two possible outcomes:**The negative binomial distribution assumes that each trial has only two possible outcomes: success or failure. The probability of success on each trial is constant across all trials.**Independence of trials:**The trials are independent; the outcome of one trial does not affect the outcome of other trials. This means that the probability of success is the same for each trial.

## Mean and variance:

The mean and variance of the negative binomial distribution are given by:

**Mean:**

$$\Large{\mu = r\frac{1-p}{p}}$$

**Variance:**

$$\Large{\sigma^2 = r\frac{1-p}{p^2}}$$

- Where μ is the mean,
- \(σ^2\) is the variance,
- r is the number of successes, and
- p is the probability of success.

## Probability Mass Function (PMF) - Negative Binomial Distribution

The probability mass function (PMF) of the negative binomial distribution gives the probability of a given number of failures occurring before a given number of successes. The formula for the PMF is as follows:

$$P(X = x) = {{x+r-1}\choose{r-1}}p^r(1-p)^x$$

Where:

P(X = x) is the probability of x failures occurring before r successes

\({x+r-1}\choose{r-1}\) is the binomial coefficient, which represents the number of ways to choose x failures from a sequence of x+r-1 trials

p is the probability of success

r is the number of successes

x is the number of failures

## Applications of Negative Binomial Distribution

The negative binomial distribution has a variety of applications in fields such as finance, engineering, and biology. Some examples include:

- Modelling the number of defaults on a loan before a certain number of payments are made
- Modelling the number of defects in a manufactured product before a certain number of units are produced

## Conclusion

In conclusion, the negative binomial distribution is a useful tool for modelling the probability of a given number of failures occurring before a given number of successes in a sequence of independent and identically distributed Bernoulli trials.