The Binomial Distribution

The first of the three theoretical distributions of the course. Bernoulli trials and the binomial probability derived by counting; the mean np and variance np(1 - p) proved two ways; the shape of the distribution and its mode; and what happens when the conditions fail, with unequal probabilities, and with dependence between trials shown on repeated blood pressure readings and on clustering by survey location in NHANES. Worked problems on diabetes among seven older adults, television hours among twenty students, days of high carbon monoxide and a clustered sample of 25.

The number of successes in $n$ independent trials with a common success probability $p$ has the binomial distribution, $P(X = x) = \binom{n}{x}p^x(1 - p)^{n - x}$, derived here by counting, with mean $np$ and variance $np(1 - p)$, each proved two ways. For 10 adults drawn with replacement from NHANES 2017 to 2018, where the share obese is $p = 0.4110$, the count has mean 4.110 and standard deviation 1.5559, and 4 is its most likely value. When the conditions fail, the mean survives and the variance does not. Unequal probabilities fixed in advance shrink the variance; dependence inflates it. An adult's three blood pressure readings vary 2.670 times as much as the binomial allows, and drawing 10 adults from one survey location multiplies the variance by 1.239.

Draw 10 adults at random, with replacement, from the 5,107 adults of the National Health and Nutrition Examination Survey (NHANES) of 2017 to 2018 used in the Probability unit, and count how many are obese. Of those adults, 2,099 have a body mass index of 30 or more, a share of $p = 0.4110$. The count could be anything from 0 to 10. A count of 4 is the most likely single value, with probability 0.2502. A count of 7 or more has probability 0.0634, and none at all, 0.0050. Where do such numbers come from, and do they still hold when the people counted are not independent of each other?

The count is a random variable, a number determined by the outcome of a random experiment. The list of its possible values with their probabilities is its distribution. The binomial distribution is the distribution of the number of successes in a fixed number of independent trials with the same probability of success. It answers the first question exactly. The answer to the second is that only the mean still holds. When the people counted are not independent, the average count is unchanged, and every other number above changes: the last section of the article proves it and measures it on NHANES.

First we define Bernoulli trials. Then we derive the binomial distribution by counting, prove its mean and variance two ways, and describe its shape. Finally we ask what happens when the conditions behind it fail, as they often do in medical data, and measure the consequences on real data.

The article builds on Random Variables, Expectation and Variance, which defines random variables, probability mass functions, distribution functions, expected values and variances, and proves the rules used here. Three of them carry most of the weight. The expected value of a sum is the sum of the expected values, whatever the relation between the terms (linearity). The variance of a sum is the sum of the variances plus the covariances of all ordered pairs, so variances add for independent variables. And the laws of total expectation and total variance handle an experiment in two stages. That article also introduces a count used again below: $K$, the number of an adult's three systolic readings that are 130 mm Hg or higher, among the 4,730 NHANES adults with all three readings, with mean 1.0677 and variance 1.8360.

Bernoulli trials

The simplest random variable takes only the values 0 and 1. Drawing one adult and recording $Y = 1$ for obesity and $Y = 0$ otherwise gives a Bernoulli variable with success probability $p = P(Y = 1)$. Its mean and variance are

$$E[Y] = 0(1 - p) + 1 \cdot p = p, \qquad \operatorname{Var}(Y) = E[Y^2] - p^2 = p - p^2 = p(1 - p),$$

using $Y^2 = Y$ for a variable that is 0 or 1. The words "success" and "failure" are labels for the two outcomes and carry no judgment. In medicine the "success" being counted is often a disease or a death.

A sequence of Bernoulli trials is a sequence of such experiments with four properties (Grinstead and Snell, 1997, §3.2):

  1. The number of trials, $n$, is fixed in advance.
  2. Each trial has two possible outcomes, success and failure.
  3. The probability of success, $p$, is the same on every trial.
  4. The trials are independent: the outcome of one trial does not change the probabilities for any other.

Drawing 10 adults with replacement and recording obesity meets all four. The number of trials is 10. Each draw is a fresh, equally likely choice among the same 5,107 adults. So each has the same probability $p = 0.4110$ of producing an obese adult, whatever the earlier draws produced.

Example (three readings of one adult). An adult's three blood pressure readings, with "at or above 130 mm Hg" as a success, are not Bernoulli trials: the fourth condition, independence, fails. A person whose first reading is high probably has high blood pressure, so the next reading is likely to be high too. The first two conditions hold, since there are three readings and each is a success or not. The section "Dependence within a person" below measures the consequences for $K$, the number of high readings.

The binomial probability

Let $X$ be the number of successes in $n$ Bernoulli trials. What is $P(X = x)$? Here is the idea in one sentence. Every particular order of $x$ successes and $n - x$ failures has the same probability, so $P(X = x)$ is the number of such orders times the probability of one of them.

First take one particular sequence with $x$ successes, say the one in which the first $x$ trials are successes and the remaining $n - x$ are failures. By independence, its probability is the product of the probabilities of the individual outcomes:

$$\underbrace{p \cdot p \cdots p}_{x} \cdot \underbrace{(1 - p)\cdots(1 - p)}_{n - x} = p^x (1 - p)^{n - x}.$$

Every other sequence with exactly $x$ successes has the same probability, since it is the same product taken in a different order. The sequences differ only in which $x$ of the $n$ positions hold the successes. The number of ways to choose $x$ positions from $n$ is the binomial coefficient

$$\binom{n}{x} = \frac{n!}{x!\,(n - x)!}.$$

The sequences are mutually exclusive, so by the addition axiom their probabilities add:

$$P(X = x) = \binom{n}{x} p^x (1 - p)^{n - x}, \qquad x = 0, 1, \ldots, n.$$

This is the binomial distribution with parameters $n$ and $p$, written $X \sim \text{Bin}(n, p)$. The two parameters determine the whole distribution. The probabilities add to 1, as a pmf's must, by the binomial theorem:

$$\sum_{x=0}^{n} \binom{n}{x} p^x (1 - p)^{n - x} = \big(p + (1 - p)\big)^n = 1^n = 1.$$

That theorem is where the distribution's name comes from.

A worked case

For the 10 adults, $n = 10$ and $p = 0.4110$. The probability of exactly 4 obese adults is

$$P(X = 4) = \binom{10}{4}(0.4110)^4(0.5890)^6 = 210 \times 0.001191 = 0.2502.$$

The factor 0.001191 is the probability of one particular order, such as four obese adults followed by six who are not. The 210 orders together make 0.2502. The full distribution:

$x$ $\binom{10}{x}$ $P(X = x)$ $P(X \le x)$
0 1 0.0050 0.0050
1 10 0.0351 0.0401
2 45 0.1101 0.1502
3 120 0.2049 0.3551
4 210 0.2502 0.6053
5 252 0.2095 0.8148
6 210 0.1218 0.9366
7 120 0.0486 0.9852
8 45 0.0127 0.9979
9 10 0.0020 0.9999
10 1 0.0001 1.0000

Questions about ranges are answered by adding rows or by subtracting values of the CDF:

  • at most 2 obese adults: $F(2) = 0.1502$;
  • 7 or more: $1 - F(6) = 1 - 0.9366 = 0.0634$;
  • 3 to 5: $F(5) - F(2) = 0.6646$.

The complement rule makes "at least one" easy: $P(X \ge 1) = 1 - P(X = 0) = 1 - 0.5890^{10} = 0.9950$.

Does the formula match the population itself? The script drew 100,000 samples of 10 adults with replacement for each of 30 random seeds. The share of samples with exactly 4 obese adults had median 0.2502 across the seeds (interquartile range 0.2493 to 0.2508), matching the formula. Probability Fundamentals explains simulations of this kind in NumPy, from seeding the random generator to the Monte Carlo error that limits a simulated probability.

Example (counting the failures). The number of adults among the 10 who are not obese is $10 - X$, and its distribution is $\text{Bin}(10, 0.5890)$, since each draw is a Bernoulli trial for "not obese" too, with success probability $1 - 0.4110$. Exactly 6 non-obese adults is the same event as exactly 4 obese ones, so its probability is again 0.2502. In general, if $X \sim \text{Bin}(n, p)$, then $n - X \sim \text{Bin}(n, 1 - p)$, directly from the formula:

$$P(n - X = k) = P(X = n - k) = \binom{n}{n - k} p^{n - k}(1 - p)^{k} = \binom{n}{k} (1 - p)^{k} p^{n - k},$$

because choosing the $n - k$ positions of the successes is the same as choosing the $k$ positions of the failures.

Mean and variance

Ten draws, each obese with probability 0.411, should produce about 4.11 obese adults on average. In general, the mean of a binomial count is $np$ and its variance $np(1 - p)$. There are two proofs, and both are worth knowing.

Through indicators. Write $X = Y_1 + Y_2 + \cdots + Y_n$, where $Y_i$ is 1 if trial $i$ is a success and 0 if not. Each $Y_i$ is a Bernoulli variable with mean $p$ and variance $p(1 - p)$. By linearity,

$$E[X] = E[Y_1] + \cdots + E[Y_n] = np,$$

and since the trials are independent, the variances add:

$$\operatorname{Var}(X) = \operatorname{Var}(Y_1) + \cdots + \operatorname{Var}(Y_n) = np(1 - p). \qquad \square$$

The first statement uses only linearity, so it holds even when the trials are dependent. The second uses independence, and the last section shows what happens without it.

From the formula. The identity $x\binom{n}{x} = n\binom{n-1}{x-1}$ holds because both sides count the ways to choose a committee of $x$ from $n$ people and then a chair from the committee. It gives

$$E[X] = \sum_{x=1}^{n} x \binom{n}{x} p^x (1-p)^{n-x} = np \sum_{x=1}^{n} \binom{n-1}{x-1} p^{x-1} (1-p)^{n-x} = np,$$

because the last sum, with $j = x - 1$, is the total of the $\text{Bin}(n - 1, p)$ probabilities, which is 1. For the variance, apply the identity twice, first to $n$ and $x$ and then to $n - 1$ and $x - 1$:

$$x(x - 1)\binom{n}{x} = (x - 1)\,n\binom{n-1}{x-1} = n(n - 1)\binom{n-2}{x-2}.$$

The terms with $x = 0$ and $x = 1$ vanish, so

$$E[X(X - 1)] = \sum_{x=2}^{n} x(x - 1)\binom{n}{x} p^x (1-p)^{n-x} = n(n-1)p^2 \sum_{x=2}^{n} \binom{n-2}{x-2} p^{x-2} (1-p)^{n-x} = n(n-1)p^2,$$

because the last sum, with $j = x - 2$, is the total of the $\text{Bin}(n - 2, p)$ probabilities. Since $X^2 = X(X - 1) + X$, linearity gives $E[X^2] = E[X(X - 1)] + E[X]$, and then

$$\operatorname{Var}(X) = E[X(X - 1)] + E[X] - (E[X])^2 = n(n-1)p^2 + np - n^2p^2 = np(1 - p). \qquad \square$$

Back to the 10 adults. $E[X] = 10 \times 0.4110 = 4.110$ and $\operatorname{Var}(X) = 10 \times 0.4110 \times 0.5890 = 2.4208$, a standard deviation of 1.5559. Summing $x\,p(x)$ and $(x - 4.110)^2 p(x)$ over the table gives the same values. In the simulation, the mean of the 100,000 counts had median 4.1099 across the 30 seeds, and their variance 2.4228.

Dividing the count by $n$ gives the sample proportion, with mean $p$ and standard error $\sqrt{p(1-p)/n}$. That consequence is developed in The Normal Approximation to the Binomial.

Shape

The mean and variance locate and scale the distribution. Its shape depends on both $n$ and $p$, as the figure shows.

Binomial probabilities for n = 10 with p = 0.10, 0.41 and 0.90, and for n = 40 with p = 0.41; the dashed line marks the mean np. Notice that small p piles the probability against zero with a tail to the right, and p = 0.9 is its mirror image. At p = 0.41 the distribution is nearly symmetric already at n = 10, and at n = 40 it has the outline of a bell.
Binomial probabilities for n = 10 with p = 0.10, 0.41 and 0.90, and for n = 40 with p = 0.41; the dashed line marks the mean np. Notice that small p piles the probability against zero with a tail to the right, and p = 0.9 is its mirror image. At p = 0.41 the distribution is nearly symmetric already at n = 10, and at n = 40 it has the outline of a bell.

Three facts describe the shape.

The mode. For $0 < p < 1$, the ratio of successive probabilities is

$$\frac{P(X = x + 1)}{P(X = x)} = \frac{n - x}{x + 1} \cdot \frac{p}{1 - p}.$$

It follows from the formula, since $\binom{n}{x+1}\big/\binom{n}{x} = (n - x)/(x + 1)$. The ratio exceeds 1 exactly when $(n - x)p > (x + 1)(1 - p)$, that is, when $x < (n + 1)p - 1$, and it equals 1 exactly when $x = (n + 1)p - 1$. So the probabilities rise while $x$ is below $(n + 1)p - 1$ and fall after it. The most likely value is the whole number $x$ with $(n+1)p - 1 \le x \le (n + 1)p$. If $(n + 1)p$ is itself a whole number, the ratio is 1 at $x = (n + 1)p - 1$, so that value and $(n + 1)p$ tie (NIST/SEMATECH, §1.3.6.6.18). For the 10 adults, $(n + 1)p = 4.521$, and the mode is 4.

Symmetry and reflection. Counting failures instead of successes turns $X$ into $n - X$, which is $\text{Bin}(n, 1 - p)$, as the example of the non-obese count proved. So the distribution for $p = 0.9$ is the mirror image of the one for $p = 0.1$. For $p = 0.5$ the distribution is its own mirror image: $P(X = x) = P(X = n - x)$, for example $P(X = 3) = P(X = 7) = 0.1172$ when $n = 10$.

Skewness. For $p < 0.5$ the distribution has a longer right tail, because its mean $np$ lies closer to the lower limit 0 than to the upper limit $n$, so the count has more room to fall far above its mean than far below it. The skewness, derived in The Normal Approximation to the Binomial, is $(1 - 2p)/\sqrt{np(1 - p)}$. It is 0.843 for $n = 10$ and $p = 0.1$, 0.114 for $p = 0.411$, and 0.057 for $n = 40$ and $p = 0.411$. It shrinks like $1/\sqrt{n}$, in step with the binomial's approach to the normal curve as $n$ grows, which that article states and measures. When $n$ is large and $p$ small, so that the mean $np$ stays moderate, the binomial approaches a different limit, the Poisson distribution.

Computing binomial probabilities

The formula can be evaluated directly for small $n$, and printed tables of binomial probabilities served when that was laborious. Software now computes exact probabilities for any $n$. It takes care with the very large and very small numbers in $\binom{n}{x}p^x(1-p)^{n-x}$, so there is no longer a reason to approximate a binomial probability in a calculation. The normal approximation keeps its importance for a different reason. It describes how the count behaves, and it yields the closed-form intervals and tests of Inference on Proportions.

Example (a common misstatement). "The normal approximation to the binomial may be used when $np$ and $n(1 - p)$ are at least 5." No single threshold is the rule. Sources differ on when the approximation is adequate: some ask that $np$ and $n(1 - p)$ both be at least 5, others at least 10. Both thresholds are in use, and The Normal Approximation to the Binomial measures what each guarantees.

When the conditions fail

So far every count has come from draws with replacement, which meet all four conditions by construction. The binomial distribution is exact only under its four conditions. In medical data the first two rarely cause trouble: the number of patients or subjects is usually fixed by design, and an outcome can be made binary by definition. The other two often fail, and in different directions.

Sampling without replacement

A real study samples people without replacement. Each person drawn slightly changes the composition of those who remain, so the trials are not quite independent. The exact distribution is then the hypergeometric, with the same mean and a variance smaller by the factor $(N - n)/(N - 1)$. The mean is the same by linearity, which needs no independence. The factor is proved in The Sampling Distribution of the Mean for the sum of any $n$ values drawn without replacement from a population of $N$; a count is the case where the values are zeros and ones. For a sample that is a small fraction of the population the difference is negligible. The Normal Approximation to the Binomial measures it for samples of 50 from 1,696 young adults.

Unequal probabilities

Suppose a study recruits 4 adults aged 18 to 39, 3 aged 40 to 59 and 3 aged 60 or over, each drawn at random within their age group, and counts how many have hypertension. In the NHANES population of this article, the probabilities of hypertension in the three groups are 0.2280, 0.5825 and 0.7984. The trials are independent, but $p$ is not constant, so the count is not binomial.

Its exact distribution comes from combining the trials one at a time (a convolution). Its mean is still $\sum p_i = 5.055$, by linearity. Since the trials are still independent, its variance is

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

To compare that with a binomial, write $\bar{p}$ for the average of the $p_i$ and $V = \frac{1}{n}\sum (p_i - \bar{p})^2$ for their spread. Expanding the square, $V = \frac{1}{n}\sum p_i^2 - 2\bar{p}\cdot\bar{p} + \bar{p}^2 = \frac{1}{n}\sum p_i^2 - \bar{p}^2$. Then $\sum p_i^2 = n(\bar{p}^2 + V)$, and so

$$\sum_{i=1}^{n} p_i(1 - p_i) = n\bar{p} - n(\bar{p}^2 + V) = n\bar{p}(1 - \bar{p}) - nV.$$

Unequal probabilities among independent trials make the count less variable than a binomial with the same average probability. Here $\bar{p} = 0.5055$, and the binomial variance would be 2.4997. The actual variance is 1.9165, smaller by $nV = 0.5832$. Extreme counts become rarer. No hypertensive adults has probability 0.0002, against 0.0009 under the binomial; all ten, 0.0003 against 0.0011. A design that fixes the number from each group removes the variation between groups from the count. That is the idea behind stratified sampling. The Laws of Large Numbers works a stratified share of this kind (its Problem 1), and shows that under a common positive correlation, as within a cluster, the variance of a mean does not shrink to zero however many observations are averaged.

Dependence within a person

Return to the three readings of each adult. Suppose the readings of one person were independent trials with a common probability. Then $K$ would be $\text{Bin}(3, p)$, where $p$ is the share of all readings at or above 130: of the 14,190 readings, that share is 0.3559. The mean of $K$ would be $3p = 1.0677$. That matches the data exactly, as linearity guarantees with or without independence. Everything else fails.

Left: the number of an adult's three systolic readings at or above 130 mm Hg, observed among 4,730 NHANES adults and as predicted by a binomial distribution with the overall share 0.356. Notice that counts of 0 and 3 are far more common, and 1 and 2 far rarer, than independence predicts, because the readings of one person agree with each other. Right: the number of obese adults among 10 drawn from a single survey location chosen at random, against 10 drawn from all adults; clustering moves probability from the center to both tails.
Left: the number of an adult's three systolic readings at or above 130 mm Hg, observed among 4,730 NHANES adults and as predicted by a binomial distribution with the overall share 0.356. Notice that counts of 0 and 3 are far more common, and 1 and 2 far rarer, than independence predicts, because the readings of one person agree with each other. Right: the number of obese adults among 10 drawn from a single survey location chosen at random, against 10 drawn from all adults; clustering moves probability from the center to both tails.
$k$ Observed $\text{Bin}(3, 0.3559)$
0 2,778 1,264.0
1 269 2,095.2
2 268 1,157.6
3 1,415 213.2

The binomial predicts that most adults have one or two high readings out of three. In fact most have none or all three. The readings of one person are not independent trials. A person whose blood pressure is high tends to have it high on all three readings, and the probability of a high reading differs greatly from person to person. The variance of $K$ is 1.8360, against $3p(1 - p) = 0.6877$ for the binomial, a ratio of 2.670. The formula for the variance of a sum, proved in Random Variables, Expectation and Variance, shows where the excess comes from. The three readings' own variances add to 0.6876, and the covariances between the six ordered pairs of readings, which independence would make zero, add 1.1484.

Clustering

The same mechanism operates whenever trials come in clusters: patients within the same hospital, children within the same school, people within the same household or neighborhood. NHANES itself samples people in geographic clusters. For variance estimation NCHS releases 30 masked variance units, 15 pseudo-strata of 2 pseudo-PSUs each (variables SDMVSTRA and SDMVPSU of the DEMO_J file; National Center for Health Statistics, 2020). Each is an aggregate of the survey's lower-level sampling units, grouped and masked to protect participants' confidentiality, and the article treats each as one location. Among the adults of this article, the share who are obese ranges from 0.2659 in one group to 0.5479 in another.

Suppose a study chooses one of the 30 groups at random and then draws 10 adults from it, with replacement. How much more variable is the count? Here is the idea before the algebra. Given the group, the count is binomial with that group's probability, but the probability itself is now random, and its variation adds to the binomial variance. The formal version. Write $P$ for the group's probability, a random variable with finitely many values $q$, with mean $\bar{p}$ and variance $\operatorname{Var}(P)$ over the groups. Two results from Random Variables, Expectation and Variance are needed, where conditional expectations and variances given $P$ are defined and both results are proved. The law of total expectation says that $E[W] = E\big[E[W \mid P]\big]$ for any variable $W$. The law of total variance says that $\operatorname{Var}(X) = E[\operatorname{Var}(X \mid P)] + \operatorname{Var}(E[X \mid P])$.

Now apply the law of total variance to the count. Given the group, the 10 draws are Bernoulli trials with that group's probability, so $E[X \mid P] = nP$ and $\operatorname{Var}(X \mid P) = nP(1 - P)$. Then $E[\operatorname{Var}(X \mid P)] = n\bar{p} - nE[P^2]$ and $\operatorname{Var}(E[X \mid P]) = \operatorname{Var}(nP) = n^2\operatorname{Var}(P)$, so

$$\operatorname{Var}(X) = n\bar{p} - nE[P^2] + n^2\operatorname{Var}(P) = n\bar{p}(1 - \bar{p}) + n(n - 1)\operatorname{Var}(P),$$

using $E[P^2] = \operatorname{Var}(P) + \bar{p}^2$. The extra term is positive whenever the clusters differ. Define $\rho = \operatorname{Var}(P)/[\bar{p}(1 - \bar{p})]$. The variance becomes

$$\operatorname{Var}(X) = n\bar{p}(1 - \bar{p})\,\big[1 + (n - 1)\rho\big].$$

The factor $1 + (n - 1)\rho$ is the design effect of sampling in clusters of size $n$. Conditional Expectation and the Laws of Total Expectation and Variance derives the same factor for a cluster probability with any distribution, and Expectation, Variance and Covariance obtains it from the variance of a sum of equally correlated variables, and Clustered Standard Errors measures it for benchmark questions that share a subject.

The number $\rho$ is the correlation between the outcomes of two people drawn from the same cluster, where the correlation of two variables is their covariance divided by the product of their standard deviations. To see it, let $Y_1$ and $Y_2$ be the indicators of obesity for two of the draws. Given $P = q$ they are independent Bernoulli variables, so $E[Y_1 Y_2 \mid P = q] = q^2$, and by the law of total expectation $E[Y_1 Y_2] = E[P^2]$ and $E[Y_1] = E[Y_2] = \bar{p}$. Hence

$$\operatorname{Cov}(Y_1, Y_2) = E[P^2] - \bar{p}^2 = \operatorname{Var}(P), \qquad \operatorname{Var}(Y_1) = \operatorname{Var}(Y_2) = \bar{p}(1 - \bar{p}),$$

and the correlation is $\operatorname{Var}(P)/[\bar{p}(1 - \bar{p})] = \rho$.

The check on NHANES. For obesity across the 30 groups, $\bar{p} = 0.4073$, $\operatorname{Var}(P) = 0.006413$ (a standard deviation of 0.0801 between groups) and $\rho = 0.0266$. A correlation that small looks harmless, but it is multiplied by $n - 1$:

  • For 10 adults from one location, the variance is $2.4140 + 90 \times 0.006413 = 2.9912$ instead of 2.4140, a design effect of 1.239.
  • For 50 adults from one location, the design effect would be 2.302. The clustered sample would carry about as much information about the population as 22 adults drawn from it at random.

In the tails, no obese adults among the 10 has probability 0.0110, against 0.0054 for the binomial. Seven or more has probability 0.0838, against 0.0604. A simulation of 20,000 such samples for each of 30 seeds gave a variance with median 2.9927 (interquartile range 2.9769 to 3.0090), in agreement with the formula.

Example (clustering leaves the mean alone). Sampling from one location does not change the mean number of obese adults among the 10. By the law of total expectation, $E[X] = E\big[E[X \mid P]\big] = E[nP] = n\bar{p} = 4.073$. (It differs from 4.110 only because the 30 locations get equal weight.) Clustering leaves the center alone and widens the spread, which is what makes it easy to overlook.

For the three readings, setting the design effect $1 + (n - 1)\rho$ with $n = 3$ equal to the observed ratio of 2.670 gives $\rho = (2.670 - 1)/2 = 0.835$. The formula was derived for a cluster with one common probability, and the three readings have slightly different shares at or above 130 (0.3588, 0.3613 and 0.3476) and three different pairwise correlations, 0.837, 0.817 and 0.852. The number 0.835 is, to three decimals, the average of those three correlations. That is no accident: when three variables have equal variances $\sigma^2$, the variance of their sum is $3\sigma^2 + 6\bar{\rho}\sigma^2 = 3\sigma^2(1 + 2\bar{\rho})$, with $\bar{\rho}$ the average pairwise correlation, whatever the dependence, and the three readings' variances are nearly equal. Readings of the same person are very strongly correlated, as they should be if they measure the same blood pressure.

The two departures act in opposite directions:

  • Unequal probabilities among independent trials, fixed in advance, make counts less variable than the binomial.
  • Probabilities that vary at random between clusters, and are shared within them, make counts more variable.

The second is far more common in practice and far more dangerous. A method that assumes binomial variance then understates its standard errors. Survey analyses such as those of NHANES use the design variables for this reason (Survey Sampling Designs derives the design effect for a finite population of clusters, with no model), and a bootstrap must resample whole clusters (Resampling Dependent and Clustered Data does so for the three readings). Studies that randomize clinics or communities rather than people plan their sample size with the design effect. The Poisson distribution has an exact counterpart, overdispersion, treated in Overdispersion in Count Data.

Example (a common misstatement). "A count of yes-or-no outcomes among $n$ observations is binomial." The precise statement adds the two conditions the sentence leaves out: the outcomes must be independent and share one probability. Without them only the mean survives. The three readings have mean $3p = 1.0677$, exactly as a binomial would, and a variance 2.670 times the binomial's. Dependence leaves the mean $np$ unchanged and changes everything else about the distribution.

Worked problems

The first three problems are adapted from exercises in the course text's chapter on theoretical probability distributions (Pagano, Gauvreau and Mattie, 2022). They are posed here in our own words, and parts of their statements are reconstructed, so they are not the text's wording. The fourth is posed on this article's NHANES survey locations. The script named under "In Python" checks every number.

Problem 1 (seven older adults and diabetes). Among adults aged 65 and over, 25.2% have been diagnosed with diabetes. Seven such adults are selected at random. (a) In how many ways can the seven be ordered in a list? (b) Without regard to order, in how many ways can four of the seven be chosen? (c) Find the probability that exactly two of the seven have been diagnosed with diabetes. (d) Find the probability that at most two have. (e) Find the probability that exactly four have.

Solution. Parts (a) and (b) are counting; parts (c) to (e) use the binomial distribution, which applies because the seven adults are a random sample from a very large population. The number is fixed at 7, each adult has the diagnosis or not, each has probability 0.252 of having it, and the draws are independent for practical purposes, since removing a few people from millions leaves the proportion unchanged. So the number diagnosed is $X \sim \text{Bin}(7, 0.252)$.

(a) The first place in the list can be filled in 7 ways, the second in 6, and so on: $7! = 7 \cdot 6 \cdot 5 \cdot 4 \cdot 3 \cdot 2 \cdot 1 = 5{,}040$ orders.

(b) $\binom{7}{4} = \dfrac{7!}{4!\,3!} = \dfrac{7 \cdot 6 \cdot 5}{3 \cdot 2 \cdot 1} = 35$ ways.

(c) There are $\binom{7}{2} = 21$ ways to place the two diagnosed adults among the seven, and each such arrangement has probability $0.252^2 \times 0.748^5 = 0.063504 \times 0.234157 = 0.014870$. So

$$P(X = 2) = 21 \times 0.014870 = 0.3123.$$

(d) "At most two" is the event $X = 0$, 1 or 2. The two new terms are

$$P(X = 0) = 0.748^7 = 0.1310, \qquad P(X = 1) = 7 \times 0.252 \times 0.748^6 = 7 \times 0.252 \times 0.175150 = 0.3090,$$

and $P(X \le 2) = 0.1310 + 0.3090 + 0.3123 = 0.7522$ (the sum is taken before rounding; the rounded terms add to 0.7523).

(e) By part (b) there are 35 arrangements, each with probability $0.252^4 \times 0.748^3 = 0.004033 \times 0.418509 = 0.001688$, so $P(X = 4) = 35 \times 0.001688 = 0.0591$.

The answers fit the shape results of this article. The mean is $7 \times 0.252 = 1.764$, and $(n + 1)p = 2.016$, so the mode is 2. Indeed $P(X = 2) = 0.3123$ from (c) exceeds $P(X = 1) = 0.3090$ from (d), though only narrowly.

Problem 2 (television hours in a class of twenty). According to the Youth Risk Behavior Surveillance System, 20.7% of American high school students watch three or more hours of television a day. Twenty students are selected at random. (a) Find the mean and standard deviation of the number who watch three or more hours. (b) Find the probability that 18 or more of the twenty do. (c) Find the probability that 8 or more do.

Solution. The count is $X \sim \text{Bin}(20, 0.207)$, by the same reasoning as in Problem 1.

(a) The mean is $np = 20 \times 0.207 = 4.14$ students. The variance is $np(1 - p) = 20 \times 0.207 \times 0.793 = 3.2830$, and the standard deviation is $\sqrt{3.2830} = 1.8119$ students.

(b) Three terms of the formula are needed:

$$P(X = 18) = \binom{20}{18}\, 0.207^{18}\, 0.793^{2} = 190 \times 0.207^{18} \times 0.793^2 = 5.82 \times 10^{-11},$$

$$P(X = 19) = 20 \times 0.207^{19} \times 0.793 = 1.60 \times 10^{-12}, \qquad P(X = 20) = 0.207^{20} = 2.09 \times 10^{-14}.$$

Their sum is $P(X \ge 18) = 5.98 \times 10^{-11}$, about 6 in 100 billion. A class of twenty with 18 such students would be strong evidence that it was not a random sample of this population.

(c) Eight or more is the complement of seven or fewer. The probabilities of 0 to 7 are

$x$ 0 1 2 3 4 5 6 7
$P(X = x)$ 0.0097 0.0505 0.1252 0.1961 0.2175 0.1817 0.1186 0.0619

which add to $P(X \le 7) = 0.9612$. So $P(X \ge 8) = 1 - 0.9612 = 0.0388$. Eight is $(8 - 4.14)/1.8119 = 2.13$ standard deviations above the mean, and about 1 class in 26 reaches it.

Problem 3 (days of high carbon monoxide). Air pollution in a large city is monitored for one week. Let $X$ be the number of the seven days on which the concentration of carbon monoxide exceeds a given level. Is it reasonable to treat $X$ as a binomial random variable?

Solution. Not without evidence about the last two of the four conditions. Take them in turn.

  1. A fixed number of trials. The week has seven days: satisfied.
  2. Two outcomes. Each day the level is exceeded or it is not: satisfied.
  3. A constant probability. Doubtful. Traffic differs between working days and the weekend, and the weather that traps or clears pollution changes through the week, so the probability of exceeding the level need not be the same every day.
  4. Independence. Doubtful. The same weather tends to last several days, so a day above the level makes the next day more likely to be above it too.

The article's results say what each failure does. The mean is $\sum p_i$, the sum of the seven daily probabilities, whatever the dependence. If only condition 3 failed, the variance would be $\sum p_i(1 - p_i)$, smaller than the binomial variance with the average probability. If condition 4 fails through positive dependence, the variance is larger. For instance, with a common probability $p$ and a common correlation $\rho$ between the indicators of any two days, each of the $7 \times 6$ ordered pairs has covariance $\rho\,p(1 - p)$, and the formula for the variance of a sum gives

$$\operatorname{Var}(X) = 7p(1 - p) + 42\,\rho\,p(1 - p) = 7p(1 - p)(1 + 6\rho).$$

So the count would be more spread out around its mean than the binomial predicts. The script confirms the formula on the beta-binomial distribution, in which the week's probability is drawn from a beta distribution and shared by the seven days. If the dependence comes about in that way, from a probability $P$ that varies at random from week to week and is shared by the days of a week, as with the survey locations above, weeks with no high days are also more common than under the binomial. The probability of such a week is the average of $(1 - P)^7$, and that is at least $(1 - \bar{p})^7$: the function $g(q) = (1 - q)^7$ is convex on $0 \le q \le 1$, so it lies on or above its tangent line at $\bar{p}$, $g(q) \ge g(\bar{p}) + g'(\bar{p})(q - \bar{p})$, and taking expected values removes the last term. The complete answer is that $X$ is binomial only if the daily probability is constant and the days are independent, that neither is plausible here, and that daily records, compared with the binomial as the three readings were, would settle it.

Problem 4 (twenty-five adults from one survey location). A study chooses one of the 30 NHANES survey locations of this article at random and draws 25 adults from it, with replacement. Find the mean and standard deviation of the number who are obese, the design effect, and the size of a simple random sample that would give a proportion of the same precision.

Solution. Use the cluster results with $n = 25$, $\bar{p} = 0.4073$ and $\operatorname{Var}(P) = 0.006413$ (all computed from unrounded values). The mean is $n\bar{p} = 25 \times 0.4073 = 10.182$ adults. The variance has two parts:

$$n\bar{p}(1 - \bar{p}) = 25 \times 0.4073 \times 0.5927 = 6.0350, \qquad n(n - 1)\operatorname{Var}(P) = 600 \times 0.006413 = 3.8481.$$

Their sum is 9.8831, a standard deviation of 3.144 adults, against 2.457 for a binomial count. The script confirms the variance by summing over the exact distribution of the count. The design effect is the ratio $9.8831/6.0350 = 1.638$, which is also $1 + 24\rho$ with $\rho = 0.0266$. A simple random sample of $m$ adults gives a proportion with variance $\bar{p}(1 - \bar{p})/m$, and the 25 clustered adults give $\bar{p}(1 - \bar{p}) \times 1.638/25$. The two are equal when $m = 25/1.638 = 15.3$. The 25 adults from one location are worth about 15 drawn from all locations.

Summary

Quantity Formula
Bernoulli mean $p$, variance $p(1 - p)$
Binomial pmf $P(X = x) = \binom{n}{x}p^x(1 - p)^{n - x}$, $x = 0, \ldots, n$
Binomial mean, variance $np$, $np(1 - p)$
Mode the whole number(s) $x$ with $(n + 1)p - 1 \le x \le (n + 1)p$
Unequal $p_i$, independent variance $n\bar{p}(1 - \bar{p}) - nV$
Clusters of size $n$ variance $n\bar{p}(1 - \bar{p})[1 + (n - 1)\rho]$

What we have learned

Counting sequences of independent trials gives the binomial distribution, with mean $np$ and variance $np(1 - p)$: for 10 adults from NHANES, 4.110 obese adults on average, with a standard deviation of 1.5559. The mean survives any failure of the conditions; the variance does not. Unequal probabilities fixed in advance shrink it. Dependence inflates it: an adult's three readings vary 2.670 times as much as the binomial allows, and drawing from one survey location multiplies the variance by 1.239.

When $n$ is large and $p$ small, as for deaths in a large population, the binomial needs $n$ and $p$ separately, and often neither is known. The Poisson Distribution derives the distribution such counts follow, which depends on $n$ and $p$ only through the mean $np$.

In Python

from scipy import stats

X = stats.binom(10, 0.4110)       # obese adults among 10
print(X.pmf(4))                   # P(X = 4): about 0.2502
print(X.cdf(2), X.sf(6))          # P(X <= 2) about 0.1502; P(X >= 7) about 0.0634
print(X.mean(), X.var())          # 4.110, about 2.4208

sf(x) is the survival function $P(X > x)$, so $P(X \ge 7)$ is sf(6). Every number in this article is computed by tools/experiments/applied-statistics/binomial-distribution.py in the site's repository, from the NHANES files loaded by descdata.py and probdata.py.

References

  • Grinstead, C. M., and Snell, J. L. (1997). Introduction to Probability (2nd rev. ed.), §3.2 (Bernoulli trials and binomial probabilities). American Mathematical Society. record · 22 pages
  • National Center for Health Statistics (2020). National Health and Nutrition Examination Survey 2017–2018: DEMO_J (including the masked variance units SDMVPSU and SDMVSTRA), BPX_J (three consecutive readings after five minutes' rest), BPQ_J, BMX_J, DIQ_J and SMQ_J data files and documentation. Centers for Disease Control and Prevention. https://wwwn.cdc.gov/nchs/nhanes/continuousnhanes/default.aspx?BeginYear=2017 record · 109 pages
  • NIST/SEMATECH. e-Handbook of Statistical Methods, §1.3.6.6.18 (Binomial distribution). National Institute of Standards and Technology. https://www.itl.nist.gov/div898/handbook/ record · 37 pages
  • Pagano, M., Gauvreau, K., and Mattie, H. (2022). Principles of Biostatistics (3rd ed.). CRC Press. The course text. record · 48 pages

Reviewed: verified, 16 Nov 2026 · citations checked, 16 Nov 2026 · editorial review, 23 Nov 2026 · 12 revisions