Course contentsShow
← Data Science
Lesson 136 of 2,1454. Discrete Probability DistributionsFree lesson

Expectation and Variance of the Negative Binomial

Calculate mean and variance for negative binomial distributions and relate them to the number of target successes.

Expectation and Variance of the Negative Binomial

What You'll Learn

You'll learn how to calculate and interpret the mean and variance for negative binomial distributions, understanding how they relate to your target number of successes.

Understanding the Formulas

Recall that the negative binomial distribution models the number of trials needed to achieve exactly r successes, where each trial has probability p of success.

Just as we calculated mean and variance for geometric distributions (waiting for 1 success), we can do the same for the negative binomial (waiting for r successes).

The Mean (Expected Value)

The expected number of trials to get r successes is:

E[X] = r/p

Intuition: If you need 5 successes and each trial has a 25% success rate (p = 0.25), you'd expect to need 5/0.25 = 20 trials on average. Makes sense—lower success probability means more trials needed!

The Variance

The variance measures how spread out the number of trials can be:

Var(X) = r(1-p)/p²

Intuition: The variance grows with r (more successes = more uncertainty) and with (1-p) (lower success rate = more variability in how long you'll wait).

Real-World Example

Suppose a recruiter needs to hire 3 qualified candidates (r = 3), and each interview has a 30% chance (p = 0.3) of resulting in a hire.

  • Expected interviews needed: 3/0.3 = 10 interviews
  • Variance: 3(0.7)/0.3² ≈ 23.33
  • Standard deviation: √23.33 ≈ 4.83 interviews

So the recruiter expects about 10 interviews, but it could reasonably vary by ±5 interviews.

Key Takeaway: The negative binomial's mean (r/p) and variance [r(1-p)/p²] both scale with the target number of successes r, helping you predict both typical waiting times and their variability.