Mean and Variance of the Binomial Distribution

Use the closed-form formulas E[X]=npE[X]=np and Var(X)=np(1p)\mathrm{Var}(X)=np(1-p) to compute the mean, variance, and standard deviation of a binomial random variable -- both directly and from a modeling context, and to recover nn and pp from given moments.

Step 1 of 119%

Tutorial

Mean and Variance of a Binomial Random Variable

If XBin(n,p)X \sim \mathrm{Bin}(n, p) counts the number of successes in nn independent trials with success probability pp, then its mean and variance have simple closed forms.

The mean of XX is

E[X]=np.E[X] = np.

The variance of XX is

Var(X)=np(1p).\mathrm{Var}(X) = np(1-p).

The standard deviation is the square root of the variance:

SD(X)=np(1p).\mathrm{SD}(X) = \sqrt{np(1-p)}.

For example, if XBin(10,0.5)X \sim \mathrm{Bin}(10, 0.5), then

E[X]=100.5=5,Var(X)=100.50.5=2.5,SD(X)=2.51.58.\begin{align*} E[X] &= 10 \cdot 0.5 = 5, \\ \mathrm{Var}(X) &= 10 \cdot 0.5 \cdot 0.5 = 2.5, \\ \mathrm{SD}(X) &= \sqrt{2.5} \approx 1.58. \end{align*}

These formulas let us avoid summing the probability mass function term by term.

navigate · Enter open · Esc close · ⌘K/Ctrl K toggle