18.3 The Binomial Distribution
SL 4.8
- how the binomial distribution comes from repeated, independent trials (a tree diagram)
- the conditions for a binomial model \(X \sim \mathrm{B}(n, p)\), and the formula for \(\mathrm{P}(X = r)\)
- how to find \(\mathrm{P}(X = r)\), \(\mathrm{P}(X \le r)\) and \(\mathrm{P}(X \ge r)\), by hand and on the GDC
- how to solve “inverse” problems: finding \(p\), finding \(k\), and finding the least \(n\)
Building the idea
On any school day, the probability that Leo’s bus is late is \(\frac{1}{4}\), whatever happened on other days. Let \(L\) be the event “the bus is late”, and let \(X\) be the number of days, out of 3, on which the bus is late.
Look at the situation:
- Each day has only two outcomes: late or not late.
- The days are independent.
- The probability of “late” is the same (\(\frac{1}{4}\)) every day.
Each path with exactly \(x\) late days has probability \(\left(\frac{1}{4}\right)^x\left(\frac{3}{4}\right)^{3 - x}\). The number of such paths is the number of ways to choose which \(x\) of the 3 days are late, \(\binom{3}{x}\) (see Section 5.3).
| \(x\) | paths | \(\mathrm{P}(X = x)\) |
|---|---|---|
| \(0\) | \(L'L'L'\) | \(\binom{3}{0}\left(\frac{1}{4}\right)^0\left(\frac{3}{4}\right)^3 = \frac{27}{64}\) |
| \(1\) | \(LL'L'\), \(L'LL'\), \(L'L'L\) | \(\binom{3}{1}\left(\frac{1}{4}\right)^1\left(\frac{3}{4}\right)^2 = \frac{27}{64}\) |
| \(2\) | \(LLL'\), \(LL'L\), \(L'LL\) | \(\binom{3}{2}\left(\frac{1}{4}\right)^2\left(\frac{3}{4}\right)^1 = \frac{9}{64}\) |
| \(3\) | \(LLL\) | \(\binom{3}{3}\left(\frac{1}{4}\right)^3\left(\frac{3}{4}\right)^0 = \frac{1}{64}\) |
For \(n\) days instead of 3, the same reasoning gives
\[ \mathrm{P}(X = x) = \binom{n}{x}\left(\frac{1}{4}\right)^x\left(\frac{3}{4}\right)^{n - x}, \qquad x = 0, 1, 2, \ldots, n . \]
The binomial distribution
A trial with only two outcomes, called success and failure, is a Bernoulli trial. For example:
- a card is drawn from a pack: it is a heart or it is not a heart
- a seed is planted: it grows or it does not grow
- a question is answered: the answer is right or wrong
The binomial distribution \(X \sim \mathrm{B}(n, p)\) Not in the formula booklet
If \(X\) is the number of successes in \(n\) independent trials, each with probability of success \(p\), then
\[ \mathrm{P}(X = r) = \binom{n}{r} p^r (1 - p)^{n - r}, \qquad r = 0, 1, 2, \ldots, n . \]
We write \(X \sim \mathrm{B}(n, p)\). The numbers \(n\) and \(p\) are the parameters.
- \(X\): the number of successes
- \(n\): the number of trials
- \(p\): the probability of success in one trial
- \(r\): the number of successes we want (\(r = 0, 1, 2, \ldots, n\))
- \(1 - p\): the probability of failure in one trial
- \(\binom{n}{r}\): the number of ways to choose which \(r\) of the \(n\) trials are successes
The booklet gives only \({}^n\mathrm{C}_r = \binom{n}{r}\) (1.9) and the mean and variance (4.8).
Conditions for a binomial model Not in the formula booklet
- a fixed number of trials, \(n\)
- each trial has only two outcomes (success / failure)
- the trials are independent
- the probability of success \(p\) is the same for every trial
How to answer a binomial question
- Define the random variable in words (“\(X\) is the number of … out of …”).
- State the distribution and its parameters, for example \(X \sim \mathrm{B}(5,\, 0.9)\).
- Write the probability you need, then calculate it.
Examples of binomial models
- The probability that Mei catches her train is \(0.9\) each day, independently. Let \(X\) be the number of days, out of 5, on which she catches it. Then \(X \sim \mathrm{B}(5,\, 0.9)\).
- A goalkeeper saves each penalty with probability \(0.2\), independently. Let \(Y\) be the number of saves from 8 penalties. Then \(Y \sim \mathrm{B}(8,\, 0.2)\).
- Not binomial: the number of aces when 5 cards are drawn without replacement. The draws are not independent, and \(p\) changes.
The shape of \(\mathrm{B}(n, p)\) depends on \(p\) (Figure 2): skewed to the right for small \(p\), symmetric for \(p = 0.5\), and skewed to the left for large \(p\).
Example 1 A fair dice is thrown 5 times. Find the probability of getting exactly two sixes.
Let \(X\) be the number of sixes in 5 throws. \(X \sim \mathrm{B}\left(5, \frac{1}{6}\right)\).
\[ \mathrm{P}(X = 2) = \binom{5}{2}\left(\frac{1}{6}\right)^2\left(\frac{5}{6}\right)^3 = 10 \times \frac{1}{36} \times \frac{125}{216} = \frac{1250}{7776} = \frac{625}{3888} \approx 0.161 . \]
Example 2 Past records show that 1 in 20 phone batteries from a factory is faulty. 15 batteries are chosen at random. Find the probability that at most one of them is faulty.
Let \(X\) be the number of faulty batteries out of 15. \(X \sim \mathrm{B}(15,\, 0.05)\).
\[ \mathrm{P}(X \le 1) = \mathrm{P}(X = 0) + \mathrm{P}(X = 1) = 0.95^{15} + \binom{15}{1}(0.05)(0.95)^{14} = 0.829 \;(3 \text{ s.f.}) \]
Binomial probabilities on the GDC
In the examination, binomial probabilities are normally found with technology. Two commands do almost everything:
- Binomial Pdf gives \(\mathrm{P}(X = r)\) (or the whole table).
- Binomial Cdf gives \(\mathrm{P}(a \le X \le b)\), the probability for a range of values.
Because \(X\) only takes whole numbers, change every inequality into “\(\le\)” form first.
Changing inequalities (for whole numbers)
| You need | Write it as | GDC |
|---|---|---|
| \(\mathrm{P}(X < r)\) | \(\mathrm{P}(X \le r - 1)\) | binomCdf\((n, p, 0, r - 1)\) |
| \(\mathrm{P}(X > r)\) | \(1 - \mathrm{P}(X \le r)\) | binomCdf\((n, p, r + 1, n)\) |
| \(\mathrm{P}(X \ge r)\) | \(1 - \mathrm{P}(X \le r - 1)\) | binomCdf\((n, p, r, n)\) |
| \(\mathrm{P}(a \le X < b)\) | \(\mathrm{P}(X \le b - 1) - \mathrm{P}(X \le a - 1)\) | binomCdf\((n, p, a, b - 1)\) |
- \(X\): a binomial random variable, \(X \sim \mathrm{B}(n, p)\)
- \(r\), \(a\), \(b\): whole numbers
- \(n\): the number of trials
- \(p\): the probability of success in one trial
Example 3 Leo’s bus (above): \(X \sim \mathrm{B}\left(3, \frac{1}{4}\right)\).
(a) Use your GDC to show the probability distribution of \(X\).
(b) Find \(\mathrm{P}(X = 2)\).
(c) Find \(\mathrm{P}(X \le 2)\).
(a) binomPdf\((3, 0.25)\) (with no value of \(x\)) gives the list \(\{0.421875,\; 0.421875,\; 0.140625,\; 0.015625\}\), the probabilities for \(x = 0, 1, 2, 3\). These agree with the table above.
(b) binomPdf\((3, 0.25, 2) = 0.140625 = 0.141\) (3 s.f.).
(c) binomCdf\((3, 0.25, 0, 2) = 0.984375 = 0.984\) (3 s.f.). Or, by the complement: \(1 - \mathrm{P}(X = 3) = 1 - \frac{1}{64} = \frac{63}{64}\).
Example 4 \(X \sim \mathrm{B}(9,\, 0.35)\). Find
(a) \(\mathrm{P}(X = 4)\)
(b) \(\mathrm{P}(X < 4)\)
(c) \(\mathrm{P}(X > 4)\) \(\quad\)
(d) \(\mathrm{P}(X \ge 4)\) \(\quad\) (e) \(\mathrm{P}(2 \le X < 6)\)
(a) binomPdf\((9, 0.35, 4) = 0.219\).
(b) $(X ) = $ binomCdf\((9, 0.35, 0, 3) = 0.609\).
(c) $(X ) = $ binomCdf\((9, 0.35, 5, 9) = 0.172\). (Or \(1 - \mathrm{P}(X \le 4)\).)
(d) \(\mathrm{P}(X \ge 4) = 1 - \mathrm{P}(X \le 3) = 1 - 0.6089 = 0.391\).
(e) $(2 X ) = $ binomCdf\((9, 0.35, 2, 5) = 0.825\).
Inverse problems: finding \(n\), \(k\) or \(p\)
Sometimes the probability is given and a parameter is unknown. There are three common types.
The least number of trials for “at least one”
“At least one success” is the complement of “no successes”: \(\;\mathrm{P}(X \ge 1) = 1 - (1 - p)^n\).
Example 5 An archer hits the target with probability \(0.15\) on each shot, independently. Find the least number of shots needed for the probability of at least one hit to be greater than \(0.95\).
Let \(X \sim \mathrm{B}(n,\, 0.15)\). We need
\[ 1 - 0.85^n > 0.95 \;\Longrightarrow\; 0.85^n < 0.05 \;\Longrightarrow\; n\ln 0.85 < \ln 0.05 \;\Longrightarrow\; n > \frac{\ln 0.05}{\ln 0.85} = 18.4\ldots \]
(The inequality sign turns round because \(\ln 0.85 < 0\).) So the least number of shots is \(n = 19\).
Check: \(1 - 0.85^{18} = 0.946\) and \(1 - 0.85^{19} = 0.954\) ✓.
“At least one hit with probability greater than \(0.95\)” means “no hits with probability less than \(0.05\)”, that is \(\mathrm{P}(X \le 0) < 0.05\).
Calculator → Menu → Probability → Distributions → Inverse Binomial N. In the box called Num Trials, enter Cumulative Prob \(= 0.05\), Prob Success \(= 0.15\), Successes \(x = 0\).
invBinomN(0.05, 0.15, 0) returns \(19\): the least \(n\) for which \(\mathrm{P}(X \le 0)\) is below \(0.05\). Ticking Matrix Form also shows the cumulative probabilities for \(n = 18\) and \(n = 19\) (\(0.0536\) and \(0.0456\)), which is a good check.
This command works only with a cumulative probability \(\mathrm{P}(X \le x)\). For “exactly \(x\)” use a table (next example).
The least \(n\) for an “exactly \(r\)” condition: use a table
Example 6 A player scores a basket with probability \(0.4\) on each throw, independently. Find the least number of throws \(n\) for which the probability of scoring exactly three times is greater than \(0.25\).
\(X \sim \mathrm{B}(n,\, 0.4)\), and we need \(\mathrm{P}(X = 3) > 0.25\). Make a table of \(\mathrm{P}(X = 3)\) against \(n\):
| \(n\) | \(3\) | \(4\) | \(5\) | \(6\) | \(7\) |
|---|---|---|---|---|---|
| \(\mathrm{P}(X = 3)\) | \(0.0640\) | \(0.1536\) | \(0.2304\) | \(0.2765\) | \(0.2903\) |
The probability first goes above \(0.25\) at \(n = 6\). So the least number of throws is \(6\).
In a Calculator page, enter binomPdf(3, 0.4, 3) (Num Trials \(n = 3\), Prob Success \(0.4\), \(X\) Value \(3\)). Then change only the first number to \(4, 5, 6, \ldots\) and press enter each time, until the value first passes \(0.25\):
| Entry | Result |
|---|---|
binomPdf(3, 0.4, 3) |
\(0.064\) |
binomPdf(4, 0.4, 3) |
\(0.1536\) |
binomPdf(5, 0.4, 3) |
\(0.2304\) |
binomPdf(6, 0.4, 3) |
\(0.27648\) |
Inverse Binomial N cannot be used here: it works only with a cumulative probability \(\mathrm{P}(X \le x)\), not with \(\mathrm{P}(X = 3)\).
Finding the number of successes \(k\) from a cumulative probability
Example 7 A player takes 12 penalty kicks and scores each with probability \(0.25\), independently. Find the least value of \(k\) for which \(\mathrm{P}(X \le k) > 0.95\), where \(X\) is the number of goals.
\(X \sim \mathrm{B}(12,\, 0.25)\). Cumulative probabilities from the GDC:
| \(k\) | \(4\) | \(5\) | \(6\) |
|---|---|---|---|
| \(\mathrm{P}(X \le k)\) | \(0.8424\) | \(0.9456\) | \(0.9857\) |
\(\mathrm{P}(X \le 5) < 0.95 < \mathrm{P}(X \le 6)\), so \(k = 6\).
On the GDC: Inverse Binomial (the box called Num Successes) with Cumulative Prob \(= 0.95\), Num Trials \(= 12\), Prob Success \(= 0.25\): invBinom(0.95, 12, 0.25) returns \(6\).
More inverse problems
Example 8 \(X \sim \mathrm{B}(6, p)\) and \(\mathrm{P}(X = 2) = 0.2\). Find the possible values of \(p\).
\[ \binom{6}{2}p^2(1 - p)^4 = 0.2 \;\Longrightarrow\; 15p^2(1 - p)^4 = 0.2 . \]
This cannot be solved easily by hand. Graph \(y = 15x^2(1 - x)^4\) and \(y = 0.2\) for \(0 < x < 1\) and find the intersections (or use nSolve). There are two solutions:
\[ p = 0.166 \quad\text{or}\quad p = 0.536 \;(3 \text{ s.f.}) \]
Example 9 \(X \sim \mathrm{B}(25,\, 0.3)\). Find the value of \(k\) such that \(\mathrm{P}(X \le k) = 0.955754\) (to 6 d.p.).
Make a table of binomCdf\((25, 0.3, 0, k)\) for \(k = 9, 10, 11, \ldots\):
| \(k\) | \(9\) | \(10\) | \(11\) | \(12\) |
|---|---|---|---|---|
| \(\mathrm{P}(X \le k)\) | \(0.810564\) | \(0.902200\) | \(0.955754\) | \(0.982530\) |
So \(k = 11\).
Example 10 \(X \sim \mathrm{B}(n,\, 0.25)\). Find the integer \(n\) such that \(\mathrm{P}(X \le 3) = 0.77588\) (5 s.f.).
On a Graphs page, enter $f_1(x) = $ binomCdf\((x, 0.25, 0, 3)\) and look at the table:
| \(n\) | \(8\) | \(9\) | \(10\) | \(11\) |
|---|---|---|---|---|
| \(\mathrm{P}(X \le 3)\) | \(0.88618\) | \(0.83427\) | \(0.77588\) | \(0.71330\) |
So \(n = 10\).
Example 11 A cereal company puts a sticker at random into 20% of its boxes. A child needs four stickers to win a prize. The child’s family buys \(n\) boxes. Find the least value of \(n\) for which the probability of winning the prize is greater than \(\frac{1}{2}\).
Let \(X\) be the number of stickers in \(n\) boxes. \(X \sim \mathrm{B}(n,\, 0.2)\). We need
\[ \mathrm{P}(X \ge 4) > 0.5 \quad\Longleftrightarrow\quad \mathrm{P}(X \le 3) < 0.5 . \]
| \(n\) | \(17\) | \(18\) | \(19\) | \(20\) |
|---|---|---|---|---|
| \(\mathrm{P}(X \ge 4)\) | \(0.4511\) | \(0.4990\) | \(0.5449\) | \(0.5886\) |
\(n = 18\) gives \(0.4990\), just below \(0.5\). The least value is \(n = 19\).
(On the GDC: invBinomN(0.5, 0.2, 3) also returns \(19\).)
Using your GDC
All the binomial commands are in the same menu. On a Calculator page: Menu → Probability → Distributions, then choose one of the commands below. Each one opens a box where you fill in the values and press OK.
| Command | Box on the screen | Fields to fill in | Gives |
|---|---|---|---|
| Binomial Pdf | Binomial Pdf | Num Trials \(n\), Prob Success \(p\), X Value | \(\mathrm{P}(X = x)\); leave X Value empty for the whole list \(x = 0, 1, \ldots, n\) |
| Binomial Cdf | Binomial Cdf | Num Trials \(n\), Prob Success \(p\), Lower Bound, Upper Bound | \(\mathrm{P}(\text{lower} \le X \le \text{upper})\) |
| Inverse Binomial | Num Successes | Cumulative Prob, Num Trials \(n\), Prob Success \(p\) | the least \(x\) with \(\mathrm{P}(X \le x) \ge\) Cumulative Prob |
| Inverse Binomial N | Num Trials | Cumulative Prob, Prob Success \(p\), Successes \(x\) | the least \(n\) with \(\mathrm{P}(X \le x) <\) Cumulative Prob |




On the screen the result appears as a command, for example binomCdf\((n, p, a, b)\) or invBinom\((\text{prob}, n, p)\). You can also type these commands directly.
Tips
- The Lower Bound of Binomial Cdf starts at \(0\), so for \(\mathrm{P}(X \le b)\) you only change the Upper Bound.
- For \(\mathrm{P}(X \ge r)\), use Lower Bound \(= r\) and Upper Bound \(= n\).
- Ticking Matrix Form in the Num Successes / Num Trials boxes shows the cumulative probabilities on both sides of the answer — a useful check.
- When \(n\) is the unknown, you can also put \(x\) in place of \(n\) on a Graphs page (for example $f_1(x) = $ binomCdf\((x, 0.2, 4, x)\)) and press ctrl + T (split-screen table).
- Give final answers to 3 significant figures, but keep more figures in your working.
Common errors
| ✗ Wrong | ✓ Right | Why |
|---|---|---|
| $(X < 4) = $ binomCdf\((n, p, 0, 4)\) | binomCdf\((n, p, 0, 3)\) | \(X < 4\) means \(X \le 3\) for whole numbers. |
| \(\mathrm{P}(X \ge 4) = 1 - \mathrm{P}(X \le 4)\) | \(1 - \mathrm{P}(X \le 3)\) | The complement of \(X \ge 4\) is \(X \le 3\). |
| Using \(\mathrm{B}(n, p)\) for draws without replacement | Check the conditions | Without replacement, \(p\) changes and the trials are not independent. |
| Forgetting \(\binom{n}{r}\) | \(\binom{n}{r}p^r(1 - p)^{n - r}\) | There are \(\binom{n}{r}\) different orders of the successes. |
| \(n > 18.4\), so \(n = 18\) | \(n = 19\) | The least whole number above \(18.4\). |
| Using invBinomN for “exactly \(r\)” | Use a table of binomPdf | invBinomN works only with cumulative probabilities. |
Exercises
1 Decide whether each \(X\) can be modelled by a binomial distribution. If it can, state \(n\) and \(p\).
(a) \(X\) is the number of sixes in 10 throws of a fair dice.
(b) \(X\) is the number of aces when 5 cards are drawn from a pack without replacement.
(c) \(X\) is the number of throws of a dice until the first six.
(d) \(X\) is the number of seeds out of 20 that grow, when each grows with probability \(0.85\), independently.
(a) Yes, \(X \sim \mathrm{B}\left(10, \frac{1}{6}\right)\).
(b) No: without replacement, the trials are not independent and \(p\) changes.
(c) No: the number of trials is not fixed.
(d) Yes, \(X \sim \mathrm{B}(20,\, 0.85)\).
2 \(X \sim \mathrm{B}(6,\, 0.5)\). Find \(\mathrm{P}(X = 2)\) as a fraction.
\(\mathrm{P}(X = 2) = \binom{6}{2}(0.5)^6 = \dfrac{15}{64}\).
3 \(X \sim \mathrm{B}\left(4, \frac{1}{3}\right)\). Find \(\mathrm{P}(X = 3)\) and \(\mathrm{P}(X \ge 3)\).
\(\mathrm{P}(X = 3) = \binom{4}{3}\left(\frac{1}{3}\right)^3\left(\frac{2}{3}\right) = 4 \times \frac{1}{27} \times \frac{2}{3} = \frac{8}{81}\).
\(\mathrm{P}(X \ge 3) = \frac{8}{81} + \left(\frac{1}{3}\right)^4 = \frac{8}{81} + \frac{1}{81} = \frac{9}{81} = \frac{1}{9}\).
4 A basketball player scores a free throw with probability \(0.7\), independently. She takes 8 free throws. Find the probability that she scores
(a) exactly 6 times,
(b) at least 6 times.
\(X \sim \mathrm{B}(8,\, 0.7)\).
(a) binomPdf\((8, 0.7, 6) = 0.296\).
(b) binomCdf\((8, 0.7, 6, 8) = 0.552\).
5 \(X \sim \mathrm{B}(12,\, 0.4)\). Find
(a) \(\mathrm{P}(X \le 4)\),
(b) \(\mathrm{P}(X > 6)\),
(c) \(\mathrm{P}(3 \le X \le 7)\).
(a) binomCdf\((12, 0.4, 0, 4) = 0.438\).
(b) $(X ) = $ binomCdf\((12, 0.4, 7, 12) = 0.158\).
(c) binomCdf\((12, 0.4, 3, 7) = 0.859\).
6 A quiz has 10 true/false questions. A student guesses every answer. Find the probability that the student gets at least 8 correct.
\(X \sim \mathrm{B}(10,\, 0.5)\).
\[ \mathrm{P}(X \ge 8) = \frac{\binom{10}{8} + \binom{10}{9} + \binom{10}{10}}{2^{10}} = \frac{45 + 10 + 1}{1024} = \frac{56}{1024} = \frac{7}{128} . \]
7 A fair dice is thrown \(n\) times. Find the least \(n\) for which the probability of at least one six is greater than \(0.9\).
\(1 - \left(\frac{5}{6}\right)^n > 0.9 \Rightarrow \left(\frac{5}{6}\right)^n < 0.1 \Rightarrow n > \dfrac{\ln 0.1}{\ln \frac{5}{6}} = 12.6\ldots\)
So \(n = 13\).
8 \(X \sim \mathrm{B}(n,\, 0.3)\). Find the least value of \(n\) for which \(\mathrm{P}(X \ge 2) > 0.8\).
Table of $(X ) = $ binomCdf\((n, 0.3, 2, n)\):
| \(n\) | \(7\) | \(8\) | \(9\) |
|---|---|---|---|
| \(\mathrm{P}(X \ge 2)\) | \(0.671\) | \(0.745\) | \(0.804\) |
The least value is \(n = 9\).
9 \(X \sim \mathrm{B}(5, p)\) and \(\mathrm{P}(X = 0) = 0.32768\). Find \(p\).
\(\mathrm{P}(X = 0) = (1 - p)^5 = 0.32768\), so \(1 - p = 0.32768^{1/5} = 0.8\) and \(p = 0.2\).
10 3% of the light bulbs made by a machine are faulty. Bulbs are packed in boxes of 40. A box is rejected if it contains more than 2 faulty bulbs.
(a) Find the probability that a box is rejected.
(b) Six boxes are checked. Find the probability that exactly one of them is rejected.
(a) \(X \sim \mathrm{B}(40,\, 0.03)\). $;(X > 2) = 1 - (X ) = 1 - $ binomCdf\((40, 0.03, 0, 2) = 0.117828\ldots = 0.118\).
(b) Let \(Y\) be the number of rejected boxes out of 6. \(Y \sim \mathrm{B}(6,\, 0.117828\ldots)\).
$(Y = 1) = $ binomPdf\((6, 0.117828\ldots, 1) = 0.378\). (Use the stored, unrounded value of the probability from (a).)