Sub topic 11
Repeated Independent Trials
This chapter covers the binomial formula for "exactly k successes in n attempts" problems. It assumes you can already do the following:
- Compute combinations such as C(n, k).
- Multiply probabilities of independent events.
- Use the complement rule for "at least one" problems.
What counts as a repeated independent trial
Many CAT questions repeat the same experiment several times and ask how often something happens. Examples include "exactly 2 sixes in 4 rolls", "at least 3 heads in 5 tosses" and "a student guesses 4 of 6 questions correctly".
A trial is one run of the experiment. A success is the outcome you are counting, and every other outcome is a failure. The binomial model applies only when all four conditions hold:
- The number of trials, n, is fixed in advance.
- Each trial has two outcomes: success or failure.
- The probability of success, p, is the same on every trial.
- The trials are independent, so one result does not change the probability of the next.
If any condition fails, the binomial formula gives a wrong answer. The traps section below covers the most common failure.
Deriving the formula
Take 4 rolls of a fair die. Let success mean rolling a six, so p = 1/6 and q = 1 − p = 5/6. You want exactly 2 sixes.
One specific sequence with two sixes is S S F F (six, six, not-six, not-six). Because the trials are independent, you multiply the probabilities:
(1/6) × (1/6) × (5/6) × (5/6) = (1/6)² (5/6)²
Every other arrangement, such as S F S F or F S S F, has the same two sixes and two non-sixes. Each one therefore has the same probability. The number of arrangements is the number of ways to choose which 2 of the 4 trials are the sixes, which is C(4, 2) = 6.
The sequences are mutually exclusive, so you add their probabilities. This gives the binomial formula:
P(exactly k successes in n trials) = C(n, k) · p^k · q^(n−k)
Here C(n, k) counts the arrangements, p^k covers the successes, and q^(n−k) covers the failures. The two exponents always add up to n. That is a useful quick check.
from math import comb
from fractions import Fraction
# Exactly 2 sixes in 4 rolls of a fair die.
print(Fraction(comb(4, 2) * 5**2, 6**4)) # 25/216The result is 6 × 25 / 1296 = 150/1296 = 25/216.
The whole distribution at once
Computing every value of k shows how the probability spreads out. The function below uses exact fractions.
from math import comb
from fractions import Fraction
def binom(n, k, p):
return comb(n, k) * p**k * (1 - p) ** (n - k)
p = Fraction(1, 6)
total = Fraction(0)
for k in range(5):
pk = binom(4, k, p)
total += pk
print(k, pk)
print("sum", total)The output is:
0 625/1296
1 125/324
2 25/216
3 5/324
4 1/1296
sum 1The probabilities sum to 1 because the cases k = 0 to 4 cover every possible outcome. This is a good self-check in the exam. If your pieces do not add up to 1, one of them is wrong.
Two summary facts help with estimation:
- Mean: the expected number of successes is n·p. Here it is 4 × 1/6 = 2/3.
- Most likely count: this is usually near n·p. The table confirms that k = 0 is the most likely value here.
Choosing between exactly, at least, and at most
The wording of the question decides which terms you add.
| Wording | Meaning | Method |
|---|---|---|
| Exactly k | One term | C(n, k) p^k q^(n−k) |
| At least one | k ≥ 1 | 1 − q^n |
| At least k | k, k+1, …, n | Add the upper terms, or use 1 − (terms below k) |
| At most k | 0, 1, …, k | Add the lower terms |
| More than k | k+1, …, n | Same as "at least k+1" |
| Fewer than k | 0, …, k−1 | Same as "at most k−1" |
Always add the shorter side. For "at least 3 heads in 5 tosses" you would add three terms, k = 3, 4 and 5. For "at least 1 head in 5 tosses" you would add five terms, so use the complement.
Worked example: at least 3 heads in 5 fair tosses
Here p = q = 1/2, so every sequence has probability (1/2)⁵ = 1/32. Only the arrangement counts matter:
- k = 3: C(5, 3) = 10
- k = 4: C(5, 4) = 5
- k = 5: C(5, 5) = 1
The probability is (10 + 5 + 1)/32 = 16/32 = 1/2. Symmetry gives a faster route for fair coins with odd n. "At least 3 heads" and "at least 3 tails" are complementary and equally likely, so each has probability 1/2.
Worked example: at least one six in 4 rolls
The complement of "at least one six" is "no sixes". By the formula with k = 0, this is (5/6)⁴ = 625/1296. So:
P(at least one six) = 1 − 625/1296 = 671/1296
The complement rule from the earlier chapter is the k = 0 case of the binomial formula.
When p is not a nice fraction
The formula works for any p between 0 and 1. Suppose a machine produces a defective item with probability 0.3, independently each time. What is the probability that exactly 2 of 5 items are defective?
C(5, 2) × 0.3² × 0.7³ = 10 × 0.09 × 0.343 = 0.3087
The probability that at least one is defective is 1 − 0.7⁵ = 1 − 0.16807 = 0.83193.
When you need a threshold, such as "how many trials are needed so the chance of at least one head is at least 99%?", set up the complement inequality:
1 − (1/2)^n ≥ 0.99, so (1/2)^n ≤ 0.01, so 2^n ≥ 100
Since 2⁶ = 64 and 2⁷ = 128, the smallest n is 7.
First success on a given trial
A related question asks for the probability that the first success happens on trial k. This is not a binomial count, because n is not fixed. The first k − 1 trials must all fail, and trial k must succeed:
P(first success on trial k) = q^(k−1) · p
For the first six on the 3rd roll, this gives (5/6)² × (1/6) = 25/216. Notice that this number equals the earlier "exactly 2 sixes in 4 rolls" answer. The two are equal here by coincidence, and they describe different events. In the first-success case the arrangement is fixed, so no C(n, k) factor appears.
Choosing the right model
Common traps
Treating draws without replacement as binomial
Draws from a small bag without replacement change the composition of the bag after each draw, so p changes. The trials are not independent. A bag has 5 red and 3 blue balls, and you draw 3 balls and want exactly 2 red.
With replacement, the trials are independent and p = 5/8:
C(3, 2) × (5/8)² × (3/8) = 3 × 25 × 3 / 512 = 225/512
Without replacement, use counting instead:
C(5, 2) × C(3, 1) / C(8, 3) = 30/56 = 15/28
These two answers differ (225/512 is about 0.44, and 15/28 is about 0.54). Check the wording for "with replacement", "put back", or "one at a time and returned". If the population is very large compared with the sample, the binomial is a good approximation. CAT problems rarely rely on that approximation.
Forgetting the arrangement factor
Computing (1/6)² (5/6)² gives the probability of one particular sequence, not of "exactly 2 sixes". Always ask whether the question cares about order. If it asks only how many successes occur, multiply by C(n, k).
Mixing up n and k
n is the number of trials and k is the number of successes. In "exactly 2 sixes in 4 rolls", n = 4 and k = 2. A sanity check is that the exponents of p and q must add up to n.
Using the binomial when p varies
If the probability changes between trials, the model fails. Examples include a player who improves with each attempt and a batch where each tested item is not replaced. In these cases, multiply the probability of each specific sequence term by term, then add the sequences.
A quick method under time pressure
- Identify a success and write p and q.
- Check the four binomial conditions. If a condition fails, switch method.
- Read the quantifier: exactly, at least, or at most.
- If the question says "at least one", compute 1 − q^n and stop.
- Otherwise, list only the terms you need, and use the shorter side.
- Sanity check. For fair coins the terms are C(n, k)/2^n, so they must sum to 1.
Exercise
A fair coin is tossed 6 times. Find the probability of exactly 4 heads, and the probability of at least one tail.
Show answer
Exactly 4 heads: C(6, 4) × (1/2)⁶ = 15/64. At least one tail: 1 − P(no tails) = 1 − (1/2)⁶ = 63/64.
Exercise
A multiple-choice test has 5 questions, each with 4 options and one correct answer. A student guesses every answer at random. What is the probability of getting exactly 2 correct? What is the probability of getting at least 4 correct?
Show answer
Here n = 5, p = 1/4, q = 3/4. Exactly 2: C(5, 2) × (1/4)² × (3/4)³ = 10 × 27 / 1024 = 270/1024 = 135/512. At least 4: P(4) + P(5) = C(5, 4) × (1/4)⁴ × (3/4) + (1/4)⁵ = 15/1024 + 1/1024 = 16/1024 = 1/64.
Exercise
A bag holds 4 red and 6 blue balls. Three balls are drawn one at a time. Find the probability of exactly 1 red ball when (a) each ball is replaced before the next draw, and (b) the balls are not replaced. Which part uses the binomial formula?
Show answer
(a) With replacement, p = 4/10 = 2/5, so the probability is C(3, 1) × (2/5) × (3/5)² = 3 × 2 × 9 / 125 = 54/125. This part uses the binomial formula. (b) Without replacement, use counting: C(4, 1) × C(6, 2) / C(10, 3) = 4 × 15 / 120 = 1/2.
Exercise
How many times must a fair die be rolled so that the probability of getting at least one six is greater than 1/2?
Show answer
You need 1 − (5/6)^n > 1/2, so (5/6)^n < 1/2. Since (5/6)³ = 125/216, which is about 0.579, and (5/6)⁴ = 625/1296, which is about 0.482, the smallest n is 4.