8B

Mean and variance of the binomial distribution

The notation X ~ Bin(n, p), the mean and variance of a Bernoulli distribution, the mean np and variance np(1 − p) of a binomial distribution, and finding n and p from a given mean and variance.

Working out every binomial probability to find an average would take a long time. Fortunately the mean and variance of a binomial distribution have short formulas, and they explain why results become more predictable as the number of trials grows.

Notation

$X \sim \text{Bin}(n, p)$ means "$X$ is the number of successes in $n$ independent trials, each with probability $p$ of success". A single Bernoulli trial is $\text{Bin}(1, p)$.

Mean and variance of a Bernoulli trial

For one trial, $X$ is $1$ with probability $p$ and $0$ with probability $q = 1 - p$.

Example 1●

Find $E(X)$ and $\text{Var}(X)$ for a Bernoulli trial.

$E(X) = 1 \times p + 0 \times q = p$
Multiply each value by its probability and add.
$E(X^2) = 1^2 \times p + 0^2 \times q = p$
Since 1² = 1 and 0² = 0, X² takes the same values as X.
$\text{Var}(X) = p - p^2 = p(1 - p) = pq$
Var(X) = E(X²) − (E(X))².
Variance of a Bernoulli trial

The variance pq of a single trial, as p moves from 0 to 1.

Try this

Drag $P$ to find the value of $p$ with the largest variance, and explain why that trial is the least predictable. Then find both values of $p$ with variance $0.16$, and check them by solving $p(1 - p) = 0.16$.

Mean and variance of a binomial distribution

A binomial variable is the sum of $n$ independent Bernoulli trials: $X = X_1 + X_2 + \cdots + X_n$. Means always add, so $E(X) = p + p + \cdots + p = np$. For independent variables, variances also add, so $\text{Var}(X) = npq$.

Binomial mean and variance
$$X \sim \text{Bin}(n, p): \qquad \mu = np, \qquad \sigma^2 = np(1 - p), \qquad \sigma = \sqrt{np(1 - p)}$$

The mean $np$ matches intuition: $60$ tosses of a fair coin should give about $30$ heads.

Example 2●

$X \sim \text{Bin}(20, 0.3)$. Find the mean, variance and standard deviation.

$\mu = 20 \times 0.3 = 6$
μ = np.
$\sigma^2 = 20 \times 0.3 \times 0.7 = 4.2$
σ² = npq with q = 0.7.
$\sigma = \sqrt{4.2} \approx 2.05$
Example 3●●

A binomial distribution has mean $12$ and variance $3$. Find $n$ and $p$.

$q = \dfrac{3}{12} = 0.25$, so $p = 0.75$.
Divide the variance by the mean: npq ÷ np = q.
$n = \dfrac{12}{0.75} = 16$
Substitute into np = 12.
Example 4●●●

A fair coin is tossed $10$ times. Find the probability that the number of heads is within one standard deviation of the mean.

$\mu = 5$, $\sigma = \sqrt{2.5} \approx 1.58$
μ = 10 × 0.5 and σ² = 10 × 0.5 × 0.5 = 2.5.
$3.42 \lt X \lt 6.58$, so $X = 4, 5$ or $6$.
The interval is 5 − 1.58 to 5 + 1.58, and X must be a whole number.
$P = \dfrac{210 + 252 + 210}{1024} = \dfrac{672}{1024} \approx 0.6563$
Each P(X = k) = 10Ck / 2¹⁰.
Mean and spread

The dashed line is the mean np. The shaded band is one standard deviation either side of the mean.

Try this

Predict the mean and standard deviation of $\text{Bin}(20, 0.3)$, then check. Keep $p = 0.3$ and raise $n$ to $40$: by what factor does $\sigma$ grow? Which value of $p$ gives the widest spread for fixed $n$?

Your turn

$X \sim \text{Bin}(n, p)$ has mean $8$ and variance $4.8$. Find $n$ and $p$.

Show the working

$q = \dfrac{4.8}{8} = 0.6$, so $p = 0.4$. Then $n = \dfrac{8}{0.4} = 20$.

Flashcards
Bernoulli trial: mean and variance
$\mu = p$, $\sigma^2 = p(1 - p)$
Bin(n, p): mean and variance
$\mu = np$, $\sigma^2 = np(1 - p)$
Finding q from the mean and variance
$q = \dfrac{\sigma^2}{\mu}$
Practice
  1. $X \sim \text{Bin}(50, 0.2)$. Find $E(X)$.

  2. $X \sim \text{Bin}(50, 0.2)$. Find $\text{Var}(X)$.

  3. The variance of a single Bernoulli trial with success probability $p$ is:

  4. $X \sim \text{Bin}(100, 0.1)$. Find the standard deviation.

  5. A binomial distribution has mean $6$ and variance $4.2$. Find $n$.

  6. For a fixed $n$, the variance of $\text{Bin}(n, p)$ is greatest when:

  7. A fair coin is tossed $n$ times and the number of heads has standard deviation $3$. Find $n$.

  8. $X \sim \text{Bin}(10, 0.4)$. Find $E(X^2)$.

  9. Exam style: a fair coin is tossed $8$ times. Find the probability that the number of heads is within one standard deviation of the mean, correct to $4$ decimal places.

  10. Exam style: $X \sim \text{Bin}(n, p)$ has mean $10$ and standard deviation $\sqrt6$. Find $n$ and $p$. Enter them as n&p.

Formula sheet