IB Diploma Mathematics AI · Statistics and probability
The binomial distribution
1Discrete random variables
A random variable $X$ takes numerical values by chance. It is discrete if it takes separate values, such as 0, 1, 2, 3.
A probability distribution lists each value with its probability. The probabilities must add up to 1.
The expected value (mean) is the long-run average:
$$E(X) = \sum x \, P(X = x)$$
A simple game
- $X$ takes values 0, 1, 2 with probabilities 0.5, 0.3 and 0.2.
- Check: $0.5 + 0.3 + 0.2 = 1$.
- $E(X) = 0(0.5) + 1(0.3) + 2(0.2) = 0.7$.
A game is fair if the expected gain for the player is 0.
Check yourself
X takes values 1, 2, 3 with probabilities 0.2, 0.5 and k. What is k?
Show the answer
0.3
The probabilities must add to 1.
2When to use the binomial distribution
$X \sim B(n, p)$ counts the number of successes in $n$ trials when:
- There is a fixed number of trials, $n$.
- Each trial has two outcomes: success or failure.
- The probability of success, $p$, is the same for every trial.
- The trials are independent.
Examples: the number of sixes in 20 rolls of a die; the number of faulty items in a sample of 50 when 2% are faulty.
Not binomial: drawing cards without replacement (the probability changes each time), or rolling until you get a six (no fixed number of trials).
Check yourself
Which situation is binomial?
Show the answer
The number of heads in 10 tosses of a fair coin
Fixed trials, two outcomes, constant p, independent.
3Binomial probabilities
For $X \sim B(n, p)$:
- $P(X = r)$: use binomial pdf on the calculator.
- $P(X \le r)$: use binomial cdf.
- $P(X \ge r) = 1 - P(X \le r - 1)$.
The formula behind the calculator is $P(X = r) = \binom{n}{r}p^r(1 - p)^{n - r}$.
The distribution of B(12, 0.3): bars for P(X = 4) and P(X ≤ 2)
Seeds that grow
- Each seed has a 30% chance of growing. 12 seeds are planted. $X \sim B(12, 0.3)$.
- Exactly 4 grow: $P(X = 4) = 0.231$.
- At most 2 grow: $P(X \le 2) = 0.253$.
- At least 1 grows: $P(X \ge 1) = 1 - P(X = 0) = 1 - 0.7^{12} = 0.986$.
Read the words carefully: "at most 2" means 0, 1 or 2; "more than 2" means 3 or more; "at least 3" means 3 or more.
Check yourself
X ~ B(10, 0.4). Which expression gives P(X > 6)?
Show the answer
1 − P(X ≤ 6)
"More than 6" is 7, 8, 9 or 10.
4Mean and variance of a binomial
For $X \sim B(n, p)$:
$$E(X) = np, \qquad \text{Var}(X) = np(1 - p)$$
The standard deviation is $\sqrt{np(1 - p)}$.
Expected number of seeds
- $X \sim B(12, 0.3)$.
- $E(X) = 12 \times 0.3 = 3.6$ seeds expected to grow.
- $\text{Var}(X) = 12 \times 0.3 \times 0.7 = 2.52$, so the standard deviation is $1.59$.
The expected value does not have to be a whole number: it is a long-run average.
Check yourself
A multiple-choice test has 20 questions with 4 options each. A student guesses every answer. What is the expected number correct?
Show the answer
5
E(X) = 20 × 0.25 = 5.
5Using a GDC for binomial probabilities
- Binomial pdf: $P(X = k)$, a single value.
- Binomial cdf: $P(X \le k)$, cumulative.
Translating inequalities:
- $P(X < 4) = P(X \le 3)$.
- $P(X \ge 4) = 1 - P(X \le 3)$.
- $P(X > 4) = 1 - P(X \le 4)$.
$X \sim B(12, 0.25)$
- $P(X = 3) \approx 0.258$.
- $P(X \le 3) \approx 0.649$.
- $P(X \ge 4) = 1 - 0.649 = 0.351$.
Check yourself
How do you calculate $P(X > 5)$ with a cumulative function?
Show the answer
$1 - P(X \le 5)$
Greater than 5 excludes 5.
6Binomial in context
Quality control
- 5% of light bulbs are faulty. A box contains 20 bulbs.
- $X \sim B(20, 0.05)$.
- Expected faulty bulbs: $20 \times 0.05 = 1$.
- $P(\text{no faulty bulbs}) = 0.95^{20} \approx 0.358$.
- $P(\text{more than 2 faulty}) = 1 - P(X \le 2) \approx 1 - 0.925 = 0.075$.
Check yourself
If 5% of 20 bulbs are expected to be faulty, how many is that?
Show the answer
1
$np$.
7Going deeper: a guessing problem worked in full, and getting the inequality right
a test has 12 multiple-choice questions, each with 4 options. A student guesses every answer. Let $X$ be the number correct.
- Model: $X \sim B(12, 0.25)$. The trials are independent, each has two outcomes, $n$ is fixed and $p$ is constant.
- Expected score: $np = 12 \times 0.25 = 3$.
- Variance: $np(1 - p) = 3 \times 0.75 = 2.25$. Standard deviation: 1.5.
- Exactly 3 correct: $P(X = 3) \approx 0.258$ (binomial pdf on the GDC).
- At most 5: $P(X \le 5) \approx 0.946$ (binomial cdf).
- At least 6: $P(X \ge 6) = 1 - P(X \le 5) \approx 0.054$.
- In context: about 5% of pure guessers would score 6 or more. In a class of 30 guessers, expect about $30 \times 0.054 \approx 1.6$ students to do so.
Translating words into GDC entries
- "Exactly 4": pdf at 4.
- "At most 4" or "no more than 4": cdf from 0 to 4.
- "Fewer than 4": cdf from 0 to 3.
- "At least 4": cdf from 4 to $n$, or $1 - P(X \le 3)$.
- "More than 4": cdf from 5 to $n$.
- "Between 2 and 6 inclusive": cdf from 2 to 6.
Is the binomial suitable?
- Suitable: the number of defective items in a sample of 20 from a large production run with a 3% defect rate.
- Not suitable: the number of red cards when 5 are dealt from a pack (no replacement, so $p$ changes).
- Not suitable: the number of goals in a match (no fixed number of trials).
- Questionable: the number of students absent in a class during a flu outbreak (not independent).
Worked example (a two-stage question): bolts are packed in boxes of 20, and 5% of bolts are faulty.
- Number faulty in a box: $X \sim B(20, 0.05)$.
- $P(X = 0) = 0.95^{20} \approx 0.358$.
- A box is rejected if it has 2 or more faulty bolts: $P(X \ge 2) = 1 - P(X \le 1) \approx 1 - 0.736 = 0.264$.
- Of 50 boxes, the number rejected is $Y \sim B(50, 0.264)$, with expected value about 13.2.
Common mistakes
- Off-by-one errors with "at least" and "more than".
- Entering $p$ as a percentage (25 in place of 0.25).
- Giving an expected value rounded to a whole number.
- Not stating the distribution and its parameters before calculating.
Check yourself
A fair coin is tossed 8 times. What is the standard deviation of the number of heads, to three significant figures?
Show the answer
1.41
The variance is 8 × 0.5 × 0.5 = 2, and √2 ≈ 1.41.
Now test yourself
This lesson has a 8-question quiz and 5 exam-style questions with mark schemes in Impera. Free, with your progress saved.
Practise in Impera