The Binomial Distribution
Some questions are just counting. How many of twelve guessed answers come out right, how many of forty patients respond to the drug, how many of a hundred emails get opened. When the trials all look alike and none of them influences the others, one formula gives the probability of every possible count.
Random variables, and what a distribution is for
Guess your way through eight four-option multiple-choice questions and the number you get right is not settled in advance. Call it X. A random variable is a rule that attaches a number to the outcome of a random phenomenon. Its value is decided only when the phenomenon happens. The convention is a capital letter for the variable and a small one for a particular value, so P(X = 3) reads "the probability of getting exactly three right".
Random variables come in two kinds. A discrete one takes values you can list, which covers every count and tally in this course. A continuous one takes any value in an interval. You cannot list those values, so probability comes from area under a curve instead, as it did with the normal distribution in Section 1.5. Everything below concerns a discrete one.
The probability distribution of a discrete random variable is the whole list of values with the probability of each. For eight guessed questions that is nine values. The numbers come from the formula two sections down. For now, take them as given and look at what you can do with a table like this.
| x | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
|---|---|---|---|---|---|---|---|---|---|
| P(X = x) | .1001 | .2670 | .3115 | .2076 | .0865 | .0231 | .0038 | .0004 | .0000 |
A table like this is a valid distribution when two conditions hold: every probability is between 0 and 1, and they add to exactly 1. Then the center and the spread come from two sums. The symbol Σ is a capital sigma, and it means "add up what follows" across the whole table:
μ = Σ x · p σ² = Σ (x − μ)² · p
Both are weighted averages. The mean weights each value by how often it happens, so a value with probability .3115 counts three times as much as one with probability .1001. The variance does the same with squared distances from the mean, just like the variance of a dataset, with probabilities in place of relative frequencies.
Working the first sum along the row gives 0(.1001) + 1(.2670) + 2(.3115) + 3(.2076) + 4(.0865) + 5(.0231) + 6(.0038) + 7(.0004) + 8(.0000) = 2.00. A guesser averages two right out of eight, as you would expect from a one-in-four chance taken eight times. The second sum squares each distance from 2 before weighting it, and gives σ² = 1.50, so σ = √1.50 = 1.2247. A guesser scores about 2 ± 1.2. Five right is more than two standard deviations above chance, and guessing alone gives five or more right 2.7% of the time.
Do those sums once by hand. After that you will not need them, because a count of successes in n independent trials with a constant success probability has a name and two closed forms. Those forms give 2.00 and 1.2247 for this table in one line each.
The four conditions
A count follows a binomial distribution, written B(n, p), when four things hold. There is a fixed number of trials, n, decided before you start. Each trial has two outcomes, which we label success and failure without implying either is good news. The trials are independent, so knowing how one turned out tells you nothing about the next. And the probability of success, p, is the same on every trial.
Check all four before you use the formula, because it gives wrong answers when any of them fails. Dealing cards without replacement breaks the last two at once, since removing an ace changes the chance the next card is an ace. Asking twelve friends who all live together breaks independence. Counting how many attempts it takes to succeed breaks the first condition, because there n is not fixed and the answer is a different distribution altogether.
🎮 Every Possible Count
The bars are the exact probability of each count from 0 to n. Shading picks out the probability you asked for. The row of circles is one run of the experiment; "Simulate a class" adds thirty of them as outlined bars, so you can see how far a real classroom strays from the exact shape.
One run of n trials. A filled circle is a success.
The distribution of the count
Counting the orders: n choose k
Getting three successes out of ten can happen in many different orders, and each order is equally likely. So the probability of exactly k successes has two parts: how likely one particular order is, and how many orders there are.
The count of orders is the binomial coefficient, written C(n, k) or ⁿCk and read "n choose k":
C(n, k) = n! / (k! (n − k)!)
For ten trials and three successes that is 10! / (3! · 7!) = 120 distinct orders. One particular order, say success-success-success then seven failures, has probability p³(1 − p)⁷, because the trials are independent and independent probabilities multiply. Multiplying the two parts gives the binomial probability:
P(X = k) = C(n, k) pk (1 − p)n−k
Tossing a fair coin ten times, the chance of exactly five heads is C(10, 5) × 0.5⁵ × 0.5⁵ = 252/1024 = 0.246. Five is the single most likely count, and it still happens less than a quarter of the time.
Mean and standard deviation
You do not need the formula above to describe the center and spread of a binomial count. Both have closed forms, and they are the two you will use constantly:
μ = np σ = √(np(1 − p))
The mean is the one people guess correctly: twelve questions with a one-in-four chance each average three right. The standard deviation is less obvious and more useful. For those twelve questions σ = √(12 × 0.25 × 0.75) = √2.25 = 1.5, so a guesser typically scores somewhere around 3 ± 1.5, and six correct is two standard deviations above that. The exact probability of scoring six or better by guessing alone is 0.054. To check it in the widget, set n = 12, p = 0.25 and ask for 6 or more.
As you slide p, σ changes. It peaks at p = 0.5, where each trial is maximally unpredictable, and shrinks toward zero at either extreme, where the outcome is nearly settled before the trial runs. A coin that lands heads 99% of the time produces very consistent counts.
The shape, and where it is going
At p = 0.5 the distribution is symmetric. Move p away from the middle and it leans, with a long tail pointing toward the far end of the range. Then raise n and the lean fades: the bars settle into the familiar bell whatever p you chose. This is the central limit theorem at work, because a binomial count is a sum of n independent trials.
The next few lessons depend on that convergence. Once the count is close enough to normal, the sample proportion p̂ = X/n is close to normal too, and inference for proportions is built on that. The usual rule of thumb is that np and n(1 − p) should both be at least 10 before you rely on the approximation. So a rare event needs a large study.
The distribution playground shows all nine distributions the course uses, so you can compare the binomial with the others and overlay the normal approximation on it.
Why it matters: the binomial is the first distribution in the course that comes from a described situation rather than from a shape you assume. Everything about proportions later, including the χ² tests in Section 1.16, builds on this count.
Common questions
When is a count NOT binomial?
Whenever one of the four conditions fails, and the two that fail most often are independence and a constant p. Sampling without replacement breaks both at once: deal one ace out of a deck and the chance the next card is an ace has changed. Surveying people who live together breaks independence, because their answers are related before you ask. Counting how many attempts something takes breaks the fixed-n condition, since there the number of trials is the random thing and the count of successes is fixed at one. A rough working rule for sampling without replacement: if your sample is under about 5% of the population, the change in p is small enough that the binomial is a good approximation.
Why is there a binomial coefficient in the formula?
Because k successes can arrive in more than one order, and the formula has to count them all. Any one specific order, such as three successes followed by seven failures, has probability p³(1−p)⁷, since independent probabilities multiply. But three successes out of ten can also arrive as failure-success-failure-success and so on, and every one of those arrangements has that same probability. C(10, 3) = 120 counts the arrangements, so the total is 120 × p³(1−p)⁷.
How large does n have to be before I can use the normal approximation?
The usual rule is that np and n(1−p) should both be at least 10. A binomial with p near 0.5 looks close to normal by n = 20. One with p = 0.02 is still visibly lopsided at n = 100, because the count cannot go below zero and there is no room on the left for the bell to form. So the rule uses the expected number of successes and the expected number of failures, not n on its own, and a rare outcome needs a large study before any normal-based method is safe.