Step 1:
The negative binomial distribution is given by the probability mass function:
\[P(Y=y) = \binom{y+r-1}{y} p^r (1-p)^y\]
where $y$ is the number of failures before the $r$th success, $p$ is the probability of success, and $r$ is the number of successes.
Show more…