The binomial probability formula
Eight independent tries, each a success with the same chance. What is the chance of exactly two successes, or of at most one, or at least three, without listing all 256 ways the tries can come out?
Where you are 4 in The binomial distribution
When you reach for it
A bakery puts a slip of paper in every fortune cookie, and each slip is “lucky” with probability 0.2, independently of every other cookie (a made-up setting). Kavitha buys a box of 8. Let X be the number of lucky slips in her box. The count can be any of 0, 1, 2, \dots, 8, and the question is how likely each value is.
The box of cookies is a binomial setting: a fixed number of trials (n = 8 cookies), two outcomes on each (lucky or not), trials that are independent, and the same chance of success on every trial (p = 0.2). Checking those four conditions is the work of The binomial setting, and it comes first. Once they hold, X has a The binomial distribution with n = 8 and p = 0.2, and one formula gives the probability of any count. This lesson builds that formula and then uses it, together with the complement and technology, for questions about a range of counts.
You reach for it whenever a question asks how many successes occur in a fixed number of independent, identical tries: “exactly k”, “at most k”, “at least k”, “between a and b”.
The procedure
The lesson runs over two days. Day 1 builds the formula for exactly k successes. Day 2 adds questions about several counts at once.
Day 1: exactly k successes
Take the lead question: what is P(X = 2), the chance that exactly 2 of the 8 slips are lucky?
One arrangement. Write L for a lucky slip and N for a plain one, and record the cookies in the order Kavitha opens them. One way to get exactly two lucky slips is LLNNNNNN. Because the cookies are independent, the multiplication rule for independent events gives its probability as a product of eight factors, 0.2 for each L and 1 - 0.2 = 0.8 for each N:
Every arrangement has the same probability. Another way is NLNNNLNN. Its product holds the same eight factors in a different order, two of 0.2 and six of 0.8, and by the commutative property of multiplication the product does not depend on the order. So every arrangement with exactly two L’s has probability (0.2)^2(0.8)^6.
Counting the arrangements. An arrangement is fixed once you say which 2 of the 8 positions hold the L’s. The number of ways to choose 2 positions out of 8, order not mattering, is the combination \binom{8}{2} = \dfrac{8 \cdot 7}{2 \cdot 1} = 28 (Combinations); the same number sits in row 8 of Pascal’s triangle.
Adding. Two different arrangements cannot both happen, so the 28 arrangements are disjoint events and their probabilities add. Adding 28 equal terms is multiplying by 28:
About 29\% of boxes of 8 would hold exactly two lucky slips.
Nothing in the argument used the numbers 8, 2 or 0.2 in a special way. With n trials, success probability p on each, and k successes wanted, one arrangement has k factors of p and n - k factors of 1 - p, and there are \binom{n}{k} arrangements:
for each count k = 0, 1, 2, \dots, n.
Each piece has a job. The combination counts the arrangements, p^k is the chance of the successes in one arrangement, and (1 - p)^{n - k} the chance of the failures. The two exponents always add to n, one factor per trial.
The numbers \binom{n}{k} are the same ones that expand a power of a sum in the binomial theorem, which is where the distribution gets its name. That theorem also shows the probabilities add to 1, as every distribution’s must:
The whole distribution for the box of 8, rounded to four places:
| k | P(X = k) | k | P(X = k) |
|---|---|---|---|
| 0 | 0.1678 | 5 | 0.0092 |
| 1 | 0.3355 | 6 | 0.0011 |
| 2 | 0.2936 | 7 | 0.0001 |
| 3 | 0.1468 | 8 | 0.0000 |
| 4 | 0.0459 |
Day 2: at most, at least, between
A question about a range of counts is a union of “exactly” events, which are disjoint, so its probability is a sum of formula values. Running totals of that sum are the cumulative probabilities P(X \le k) of Cumulative probability. The words translate to inequalities on whole-number counts:
| Words | Inequality |
|---|---|
| at most k | X \le k |
| fewer than k | X \le k - 1 |
| at least k | X \ge k |
| more than k | X \ge k + 1 |
| between a and b, inclusive | a \le X \le b |
Because X takes only whole-number values, “fewer than 3” and “at most 2” are the same event.
For the box of 8, “at most one lucky slip” is two terms:
“At least three” is six terms, k = 3 through 8. The complement is shorter: the counts that are not at least 3 are 0, 1 and 2, so
The second figure shows the split. The complement pays off whenever the side you want has more bars than the side you do not. The extreme case is “at least one”, whose complement is the single count 0: P(X \ge 1) = 1 - (1 - p)^n, the rule of At least one problems.
Technology. For a larger n the sums run to dozens of terms, and a calculator or spreadsheet does the adding. The common commands take n, p and a count:
- P(X = k): `binompdf(n, p, k)` on a graphing calculator, or `=BINOM.DIST(k, n, p, FALSE)` in a spreadsheet.
- P(X \le k): `binomcdf(n, p, k)` on a graphing calculator, or `=BINOM.DIST(k, n, p, TRUE)` in a spreadsheet.
Both cumulative commands give “at most” only. Every other range is rewritten in terms of it: P(X \ge k) = 1 - P(X \le k - 1), and P(a \le X \le b) = P(X \le b) - P(X \le a - 1). A solution names the distribution and its parameters and writes the probability statement before the command, so a reader can see what was computed.
Worked examples
Examples 1 to 4 belong to Day 1 (exactly k successes); Examples 5 to 7 to Day 2 (ranges of counts, the complement and technology). Every setting is made up: each cookie is lucky with probability 0.2, independently.
None, and all
For Kavitha’s box of 8, find the probability that no slip is lucky and the probability that every slip is lucky.
SolutionX is binomial with n = 8 and p = 0.2. For k = 0 there is exactly one arrangement, all plain, and \binom{8}{0} = 1 agrees. Any number to the power 0 is 1, so the factor (0.2)^0 drops out:
For k = 8 there is again one arrangement, all lucky:
About one box in six has no lucky slip at all, while a box of eight lucky slips is about 3 boxes in a million. The formula covers the two end counts without a special case.
A bag of twelve
Senthil buys a bag of 12 cookies. Find the probability that exactly 3 of them hold lucky slips.
SolutionThe bag is a binomial setting with n = 12 and p = 0.2, and k = 3. The arrangements are the choices of which 3 of the 12 cookies are lucky:
Each arrangement has 3 lucky and 12 - 3 = 9 plain cookies:
About 24\% of bags of 12 hold exactly three lucky slips. Check the exponents: 3 + 9 = 12, one factor per cookie.
Counting the plain slips
Arivu counts the plain slips instead. Let Y be the number of plain slips in a box of 8. Find P(Y = 6). Then Kavitha and Senthil each buy a box of 8; find the probability that both boxes hold exactly 2 lucky slips.
Solution“Success” may be either outcome, as long as p is its probability. A plain slip has probability 0.8, so Y is binomial with n = 8 and p = 0.8:
This is P(X = 2) again, and it has to be: six plain slips in a box of 8 is the same event as two lucky ones. The counts agree because choosing the 6 plain positions is the same as choosing the 2 lucky ones, so \binom{8}{6} = \binom{8}{2}.
The two boxes are separate sets of cookies, independent of each other, so the multiplication rule applies to whole boxes:
When the second lucky slip arrives
Arivu opens cookies one at a time from a box of 8. Find the probability that his second lucky slip comes from the fifth cookie he opens.
SolutionThis is not “exactly 2 lucky among the first 5”, because that event also includes LLNNN, where the second lucky slip comes from the second cookie. The event is two things at once: exactly 1 lucky slip among the first 4 cookies, and a lucky slip in cookie 5. The first is a binomial count with n = 4, p = 0.2 and k = 1:
Cookie 5 is independent of the first four, so multiply by its chance of being lucky:
The last three cookies do not matter, since the second lucky slip has already arrived. As a check, the probability of exactly 2 lucky slips in the first 5 is \binom{5}{2}(0.2)^2(0.8)^3, which is 0.2048. Its \binom{5}{2} = 10 arrangements are equally likely, and \binom{4}{1} = 4 of them end in L, so the answer should be \tfrac{4}{10} of 0.2048, which is 0.08192.
At most one, at least three
For Kavitha’s box of 8, find P(X \le 1) and P(X \ge 3), and interpret each.
Solution“At most one” means 0 or 1 lucky slips. Those are disjoint, so
About half of all boxes hold one lucky slip or none.
“At least three” is the six counts 3 through 8. Its complement is the three counts 0, 1, 2, which are already in the table:
About one box in five holds three or more lucky slips. As a check, adding the six terms directly gives 0.1468 + 0.0459 + 0.0092 plus 0.0011 + 0.0001 + 0.0000, which is 0.2031.
At least one, and a middle range
For Senthil’s bag of 12, find the probability of at least one lucky slip and the probability of between 2 and 4 lucky slips, inclusive.
SolutionHere n = 12 and p = 0.2. “At least one” has the one-count complement “none”:
“Between 2 and 4, inclusive” is 2 \le X \le 4, three terms. With \binom{12}{2} = 66 and \binom{12}{4} = 495, and P(X = 3) from Example 2:
About 93\% of bags have at least one lucky slip, and about 65\% have two, three or four. Both ends are included because the question says “inclusive”; “strictly between 2 and 4” would be the single count 3.
A party tray, with technology
The bakery packs a party tray of 50 cookies. Find the probability that the tray has at most 8 lucky slips, at least 15, and between 8 and 12 inclusive.
SolutionThe tray is a binomial setting with n = 50 and p = 0.2 (the same four conditions as a box). By hand, “at most 8” would take nine formula values, so technology does the adding.
At most 8:
from `binomcdf(50, 0.2, 8)` on a calculator or `=BINOM.DIST(8, 50, 0.2, TRUE)` in a spreadsheet.
At least 15: the cumulative commands give only “at most”, so take the complement. The counts below 15 end at 14:
from `1 - binomcdf(50, 0.2, 14)` or `=1-BINOM.DIST(14, 50, 0.2, TRUE)`.
Between 8 and 12 inclusive: take everything up to 12 and remove everything up to 7, which leaves 8 through 12:
from `binomcdf(50, 0.2, 12) - binomcdf(50, 0.2, 7)`. Subtracting P(X \le 8) instead would drop the count 8 itself, which the question includes.
About 31\% of trays hold at most 8 lucky slips, about 6\% hold 15 or more, and about 62\% hold 8 to 12. A single value comes from the other command: `binompdf(50, 0.2, 10)` gives P(X = 10) = 0.1398.
Boundaries
- The four conditions are the hypothesis. The formula is true only for a count in a binomial setting: fixed n, two outcomes, independent trials, the same p on each (The binomial setting). If the trials are dependent, as when cookies are taken from a small batch with a known number of lucky slips, the arrangements no longer all have probability p^k(1 - p)^{n - k} and the formula gives a wrong number (Exercise 24 works one such case).
- The count runs from 0 to n. k must be a whole number with 0 \le k \le n. For any other value, P(X = k) = 0: there is no way to get 2.5 or 9 lucky slips in a box of 8.
- The interpretation needs the convention p^0 = 1. For k = 0 or k = n one factor has exponent 0 and equals 1, which is what makes the formula match the single all-failure or all-success arrangement. If p = 0 or p = 1, the count is certain and 0^0 is read as 1.
- Strict and non-strict inequalities differ. The count is discrete, so P(X < 3) and P(X \le 3) differ by P(X = 3), which is not zero. Every range must be translated with its endpoints in or out on purpose before the formula or a command is used.
- Cumulative commands are “at most”. `binomcdf` and `BINOM.DIST` with `TRUE` return P(X \le k) only; “at least” and “between” have to be rewritten before they are entered.
Where this goes next
With the probability of each count in hand, the next questions are about the distribution as a whole. The mean and standard deviation of a binomial give the center and typical spread of the count in one line each, without adding up the table. The shape of a binomial and the normal approximation shows when a large-n binomial is close enough to a normal curve to answer range questions another way. The same reasoning, one arrangement times the number of arrangements, also counts the trials until a first success, which is the geometric distribution, and Example 4 already used a piece of it. More broadly, the formula is the cleanest case of Compound events: many independent trials combined into one event about their total.
Exercises
Exercises 1 to 11 go with Day 1 (Examples 1 to 4), Exercises 12 to 20 with Day 2 (Examples 5 to 7), and the reasoning group draws on both. Unless an exercise says otherwise, each cookie holds a lucky slip with probability 0.2, independently, and answers are rounded to four places. The bakery’s holiday batch, where it appears, has lucky probability 0.3.
Day 1: exactly k
- A box holds 5 cookies. Find the probability of exactly 2 lucky slips.
- For the box of 5, find the probability that no slip is lucky and the probability that all 5 are lucky.
- A bag holds 10 cookies. Find the probability of exactly 3 lucky slips.
- For the bag of 10, find the probability of exactly 1 lucky slip.
- Write the expression for the probability of exactly 4 lucky slips among 15 cookies, then evaluate it.
- A box of 6 comes from the holiday batch. Find the probability of exactly 2 lucky slips.
- For the holiday box of 6, find the probability that exactly 5 slips are plain.
Day 1: reading and building the formula
- Kavitha computes \binom{9}{4}(0.2)^4(0.8)^5. Describe in words the event she found the probability of, then evaluate it.
- Arivu writes \binom{6}{2}(0.2)^2(0.8)^2 for the probability of exactly 2 lucky slips in a box of 6. Find his error and give the correct probability.
- For a box of 7, find the probability that the first two cookies opened are lucky and the other five are plain. Then find the probability of exactly 2 lucky slips in the box, and explain why the two answers differ.
- Senthil opens cookies one at a time. Find the probability that his third lucky slip comes from the sixth cookie he opens.
Day 2: at most, at least, between
- For a box of 5, find the probability of at most 1 lucky slip.
- For a box of 5, find the probability of at least 2 lucky slips.
- For a bag of 10, find the probability of at least one lucky slip.
- For a bag of 10, find the probability of fewer than 3 lucky slips.
- For a bag of 10, find the probability of more than 2 lucky slips.
- For a holiday box of 6, find the probability of between 2 and 3 lucky slips, inclusive.
Day 2: technology
- A crate holds 40 cookies. For each event, write the probability statement and a calculator command, then give the probability: (a) at most 5 lucky slips; (b) at least 10; (c) exactly 8; (d) between 6 and 10, inclusive.
- A carton holds 30 cookies. Write spreadsheet formulas for, and give, the probability of at most 4 lucky slips and the probability of more than 9.
- The bakery bakes a batch of 100 cookies. Find the probability of at least 25 lucky slips and the probability of between 15 and 25, inclusive.
Reasoning
- Explain why every arrangement of k lucky and n - k plain slips has the same probability, and name the two facts the explanation uses.
- Arivu writes P(X \ge 3) = 1 - P(X \le 3). Explain what is wrong and what the correct complement is.
- Explain why the probabilities P(X = 0), P(X = 1), \dots, P(X = n) of a binomial count always add to 1.
- A tray holds exactly 10 cookies, exactly 2 of them lucky, and Kavitha takes 4 at random. Explain why the binomial formula with n = 4 and p = 0.2 does not give the probability that she gets exactly 1 lucky slip, and find the correct probability by counting.
Answers
- 0.2048. \binom{5}{2}(0.2)^2(0.8)^3 = 10\,(0.04)(0.512) = 0.2048.
- 0.3277 and 0.00032. P(X = 0) = (0.8)^5 = 0.32768; P(X = 5) = (0.2)^5 = 0.00032.
- 0.2013. \binom{10}{3}(0.2)^3(0.8)^7 with \binom{10}{3} = 120 is 120\,(0.008)(0.2097152) \approx 0.2013.
- 0.2684. \binom{10}{1}(0.2)(0.8)^9 is 10\,(0.2)(0.134217728) \approx 0.2684.
- \binom{15}{4}(0.2)^4(0.8)^{11} \approx 0.1876. \binom{15}{4} = 1365, and 1365\,(0.0016)(0.0858993) \approx 0.1876.
- 0.3241. \binom{6}{2}(0.3)^2(0.7)^4 = 15\,(0.09)(0.2401) = 0.324135.
- 0.3025. Five plain is one lucky: \binom{6}{1}(0.3)(0.7)^5 = 6\,(0.3)(0.16807) = 0.302526.
- Exactly 4 lucky slips in a box of 9, which is 0.0661. 126\,(0.0016)(0.32768) \approx 0.0661.
- The plain slips need exponent 6 - 2 = 4, not 2; the exponents must add to n. Correct: \binom{6}{2}(0.2)^2(0.8)^4 = 15\,(0.04)(0.4096) \approx 0.2458.
- 0.0131 and 0.2753. One arrangement: (0.2)^2(0.8)^5 = 0.0131072. Exactly 2 in the box counts all \binom{7}{2} = 21 arrangements: 21 \times 0.0131072 \approx 0.2753. The first answer is one of the 21 disjoint arrangements the second adds up.
- 0.0410. Exactly 2 lucky in the first 5, then a lucky sixth: \binom{5}{2}(0.2)^2(0.8)^3 = 0.2048, then 0.2048 \times 0.2 \approx 0.0410.
- 0.7373. (0.8)^5 + 5\,(0.2)(0.8)^4 is 0.32768 + 0.4096 = 0.73728.
- 0.2627. The complement of at most 1: 1 - 0.73728 = 0.26272.
- 0.8926. 1 - (0.8)^{10} = 1 - 0.1073742 \approx 0.8926.
- 0.6778. X \le 2: 0.1073742 + 0.2684355 + 0.3019899 \approx 0.6778, the last term \binom{10}{2}(0.2)^2(0.8)^8.
- 0.3222. X \ge 3 is the complement of X \le 2: 1 - 0.6778 = 0.3222.
- 0.5094. P(X = 2) = 0.324135 (Exercise 6) and P(X = 3) = 20\,(0.027)(0.343) = 0.18522, so the total is 0.324135 + 0.18522 = 0.509355.
- X is binomial with n = 40, p = 0.2. (a) P(X \le 5), `binomcdf(40, 0.2, 5)`, 0.1613. (b) P(X \ge 10) = 1 - P(X \le 9), `1 - binomcdf(40, 0.2, 9)`, 1 - 0.7318 = 0.2682. (c) P(X = 8), `binompdf(40, 0.2, 8)`, 0.1560. (d) P(6 \le X \le 10) = P(X \le 10) - P(X \le 5), `binomcdf(40, 0.2, 10) - binomcdf(40, 0.2, 5)`, 0.8392 - 0.1613 = 0.6779.
- `=BINOM.DIST(4, 30, 0.2, TRUE)` gives P(X \le 4) = 0.2552. More than 9 is X \ge 10, so `=1-BINOM.DIST(9, 30, 0.2, TRUE)` gives 1 - 0.9389 = 0.0611.
- 0.1314 and 0.8321. P(X \ge 25) = 1 - P(X \le 24), from `1 - binomcdf(100, 0.2, 24)`; P(15 \le X \le 25) = P(X \le 25) - P(X \le 14), from `binomcdf(100, 0.2, 25) - binomcdf(100, 0.2, 14)`.
- By independence (the multiplication rule), an arrangement’s probability is the product of one factor per trial: p for each success and 1 - p for each failure. Every arrangement has k factors of p and n - k of 1 - p, only in a different order, and by the commutative property the order does not change the product, so each equals p^k(1 - p)^{n - k}.
- The complement of X \ge 3 is every count not 3 or more, which is 0, 1, 2, so P(X \ge 3) = 1 - P(X \le 2). Arivu’s version puts the count 3 in both events and subtracts it, so it leaves out P(X = 3).
- By the binomial theorem, the sum of \binom{n}{k}p^k(1 - p)^{n - k} over k = 0, \dots, n is (p + (1 - p))^n, which is 1^n = 1. In words, the events X = 0, \dots, X = n are disjoint and one of them must happen, so their probabilities total 1.
- 0.5333. The trials are not independent: once one lucky cookie is taken, only one lucky cookie is left among 9, so the chance changes from cookie to cookie and the binomial value 4\,(0.2)(0.8)^3 = 0.4096 is wrong. Counting equally likely selections, \dfrac{\binom{2}{1}\binom{8}{3}}{\binom{10}{4}}, which is \dfrac{2 \cdot 56}{210} \approx 0.5333.