The Binomial Distribution

Counting successes in n independent trials.

Counting the successes

Take n Bernoulli trials: a fixed number of independent trials, each a success with the same probability p. Let X be the number of successes. X can be any whole number from 0 to n, and its distribution is called the binomial distribution.

Toss a fair coin 5 times and let X be the number of heads. There are 2⁵ = 32 equally likely sequences of heads and tails. One of them has no heads, 5 have one head, 10 have two, 10 have three, 5 have four and 1 has five. So P(X = 2) = 10/32, for example.

0510012345

The number of heads in 5 tosses of a fair coin, as a count of the 32 equally likely sequences: 1, 5, 10, 10, 5 and 1. Each probability is its bar divided by 32.

The notation X ~ B(n, p)

A binomial distribution is fixed by two numbers, the number of trials n and the probability of success p. It is written B(n, p), and X ~ B(n, p) is read "X is distributed as B(n, p)", or "X has the binomial distribution with n trials and probability p".

The heads in 5 tosses of a fair coin are B(5, 1/2). The sixes in 10 rolls of a fair dice are B(10, 1/6). Writing the distribution down first names the trial, n and p before any working starts.

One order, then every order

Roll a fair dice 4 times. What is the probability of exactly 2 sixes? Take one order first: a six, a six, then two rolls that are not sixes. The rolls are independent, so the probabilities multiply: 1/6 × 1/6 × 5/6 × 5/6 = (1/6)² × (5/6)² = 25/1296.

But the two sixes could come on any 2 of the 4 rolls: the first and second, first and third, first and fourth, second and third, second and fourth, or third and fourth. That is 4C2 = 6 orders. Each order has the same two factors of 1/6 and two factors of 5/6, just multiplied in a different order, so each has probability 25/1296.

Add the 6 orders: P(X = 2) = 6 × 25/1296 = 150/1296 = 25/216, about 0.116.

The same reasoning gives the formula. For X ~ B(n, p), the number of successes is r with probability P(X = r) = nCr pʳ (1 − p)ⁿ⁻ʳ: there is a factor p for each of the r successes, a factor 1 − p for each of the n − r failures, and nCr orders in which the successes can come.

010020030040050060001234

The number of sixes in 4 rolls, X ~ B(4, 1/6), with each probability in 1296ths: 625, 500, 150, 20 and 1. They add up to 1296, so the probabilities add up to 1. The bar at 2 is the 150/1296 worked out above.

Why the bars follow Pascal’s triangle

When p = 1/2, a success and a failure have the same probability, so every order of n trials has probability (1/2)ⁿ. Then P(X = r) = nCr × (1/2)ⁿ, and the bars are just the numbers nCr, a row of Pascal’s triangle.

For X ~ B(4, 1/2) the bars are 1, 4, 6, 4 and 1, each over 2⁴ = 16. So P(X = 2) = 6/16. In the 5 tosses above, the counts 1, 5, 10, 10, 5, 1 are row 5.

When p is not 1/2, the factor nCr is still there, but the powers of p and 1 − p tilt the bars. With p = 1/6, failures are more likely, and the bars of B(4, 1/6) are tallest at 0.

01234

X ~ B(4, 1/2): the bars are 1, 4, 6, 4 and 1, row 4 of Pascal’s triangle, each over 16.

At most and at least

Questions often ask about several values at once. For X ~ B(4, 1/6), the probability of at most one six adds two terms: P(X ≤ 1) = P(X = 0) + P(X = 1) = 625/1296 + 500/1296 = 1125/1296, about 0.868.

For "at least one", the quickest route is the one value it leaves out. P(X ≥ 1) = 1 − P(X = 0) = 1 − 625/1296 = 671/1296, about 0.518.

The usual mistakes

Leaving out nCr. (1/6)² × (5/6)² = 25/1296 is the probability of one particular order. There are 6 orders with exactly two sixes, so the answer is 6 times as large.

Counting orders that are the same choice. Choosing the first and third rolls is the same choice as the third and first, so the count is 4C2 = 6, not 4 × 3 = 12.

Taking the share of trials as the probability. Two sixes in four rolls is not a probability of 2/4; it is 25/216.

Reading "at most 2" as "exactly 2". At most 2 allows 0, 1 or 2 successes, so three terms are added.

Worked example: Seeds That Fail to Come Up in a Tray of Twelve, and a Box of Five Trays That All Keep a Promise

Question Each seed in a nursery's trays comes up with probability 0.9, independently of the others. A tray holds 12 seeds, and the nursery promises at least 10 seedlings in every tray. Let X be the number of seeds in a tray that fail. (a) Find the probability that a tray keeps the promise, P(X ≤ 2). (b) A customer buys a box of 5 trays, whose seeds come up independently of one another too. Find the probability that all five trays keep the promise.

  1. 1.There are 12 independent trials, each seed fails with the same probability 0.1, and X counts the failures. So X ∼ B(12, 0.1), and P(X = r) = 12r (0.1)r (0.9)12 − r.

    0123456X ~ B(12, 0.1): X counts failuresat least 10 seedlings: X <= 2
    0123456X ~ B(12, 0.1): X counts failuresat least 10 seedlings: X <= 2
    X ∼ B(12, 0.1) counts the seeds that fail. The bars for 7 to 12 failures are too small to show. At least 10 seedlings is X ≤ 2, the first three bars.
  2. 2.No failures: P(X = 0) = 0.912 = 0.2824. One failure, which can be any of the 12 seeds: P(X = 1) = 12 × 0.1 × 0.911 = 0.3766.

    0.282400.3766123456P(X = 0) = 0.2824P(X = 1) = 12 × 0.1 × 0.3138 = 0.3766
    0.282400.3766123456P(X = 0) = 0.2824P(X = 1) = 12 × 0.1 × 0.3138 = 0.3766
    P(X = 0) = 0.912 = 0.2824 and P(X = 1) = 12 × 0.1 × 0.911 = 0.3766.
  3. 3.Two failures, which can be any of 122 = 66 pairs of seeds: P(X = 2) = 66 × 0.12 × 0.910 = 66 × 0.01 × 0.3487 = 0.2301.

    0.282400.376610.230123456P(X = 2) = 66 × 0.01 × 0.3487 = 0.2301
    0.282400.376610.230123456P(X = 2) = 66 × 0.01 × 0.3487 = 0.2301
    Two seeds can fail in 122 = 66 ways: P(X = 2) = 0.2301.
  4. 4.(a) The tray keeps the promise when at most 2 seeds fail: P(X ≤ 2) = 0.2824 + 0.3766 + 0.2301 = 0.8891.

    0.282400.376610.230123456P(X <= 2) = 0.2824 + 0.3766 + 0.2301= 0.8891
    0.282400.376610.230123456P(X <= 2) = 0.2824 + 0.3766 + 0.2301= 0.8891
    (a) The three gold bars together: P(X ≤ 2) = 0.8891.
  5. 5.The five trays are independent, and each keeps the promise with probability 0.8891. (b) The probability that all five do is 0.88915 = 0.556, to 3 significant figures. This is much lower than for one tray, because each of the five trays can break the promise.

    0.282400.376610.230123456all 5 trays: 0.8891 to the power 5= 0.556
    0.282400.376610.230123456all 5 trays: 0.8891 to the power 5= 0.556
    (b) The trays are independent, so all five keep the promise with probability 0.88915 = 0.556.

Answer: (a) 0.8891; (b) 0.556

Common mistakes

  • Finding only P(X = 2). At least 10 seedlings allows 0, 1 or 2 failures, so all three terms are added.
  • Leaving out 122. The product 0.12 × 0.910 is the chance that one particular pair of seeds fails and the rest come up, and there are 66 such pairs.

More probability distributions problems, worked step by step →

Practice The Binomial Distribution in the app