# 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 probability $$\theta$$ of success for each Bernoulli trial, and the number of trials, $$N$$.

## 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}

## Moments

Mean: $$N\theta$$

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

## Usage

Package

Syntax

NumPy

rg.binomial(N, theta)

SciPy

scipy.stats.binom(N, theta)

Stan

binomial(N, theta)