# Negative binomial distribution - deriving of the p.m.f. combinatorially

Let $X$ be the number of trials preceding the $k$th success in a sequence of independent Bernoulli trials each with probability of success $p$.

Then $X$ has a negative binomial distribution with p.m.f. $p(x) = \binom{x+k-1}{k-1}p^{k}(1-p)^{x}$.

Please explain this pmf using a combinatorial argument. I get why we need to choose $k-1$ successes, but the rest of the pmf is eluding me.

It appears that $x$ is the number of failures before the $k$-th success. Thus, there are $x$ failures and $k-1$ successes before the $k$-th success, for a total of $x+k-1$ trials. There are $\binom{x+k-1}{k-1}$ ways to choose where in the string of $x+k-1$ outcomes the $k-1$ successes fall. The probability of any particular one of these strings is the product of the probabilities of the individual outcomes; $x$ of those outcomes are failures and have probability $1-p$, and $k-1$ are successes and have probability $p$, so the probability of any one of these $\binom{x+k-1}{k-1}$ possible sequences of outcomes is $p^{k-1}(1-p)^x$. The total probability of a string of $x$ failures and $k-1$ successes is therefore
$$\binom{x+k-1}{k-1}p^{k-1}(1-p)^x\;.$$
The probability that any of these sequences is followed by a success (namely, the $k$-th success) is $p$, so the probability that the $k$-th success is preceded by $x$ failures is
$$p(x)=\binom{x+k-1}{k-1}p^k(1-p)^x\;.$$
• Thank you for pointing out the crucial error: I had gotten the definition wrong, defining $X$ as the number of trials (instead of the number of failtures) preceding the $k^{th}$ success. Now, it's easy peasy to get the pmf. – Ryan Jul 25 '13 at 20:15