Negative Binomial Distribution

A discrete probability distribution \(NegBin(r, p)\) having the PMF
\[ p_{r,p}(k) = {}^{k+r-1}C_k \times p^r \times (1-p)^k \]
that governs the probability that, for independent experiments with a probability of success \(p\), there are \(k\) failures before there are \(r\) successes, where \(k\) is greater than or equal to zero, \(r\) is greater than zero and \({}^nC_k\) is the combination of \(k\) from \(n\) objects. If \(r\) equals one then it is identical to the geometric distribution with a probability of success equal to \(p\).
It can be generalised to non-integer \(r\) with
\[ p_{r,p}(k) = \frac{\Gamma(k+r)}{k! \times \Gamma(r)} \times p^r \times (1-p)^k \]
where the exclamation mark stands for the factorial and \(\Gamma\) is the gamma function