Mean and Variance of a Binomial Distribution

For n trials with success probability p, the number of successes has mean np and variance np(1−p). The standard deviation, its square root, shows how much the outcome varies.

For nn trials that each succeed with probability pp, the number of successes XX has these statistics.

E[X]=npV[X]=np(1p)σ=np(1p)E[X] = np \qquad V[X] = np(1-p) \qquad \sigma = \sqrt{np(1-p)}

The mean is exactly what intuition suggests: 100 tosses of a fair coin average 50 heads. The variance says how far from that you should expect to stray.

Example

Toss a coin 100 times, so n=100n = 100 and p=0.5p = 0.5.

E[X]=100×0.5=50E[X] = 100 \times 0.5 = 50
V[X]=100×0.5×0.5=25σ=25=5V[X] = 100 \times 0.5 \times 0.5 = 25 \qquad \sigma = \sqrt{25} = 5

The mean is 50 heads with a standard deviation of 5.

Since nn is large, the normal approximation applies: about 95% of the time the count lands within 50±2σ50 \pm 2\sigma, that is between 40 and 60 heads.

A result of 70 heads would sit four standard deviations from the mean — good grounds for suspecting the coin.

When variance peaks

The product p(1p)p(1-p) is largest at p=0.5p = 0.5, where it equals 0.25. A fifty-fifty chance is the most unpredictable one.

When pp is close to 0 or 1 the outcome is nearly certain, so there is little to vary.