Number of failures until \(k\)'th success
Confusingly, an alternative definition of a negative binomial random variable is also in common use. Instead of the number of trials until the \(k\)'th success, it is sometimes defined as the number of failures until the \(k\)'th success is observed.
Definition
In a sequence of independent Bernoulli trials with \(P(success) = \pi > 0\) in each trial, the number of failures observed before the \(k\)'th success is observed has a distribution that is also called a negative binomial distribution.
\[ X^* \;\; \sim \; \; \NegBinDistn^*(k, \pi) \]If the \(k\)'th success is observed on the \(X\)'th trial, there must have been \((X - k)\) failures, so
\[ X^* \;\; = \; \; X - k \]Alternative distribution's probability function
If \( X^* \sim \NegBinDistn^*(k, \pi) \), then it has probability function
\[ p(x) = \begin{cases} \displaystyle{{x + k -1} \choose {k-1}} \pi^k(1-\pi)^x & \quad \text{for } x = 0, 1, \dots \\[0.5em] 0 & \quad \text{otherwise} \end{cases} \](Proved in full version)
It is important to carefully identify which type of negative binomial distribution to use in any context.