Negative Binomial Distribution

## Description

The Negative Binomial Distribution models the probability of $k$ successes before $r$ failures occur with $P(k)=p$. The probability is

(1)
\begin{align} P(k) = \binom{ k + r - 1 }{ k } p^r ( 1-p )^k. \end{align}

The Sage cell below shows the probability when $k=5$, $r=3$, and $p=.2$.

## Sage Cell

#### Code

k = 5
r = 3
p = .2
P = binomial( k + r - 1, k) * p^r * (1-p)^k
P


None

## Tags

Primary Tags: Probability

Secondary Tags: Discrete Distributions: Negative Binomial

## Related Cells

Binomial Distribution