The Negative Binomial Distribution (or Pascal Distribution)

The negative binomial distribution describes the number of trials needed to achieve a certain number of successes in a series of independent trials. For example, it answers the question: flipping a balanced coin (50% chance of heads on each flip), what is the probability that the third head comes up exactly on the fifth flip?

The negative binomial distribution is useful in many fields, including statistics, economics, biology, and physics. And also in “our” SEO.

(If instead we want the probability of a certain number of successes in a fixed number of trials, say three heads in five flips, the right tool is the binomial distribution: the negative binomial turns the question around.)

Defining the Negative Binomial Distribution (or Pascal Distribution)

The negative binomial distribution is a discrete probability distribution that describes the number of trials needed to achieve a certain number of successes in a series of independent trials.

A trial is said to succeed with probability p, and we want to achieve a total of r successes. The negative binomial distribution gives the probability that the r-th success occurs exactly on trial n.

The parameters used in the negative binomial distribution are:

  • the probability of success p, which indicates the probability of achieving a success in a single trial.
  • the desired number of successes r, which indicates the total number of successes we want to achieve.
  • the number of trials needed n, which indicates the number of trials that must be conducted to achieve r successes.

The negative binomial distribution is often denoted with the following notation:

\( X \sim NB(r,p) \\ \)

where X indicates the number of trials needed to achieve r successes, and the symbol “~” means “distributed as”.

Examples of Using the Negative Binomial Distribution

The negative binomial distribution can be applied in various situations, for example:

  • In marketing, to calculate the number of attempts needed to achieve a certain number of sales or conversions.
  • In biology, to calculate the number of attempts needed to achieve a certain number of successes in a series of experiments (for example, the number of attempts needed to isolate a specific bacterial strain).
  • In engineering, to calculate the number of repetitions needed to test the resistance of a material or structure.

To calculate the probability that the r-th success occurs exactly on trial n, we can use the following formula:

\( P(X = n) = {n-1 \choose r-1} p^r (1-p)^{n-r} \\ \)

where X indicates the number of trials needed to achieve r successes, p indicates the probability of success in a single trial, and C indicates the binomial coefficient.

For example, suppose we want to know the probability that, flipping a fair coin (probability of success p=0.5), the third head comes up exactly on the fifth flip:

\( P(X = 5) = {4 \choose 2} \cdot 0.5^3 \cdot 0.5^2 = 0.1875 \\ \)

This means that the probability that the third head arrives exactly on the fifth flip is 18.75%.

Negative binomial(r=3, p=0.5): with a fair coin, the probability that it takes exactly n flips to get 3 heads. The highlighted bar is the worked example, P(X=5) = 0.1875.

Differences Between the Geometric Distribution and Pascal Distribution

The geometric is the r=1 case of the negative binomial: it counts trials to the FIRST success. Asking for 3 (r=3) shifts the distribution to the right and takes longer on average.

The negative binomial distribution and the geometric distribution are both discrete probability distributions used to model the number of trials needed to achieve a certain number of successes. However, the two distributions differ in the definition of success and the modeling objective.

The geometric distribution is used to model the number of trials needed to achieve the first success in a sequence of independent identically distributed trials. For example, the probability of achieving the first success in a fair coin toss can be modeled with a geometric distribution, where the probability of success is p=0.5 and the number of trials needed can take the values 1, 2, 3, ….

In more precise terms:

The main difference between the geometric distribution and the Pascal distribution is that the geometric distribution represents the total number of attempts needed to achieve one success, while the Pascal distribution represents the number of failures before the k-th success in a succession of independent and identically distributed Bernoulli experiments.

In other words, the geometric distribution describes the time needed to achieve the first success, while the Pascal distribution describes the time needed to achieve a certain fixed number of successes. Moreover, the geometric distribution has only one parameter (the probability of success), while the Pascal distribution has two parameters (the desired number of successes and the probability of success).

The formulas for the negative binomial distribution and the geometric distribution are similar, but with some differences in parameters and modeling objective.

For example, let’s consider the case of a fair coin with p=0.5. The probability of achieving the first success in 3 trials can be calculated with a geometric distribution:

\( P(X = 3) = (1-0.5)^2 \cdot 0.5 = 0.125 \\ \)

where X indicates the number of trials needed to achieve the first success.

On the other hand, the probability of achieving 3 successes in 5 trials can be calculated with a negative binomial distribution:

\( P(X = 5) = {4 \choose 2} \cdot 0.5^3 \cdot 0.5^2 = 0.1875 \\ \)

where X indicates the number of trials needed to achieve 3 successes.

Links to Authoritative Resources for Further Study


Further Reading

For an orderly path through the discrete distributions — binomial, geometric, negative binomial — Finalmente ho capito la statistica by Maurizio De Pra (Italian edition) is an accessible companion with plenty of worked examples.

paolo

Recent Posts

The month the form stopped counting: finding and reconstructing tracking gaps

The September report is almost ready, and there is one number that does not fit:…

6 days ago

How many pages should we protect in a site migration? The Lorenz curve and traffic thresholds

The redesign is approved, the launch date is set, and sooner or later the question…

6 days ago

When the yardstick changes: structural breaks in SEO metrics

The annual report lands on the desk with good news on the front page: the…

7 days ago

Are Google’s AI answers taking our clicks? Measuring it with expected CTR and a control group

A site's technical guides climb in the search results, show up more often, and yet…

1 week ago

When clicks vary more than expected: overdispersion

Clicks and sessions vary more than Poisson allows: how to detect it in R and…

1 week ago

Two years of data and a seasonality to remove: doing year-over-year right

An annual report often ends with a single line: clicks from Google fell 11.8% compared…

2 weeks ago