Binomial distribution


Story

We perform \(N\) Bernoulli trials, each with probability \(\theta\) of success. The number of successes, \(n\), is Binomially distributed.


Example

Distribution of plasmids between daughter cells in cell division. Each of the \(N\) plasmids as a chance \(\theta\) of being in daughter cell 1 (“success”). The number of plasmids, \(n\), in daughter cell 1 is Binomially distributed.


Parameters

There are two parameters: the number of Bernoulli trials, \(N\), and the probability \(\theta\) of success for each trial.


Support

The Binomial distribution is supported on the set of nonnegative integers less than or equal to \(N\).


Probability mass function

\[\begin{split}\begin{align} f(n;N,\theta) = \begin{pmatrix} N \\ n \end{pmatrix} \theta^n (1-\theta)^{N-n}. \end{align}\end{split}\]

Cumulative distribution function

The CDF evaluated at integers \(n\) with \(0 \le n \le N\) is

\[\begin{align} F(n;N,\theta) = I_{1-\theta}(N - n, n + 1), \end{align}\]

a regularized incomplete beta function.


Moments

Mean: \(N\theta\)

Variance: \(N\theta(1-\theta)\)


Usage

Package

Syntax

NumPy

rng.binomial(N, theta)

SciPy

scipy.stats.binom(N, theta)

Distributions.jl

Binomial(N, theta)

Stan

binomial(N, theta)



PMF and CDF plots