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 exactly that: a rule attaching a number to the outcome of a random phenomenon, with the value decided only once the phenomenon runs. 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, so listing is hopeless and probability has to come from area under a curve instead, which is what Section 1.5 was doing with the normal distribution. 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, and the numbers come from the formula two sections down; take them as given for the moment, because the question here is what you do with a table once you have one.
| x | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
|---|---|---|---|---|---|---|---|---|---|
| P(X = x) | .1001 | .2670 | .3115 | .2076 | .0865 | .0231 | .0038 | .0004 | .0000 |
Two conditions make a table like this a legitimate distribution: every probability lies between 0 and 1, and they add to exactly 1. Once it does, 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 pulls three times as hard as one with probability .1001. The variance does the same to squared distances from the mean, exactly as the variance of a dataset does, with probabilities standing in for 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, which is a one-in-four chance taken eight times and no great surprise. 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, and five right sits more than two standard deviations above chance, which happens by luck alone 2.7% of the time.
Doing those sums once by hand is worth the ten minutes, because the rest of this lesson makes them unnecessary. A count of successes in n independent trials with a constant success probability has a name and two closed forms, and those forms return 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.
Checking those four is the whole skill, because the formula is unforgiving about them. 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 under a quarter of the time, which is worth remembering before reading anything into a result that merely landed on the average.
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 sits two standard deviations up. The exact probability of scoring six or better by guessing alone is 0.054, which the widget will confirm if you set n = 12, p = 0.25 and ask for 6 or more.
Notice how σ behaves as you slide p. 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 watch the lean fade: the bars settle into the familiar bell whatever p you chose, which is the central limit theorem showing up early, since a binomial count is a sum of n independent trials.
That convergence is what makes the next few lessons possible. 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 exactly that. The usual rule of thumb is that np and n(1 − p) should both reach at least 10 before the approximation is safe, which is why a rare event needs a large study.
To compare the binomial with its neighbors, and to overlay the normal approximation on it directly, the distribution playground renders all nine distributions the course uses from the same exact math this page does.
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. Four conditions in, one probability out. Everything about proportions later, including the χ² tests in Section 1.16, rests 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 fair 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)⁷. The coefficient is bookkeeping, not extra probability.
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, and it is really a rule about the tails rather than about n alone. 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. Note what the rule uses: not n on its own, but the expected number of successes AND the expected number of failures, which is why a rare outcome demands a large study before any normal-based method is safe.