St · Statistics & Probability

What Is the Standard Deviation of Flipping Coins?

Published By the 9to5Science editorial team

At a glance

  1. 1. Define the count

    Let X be the number of heads in n independent flips, with probability p of heads on each flip.

  2. 2. Use the binomial model

    The head count has variance np times one minus p.

  3. 3. Take the square root

    The standard deviation is the square root of np times one minus p.

  4. 4. Use a fair-coin shortcut

    For a fair coin, the standard deviation in the number of heads is one-half the square root of n.

Advertisement

If you flip a coin several times, the phrase “standard deviation of flipping coins” most often means the standard deviation in the number of heads. That count follows a binomial distribution when flips are independent and the probability of heads stays the same from flip to flip.

For nn flips and probability pp of heads on each flip, the standard deviation of the head count is

σ=np(1−p).\sigma = \sqrt{np(1-p)}.

For a fair coin, p=0.5p=0.5, so the formula simplifies to σ=n/2\sigma=\sqrt{n}/2. This describes how much the head count typically varies around its expected value; it does not say that every result will be within one standard deviation of the average.

Why the formula works

Represent the result of flip ii by an indicator variable XiX_i: it is 1 for heads and 0 for tails. The total number of heads is

X=X1+X2+⋯+Xn.X=X_1+X_2+\cdots+X_n.

For a flip with probability pp of heads, XiX_i is a Bernoulli random variable. Its mean is pp, and its variance is p(1−p)p(1-p). Independent flips have zero covariance, so the variance of their sum is the sum of their variances:

Var⁡(X)=np(1−p).\operatorname{Var}(X)=np(1-p).

Standard deviation is the square root of variance, giving σ=np(1−p)\sigma=\sqrt{np(1-p)}. The expected number of heads is npnp, which is a different quantity from the standard deviation.

Worked example: 20 fair flips

Suppose you flip a fair coin 20 times and count the heads. Here n=20n=20 and p=0.5p=0.5.

The expected number of heads is

E[X]=np=20(0.5)=10.\mathbb{E}[X]=np=20(0.5)=10.

The standard deviation is

σ=20(0.5)(0.5)=5≈2.24 heads.\sigma=\sqrt{20(0.5)(0.5)}=\sqrt{5}\approx 2.24\text{ heads}.

So 10 heads is the average over many repetitions of this 20-flip experiment, and the spread in the count is about 2.24 heads. The actual count must be a whole number; a standard deviation does not need to be. Nor does this mean that every set of 20 flips will produce between about 8 and 12 heads. It is a measure of spread, not a guaranteed range.

If you mean one flip or the individual outcomes

There is a related interpretation. Code a single fair-coin result as 1 for heads and 0 for tails. Its mean is 0.5 and its standard deviation is

(0.5)(1−0.5)=0.5.\sqrt{(0.5)(1-0.5)}=0.5.

For a biased coin, that single-flip standard deviation is p(1−p)\sqrt{p(1-p)}. If you record the 0-or-1 outcomes across nn independent flips, the standard deviation of the sum of those outcomes is np(1−p)\sqrt{np(1-p)}—the same as the standard deviation of the head count.

The average of the outcomes, or proportion of heads, has a different standard deviation. Since it is the head count divided by nn, its standard deviation is

p(1−p)n.\sqrt{\frac{p(1-p)}{n}}.

For a fair coin, this is 1/(2n)1/(2\sqrt{n}). Thus, the count becomes more spread out in absolute numbers as you add flips, but the proportion of heads becomes less variable.

When flips are not equally likely

The binomial formula assumes independent flips with the same probability pp of heads. For a biased coin, use its actual probability. For example, if p=0.6p=0.6 and you flip it 25 times, then

σ=25(0.6)(0.4)=6≈2.45 heads.\sigma=\sqrt{25(0.6)(0.4)}=\sqrt{6}\approx 2.45\text{ heads}.

If the probability changes between flips, or flips are dependent, the binomial formula may not apply. You need a model that reflects those conditions. For independent flips with different probabilities pip_i, the variance of the total head count is instead ∑i=1npi(1−pi)\sum_{i=1}^{n}p_i(1-p_i).

Common mistakes

  • Using npnp as the standard deviation. That is the expected number of heads. The standard deviation is np(1−p)\sqrt{np(1-p)}.
  • Forgetting to take the square root. np(1−p)np(1-p) is the variance, measured in squared heads; its square root is in heads.
  • Treating the answer as a guaranteed interval. The standard deviation summarizes variability. It does not bound the possible counts.
  • Mixing up count and proportion. The count’s standard deviation is np(1−p)\sqrt{np(1-p)}; the proportion’s is p(1−p)/n\sqrt{p(1-p)/n}.
  • Confusing theoretical and sample standard deviations. The formula above describes the probability distribution before the flips. If you have a particular recorded sequence and calculate its sample standard deviation, that is a statistic from the observed data and can depend on the sample-standard-deviation convention, including whether the denominator is nn or n−1n-1.

References

  1. OpenStax, Introductory Statistics 2e

Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.