- The binomial distribution — X ~ B(n, p) · coming soon
- The binomial theorem · coming soon
- Hypothesis testing with the binomial distribution · coming soon
The number you expect is not very likely
Amara plays basketball. Over a whole season, she scores 70% of her free throws. In tonight's game she takes 10 free throws.
How many will she score? Most people answer at once: "about 7". Seven is 70% of 10, so 7 is the number you expect. Now a harder question. How likely is it that she scores exactly 7? Make a guess before you read on.
Each free throw scores with probability 0.7, and the throws do not affect each other. Amara takes 10. What is the probability that she scores exactly 7?
The probability that Amara scores exactly 7 of her 10 free throws is only about 0.27. Seven is her most likely result, but the other results (6, 8, 9 and the rest) share almost three quarters of the probability between them.
The answer is about 0.27. The most likely result happens only about one game in four.
A tree diagram would work, but 10 throws give paths. Nobody draws that tree, and you do not need to. The tree diagrams lecture gave the idea: count the paths you want, then multiply by the probability of one path. The last lecture gave the tool for counting. This lecture puts the two together, and the result is called the binomial distribution.
One honest note: real players have good and bad nights. So "0.7 on every throw, with no throw affecting another" is a model, but a useful one.
Three throws, drawn in full
Start small enough to draw. Amara takes 3 free throws. Write S for a score and M for a miss. On every throw, S has probability 0.7 and M has probability 0.3.
Which paths give exactly 2 scores? There are three: SSM, SMS and MSS. Multiply along each one.
SMS: 0.7 × 0.3 × 0.7 = 0.147
MSS: 0.3 × 0.7 × 0.7 = 0.147
Two things stand out.
First, the three paths have the same probability. This is not luck. Each of them multiplies two 0.7s and one 0.3. Only the order is different, and the order does not change a product. So every path with 2 scores has the probability .
Second, the number of these paths can be counted without drawing them. A path with exactly 2 scores is decided by one choice: which 2 of the 3 throws are the scores. Use the swap test from the last lecture. Choosing throws 1 and 3 is the same as choosing throws 3 and 1. So this is a selection, and the number of selections is .
The three paths cannot happen together, so their probabilities add:
That is it. That is the whole idea. Count the paths with a combination. Then multiply by the probability of one path. Everything else in this lecture is this idea, used carefully.
The same reasoning gives every possible number of scores out of 3:
| Scores | Paths | One path | Probability |
|---|---|---|---|
| 0 | 1 | 0.3³ = 0.027 | 0.027 |
| 1 | 3 | 0.7 × 0.3² = 0.063 | 0.189 |
| 2 | 3 | 0.7² × 0.3 = 0.147 | 0.441 |
| 3 | 1 | 0.7³ = 0.343 | 0.343 |
Check: ✓. The four results cover every path, so they must add to 1.
The formula, read as a sentence
Now give everything a name. Each repeat of the experiment is a trial. The result we count is called a success, and the other result a failure. "Success" is only a label. It can be a faulty phone, a six on a die, or a child with an illness. Let
- = the number of trials,
- = the probability of success on each trial,
- = the number of successes.
is a number decided by chance. A quantity like this is called a random variable. When the conditions in the next section hold, we write . Read it as " follows the binomial distribution with trials and probability ".
If , then for :
Read the formula as a sentence, from left to right. is the number of paths: the number of ways to choose which of the trials are successes. is for the successes on one path. is for the failures on the same path. Some books write for . It means the same thing.
Now Amara's 10 throws. Here , and . A path with 7 scores has 3 misses. The last lecture showed that choosing 7 is the same as choosing the 3 left out, so .
One path with exactly 7 scores is very unlikely: about 0.0022. But there are 120 such paths. Together they give about 0.267. Here is every result from 0 to 10, worked out in the same way.
The bars have gaps, because the number of scores is always a whole number. Seven gets the most, but 6 and 8 are close behind, and 5 and 9 each get about one game in ten. That is why the most likely result is not very likely.
Four conditions, and why each one matters
The formula works only when four conditions hold. Do not learn them as a list. Each one is needed by a step of the argument above.
- 1. A fixed number of trials, . The formula counts paths of length . If the trials continue "until the first six", the number of trials is not fixed, and there is no to put in.
- 2. Two outcomes on each trial. Each branch is either success or failure. A die has six faces, but "six" and "not six" turns it into two outcomes.
- 3. The same probability on every trial. This is what made all paths with the same number of successes equally likely. If changed from trial to trial, those paths would have different probabilities, and one count times one path would be wrong.
- 4. Independent trials. One result must not change the next. In the tree diagrams lecture, a ball taken from a bag without replacement changed the next branch. Then the branches are not simply and , and the formula fails.
Trials like these, with two outcomes and a fixed probability, are often called Bernoulli trials. The name honours the Swiss mathematician Jacob Bernoulli. He studied them in his book Ars Conjectandi ("The Art of Conjecturing"), which was published in 1713, eight years after his death.
Which of these can be modelled by a binomial distribution? (a) Five cards are dealt from a pack, and is the number of hearts. (b) A die is rolled 8 times, and is the number of rolls that show 5 or 6. (c) A coin is tossed until the first head, and is the number of tosses.
Show the answer
(a) No. The cards are not put back. After a heart, there are fewer hearts left, so the probability changes and the trials are not independent. (b) Yes. There are 8 trials, two outcomes ("5 or 6" or not), the same probability each time, and the rolls do not affect each other. So . (c) No. The number of tosses is not fixed.
Pascal's triangle returns
The last lecture ended with six tastes and the numbers 1, 6, 15, 20, 15, 6, 1, and promised that they would appear again. Here they are. They are one row of Pascal's triangle.
Row of the triangle lists . The top row is called row 0. So row 3 is 1, 3, 3, 1. These are exactly the numbers of paths in the table for three throws.
Why is each number the sum of the two above it? Paths explain it. Think of the paths with successes in trials, and look only at the last trial. Either the last trial is a success, and the first trials hold successes. Or it is a failure, and the first trials hold all successes. Every path is in exactly one of these two groups. So
For example, .
A row of the triangle is a row of counts, not probabilities. It becomes a distribution in one special case: . Then every path has the same probability, , so you divide the whole row by . Toss a fair coin 6 times. The probability of exactly 3 heads is . For any other , each count must be multiplied by its own path probability, as in Amara's table.
Explore the shape
Try it yourself below. Change the number of trials and the probability of success, and watch how the bars move. Then choose a value of , and read the formula with its numbers.
Change n and p and watch the bars. Then move r to choose one bar. The dashed line marks the mean, np.
Trials n: 10
Probability p: 0.7
Successes r: 7
The table compares three distributions with 10 trials. Each column adds to 1. With the large probabilities are at the left, with the column is symmetrical, and with it is the column turned upside down. Values are to 4 decimal places, so 0.0000 means a probability smaller than 0.000 05, not zero.
| r | B(10, 0.3) | B(10, 0.5) | B(10, 0.7) |
|---|---|---|---|
| 0 | 0.0282 | 0.0010 | 0.0000 |
| 1 | 0.1211 | 0.0098 | 0.0001 |
| 2 | 0.2335 | 0.0439 | 0.0014 |
| 3 | 0.2668 | 0.1172 | 0.0090 |
| 4 | 0.2001 | 0.2051 | 0.0368 |
| 5 | 0.1029 | 0.2461 | 0.1029 |
| 6 | 0.0368 | 0.2051 | 0.2001 |
| 7 | 0.0090 | 0.1172 | 0.2668 |
| 8 | 0.0014 | 0.0439 | 0.2335 |
| 9 | 0.0001 | 0.0098 | 0.1211 |
| 10 | 0.0000 | 0.0010 | 0.0282 |
Here is what you should have seen. With , the bars are symmetrical. With below 0.5, the tall bars sit at the left; with above 0.5, at the right. The tallest bar is always at the mean or next to it. As grows, the bars spread out and get shorter, because more results share the same total of 1.
The mean: what to expect in the long run
Amara expects 7 scores from 10 throws. Here is the reason, made exact. Imagine she takes her 10 throws in each of 100 games. That is 1000 throws. About 70% of them score, so about 700 scores. Spread over 100 games, that is about 7 scores per game.
The table gives the same answer another way. The mean of a distribution is found by multiplying each value by its probability and adding. For three throws:
And ✓. The mean is also called the expected value, written .
If , then .
"Expected" means the average over many repeats, not a promise for one. It need not even be possible: with 10 trials and , the mean is 2.5.
Worked examples
. Find .
Choose which 4 of the 10 trials are successes: .
One path has 4 successes and 6 failures: and .
Check: the mean is , so 4 should be a little less likely than 3. Indeed , the same as for Amara. That is no accident: 7 scores at 0.7 means 3 misses at 0.3 ✓.
. Find (a) and (b) .
(a) "At least 1" covers 1, 2, 3, 4 and 5: five calculations. Its complement is just one value, 0. So
(b) The complement of "at least 2" is "0 or 1". First, . So
Check: (b) must be smaller than (a), because "at least 2" is harder than "at least 1" ✓.
A machine makes light bulbs, and 5% of them are faulty. An inspector tests 20 bulbs. Find the probability that (a) exactly 2 are faulty, (b) at least 2 are faulty.
Conditions. There are 20 trials. Each bulb is faulty or not. Assume each bulb has the same 0.05 chance, and that one faulty bulb does not make the next one more likely to be faulty. That last assumption can fail: a machine that starts to go wrong may produce a run of faulty bulbs. If the assumptions hold, , where success means "faulty".
(a) , so
(b) and . So .
Check: the mean is . So 0 and 1 faulty bulbs should be the most likely results, and they are ✓.
Some illnesses are passed on by a recessive gene. When both parents carry the gene, each child has a 1 in 4 chance of having the illness, separately for each child. A family with two carrier parents has 4 children. Find the probability that (a) exactly one child has the illness, (b) at least one child has it.
Here , where success means "has the illness". Keep the fractions exact.
(a) .
(b) .
The mean is 1 child, yet almost one such family in three () has no child with the illness. "1 in 4" is a probability for each child, not a rule that one child in four has it. Check: ✓.
is the probability of one path, such as seven scores followed by three misses. "Exactly 7 scores" allows 7 scores in any positions, so multiply by . If an answer for "exactly" looks surprisingly small, check that the count is there.
"At least 3" means 3 or more, so , not . Before you calculate, write out the values in the event and the values in its complement. For : at least 3 is {3, 4, 5}, and the complement is {0, 1, 2}.
Counting hearts in 5 cards dealt from a pack is not binomial: the probability changes after every card. Check the four conditions before writing . When a few items come from a very large group, the change is tiny and the binomial is a close model. Say so when you use it.
Work each one on paper first. Open a hint only when you are stuck.
-
A fair die is rolled 6 times. Find the probability of exactly two sixes. Give the exact fraction and a decimal.
Hint 1
Success is "six", so . What are and ?
Hint 2
Choose which 2 of the 6 rolls are sixes: . The other 4 rolls are "not six".
Full answer
. . Check: the mean is , so two sixes should be less likely than one six. , which is larger ✓.
-
A quiz has 8 questions, each with 4 options and one right answer. Javier guesses every answer at random. He passes with at least 5 right. (a) What is his expected number of right answers? (b) What is the probability that he passes?
Hint 1
. The mean is .
Hint 2
"At least 5" is 5, 6, 7 or 8. Here the event is shorter than its complement, so add the four probabilities directly.
Full answer
(a) . (b) Each probability has the bottom number : , , , , all over 65 536. Total . Guessing passes less than 3 times in 100. Check: the numerators use , because each wrong answer can be chosen in 3 ways out of 4 ✓.
-
A seed grows with probability 0.9. Mei plants 12 seeds. (a) How many does she expect to grow? (b) Find the probability that at least 11 grow. (c) Is "at least 11" more or less likely than not?
Hint 1
. "At least 11" is 11 or 12.
Hint 2
. For 11, there are ways to choose which seed fails.
Full answer
(a) . (b) and . Total . (c) More likely than not: about 2 times in 3. Check: the mean, 10.8, is close to 11, so a high answer is sensible ✓.
-
In 1693, Samuel Pepys wrote to Isaac Newton about a bet. Which is most likely with fair dice: A, at least one six when 6 dice are thrown; B, at least two sixes when 12 dice are thrown; or C, at least three sixes when 18 dice are thrown? Pepys thought C. Probability C is about 0.597. Find A and B, and decide.
Hint 1
Each case is binomial with . Use the complement for both.
Hint 2
For B, the complement of "at least two" is "zero or one six" among 12 dice.
Full answer
A: . B: and , so . So A (0.665) is the most likely, then B (0.619), then C (0.597). Newton gave Pepys this answer: the opposite order to the one Pepys expected. Each bet has a mean exactly equal to its target (1, 2 and 3 sixes), and yet the chances differ. Check: all three are above 0.5 and below 1 ✓.
The word "binomial" means "two terms". It comes from algebra. Expand and you get . Expand and you get . Look at the numbers in front: 1, 2, 1 and 1, 3, 3, 1. They are rows of Pascal's triangle, and each term is one of the binomial probabilities.
This is not a coincidence. Multiplying out means choosing or from each of the brackets, exactly like choosing failure or success on each of trials. Now put . Then , and . So all the binomial probabilities always add to exactly 1, for every and every . The Pre-University lecture on the binomial theorem develops the algebra side.
The same distribution appears wherever independent yes-or-no trials share one probability: bulbs on a production line, answers in a survey, children in a family. Later it answers a deeper question. When a result looks surprising, is it really surprising, or just chance? That is hypothesis testing, and it begins with these calculations.
- When a fixed number of independent trials each have two outcomes and the same probability of success , the number of successes follows the binomial distribution, written .
- , because counts the paths with successes and every such path has the same probability.
- Each of the four conditions is needed by a step of the argument, so check them all before writing .
- For "at least" and "at most", list the values in the event and in its complement, and use whichever list is shorter.
- The mean is , the average over many repeats, which need not be a likely result or even a possible one.
- Row of Pascal's triangle gives the numbers of paths , and it becomes the distribution itself only when , after dividing by .