Tutorials › Statistical Theory I - Probability and Distribution Theory › Binomial Mean and Variance from Bernoulli Sums

Bernoulli and Binomial Families · Tutorial 108 of 994

Binomial Mean and Variance from Bernoulli Sums

See why a binomial count has mean \(np\) and variance \(np(1-p)\) by analyzing the individual trial indicators.

Beginner 9 min read

What You'll Learn

  • Represent a binomial count as a sum of Bernoulli indicators.
  • Derive the expectation of the sum from the trial-level expectations.
  • Prove the variance formula using independence and zero cross-covariances.
  • Calculate and interpret binomial means, variances, and standard deviations.
  • Distinguish equal-probability independent trials from unequal-probability or dependent trials.

From Trial Outcomes to a Count

A binomial random variable counts successes across a fixed number of trials. Its mean and variance are not mysterious properties of the count: they follow from the behavior of each trial and from how the trials relate to one another. The useful representation is to record each success with an indicator, then add those indicators.

Suppose a trial has success probability \(p\). Its indicator equals 1 when the trial is a success and 0 otherwise. For \(n\) independent trials with the same success probability, the total number of successes is the sum of these \(n\) indicators. This representation will give both the average count and its variability.

Definition: Let \(n\) be a nonnegative integer and \(0\leq p\leq 1\). A random variable \(X\) has a binomial distribution with parameters \(n\) and \(p\), written \(X\sim\operatorname{Bin}(n,p)\), if it counts successes in \(n\) independent Bernoulli trials, each with success probability \(p\). For trial \(i\), define the indicator \(I_i=1\) if that trial is a success and \(I_i=0\) otherwise. Then \(X=\sum_{i=1}^{n}I_i\). When \(n=0\), the sum is empty and equals 0.

The indicators are independent because the trials are independent, and they have the same Bernoulli distribution because each trial uses the same success probability. An indicator with success probability \(p\) has \(E[I_i]=p\) and \(\operatorname{Var}(I_i)=p(1-p)\): since \(I_i^2=I_i\), its second moment is \(p\), and its variance is \(p-p^2\).

Deriving the Mean and Variance

The mean of a sum is the sum of the means, whether or not its terms are independent. Independence matters for the variance: it makes every pairwise covariance vanish. The next result states both conclusions for a binomial count.

Theorem: If \(X\sim\operatorname{Bin}(n,p)\), then $$ E[X]=np,\qquad \operatorname{Var}(X)=np(1-p). $$ These formulas hold for \(n\) a nonnegative integer and \(0\leq p\leq 1\), including the boundary cases \(p=0\) and \(p=1\).

Proof. Write \(X=\sum_{i=1}^{n}I_i\), where the \(I_i\) are independent Bernoulli indicators with success probability \(p\). By linearity of expectation,

$$ E[X]=E\left[\sum_{i=1}^{n}I_i\right] =\sum_{i=1}^{n}E[I_i] =\sum_{i=1}^{n}p =np. $$

For the variance, expand the centered square. Each indicator has a finite second moment, and there are only finitely many terms, so this expansion and expectation require no limiting interchange:

$$ \begin{aligned} \operatorname{Var}(X) &=E\left[\left(\sum_{i=1}^{n}(I_i-E[I_i])\right)^2\right]\\ &=\sum_{i=1}^{n}\operatorname{Var}(I_i) +2\sum_{1\leq i<j\leq n}\operatorname{Cov}(I_i,I_j). \end{aligned} $$

For \(i\ne j\), independence gives \(E[I_iI_j]=E[I_i]E[I_j]\), so \(\operatorname{Cov}(I_i,I_j)=E[I_iI_j]-E[I_i]E[I_j]=0\). Also, \(\operatorname{Var}(I_i)=p(1-p)\). Therefore

$$ \operatorname{Var}(X) =\sum_{i=1}^{n}p(1-p) =np(1-p). $$

If \(n=0\), both sums are empty and \(X=0\), so the same formulas give mean and variance equal to zero. If \(p=0\), all indicators are zero with probability 1; if \(p=1\), all are one with probability 1. The formulas give variance zero in either case, as required. \(\square\)

Worked Example: A Quarter-Probability Event in 12 Trials

A procedure is repeated independently 12 times. Each repetition produces the designated outcome with probability \(p=0.25\). Let \(X\) be the number of repetitions producing that outcome. Then \(X\sim\operatorname{Bin}(12,0.25)\).

The expected number of designated outcomes is \(E[X]=np=12(0.25)=3\).

The variance is \(\operatorname{Var}(X)=np(1-p)=12(0.25)(0.75)\). Since \(12(0.25)=3\) and \(3(0.75)=2.25\), the variance is \(2.25\) outcomes squared. The standard deviation is \(\sqrt{2.25}=1.5\) outcomes.

The mean describes the long-run average count over repeated sets of 12 trials; it does not assert that the count must equal 3 in any particular set. The standard deviation summarizes the count's spread around that mean.

Worked Example: Expected Count and Spread for 20 Trials

A screening test has probability \(0.4\) of returning a positive result for each person in a specified group. Assume the results for 20 people are independent and have this same probability. If \(X\) counts positive results, then \(X\sim\operatorname{Bin}(20,0.4)\).

The expected number of positive results is \(E[X]=20(0.4)=8\).

For each person, the success-failure product is \(p(1-p)=0.4(0.6)=0.24\). Thus \(\operatorname{Var}(X)=20(0.24)=4.8\). The standard deviation is \(\sqrt{4.8}\approx 2.19\) positive results.

The units distinguish the two summaries: the mean is measured in positive results, whereas the variance is measured in squared positive results. Taking its square root returns a spread on the count scale.

Worked Example: A Boundary Probability

Consider 8 independent trials in which success is certain, so \(p=1\). The count \(X\) has distribution \(\operatorname{Bin}(8,1)\). The formulas give \(E[X]=8(1)=8\) and \(\operatorname{Var}(X)=8(1)(1-1)=0\).

This agrees with the experiment: every trial succeeds, so \(X=8\) with probability 1. A constant random variable has zero variance. At the other boundary, if \(p=0\), then \(E[X]=0\) and \(\operatorname{Var}(X)=0\), because no trial succeeds. Thus the formulas include deterministic cases without needing a separate exception.

What the Formulas Reveal

The mean \(np\) increases in proportion to the number of trials when \(p\) is held fixed. The variance also increases in proportion to \(n\), but its per-trial contribution is \(p(1-p)\). For \(0\leq p\leq 1\), this contribution is largest at \(p=1/2\) and equals \(1/4\) there. One way to verify this is to write \(p(1-p)=1/4-(p-1/2)^2\); the squared term is nonnegative.

The variance is zero at the endpoints \(p=0\) and \(p=1\), where each trial's outcome is fixed. For a fixed \(n\), it is largest at \(p=1/2\), where successes and failures are equally likely. This describes variability, not the location of the mean: \(np\) changes with \(p\), while the variance first rises and then falls.

Common Mistake: Adding Variances Without Checking Dependence

A tempting but incomplete argument is: “The count is a sum, so its variance is the sum of the variances.” In general, a variance-of-a-sum calculation also has covariance terms. For indicators \(I_1,\ldots,I_n\), the full identity is

$$ \operatorname{Var}\left(\sum_{i=1}^{n} I_i\right) =\sum_{i=1}^{n}\operatorname{Var}(I_i) +2\sum_{1\leq i<j\leq n}\operatorname{Cov}(I_i,I_j). $$

For a binomial count, independence makes those covariance terms zero, and identical success probabilities make each individual variance equal to \(p(1-p)\). Both features are part of the trial scheme behind the binomial model.

If independent indicators instead have success probabilities \(p_i\), their individual variances are \(p_i(1-p_i)\), and the sum has mean \(\sum_i p_i\) and variance \(\sum_i p_i(1-p_i)\). Different success probabilities do not necessarily produce different variances: probabilities \(0.2\) and \(0.8\) both give variance \(0.16\). With dependent indicators, the covariance terms must also be included. Therefore, unequal probabilities do not by themselves determine whether the individual variances differ, and neither unequal probabilities nor dependence should be silently treated as the binomial setup.

Key takeaway: For \(X\sim\operatorname{Bin}(n,p)\), express the count as a sum of \(n\) independent Bernoulli indicators. Their common mean \(p\) yields \(E[X]=np\); their common variance \(p(1-p)\), together with zero pairwise covariances, yields \(\operatorname{Var}(X)=np(1-p)\).

Check Your Understanding

Try these questions using the indicator-sum representation and the conditions of the binomial model.

  1. A binomial count has \(n=15\) and \(p=0.2\). Find its mean and variance, showing the substitution into both formulas.
  2. Explain why independence is used in deriving the variance formula, while it is not needed to add expectations.
  3. For \(n=6\) and \(p=0.5\), find the variance and compare it with the variance when \(n=6\) and \(p=0.1\).
  4. Two independent Bernoulli indicators have success probabilities \(0.2\) and \(0.8\). Find each variance and explain why equal variances do not imply equal success probabilities.
  5. What are the mean and variance of a binomial count when \(p=0\)? Explain why those values agree with the experiment.