impera Open Impera

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)$$

Worked example

A simple game

  1. $X$ takes values 0, 1, 2 with probabilities 0.5, 0.3 and 0.2.
  2. Check: $0.5 + 0.3 + 0.2 = 1$.
  3. $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?

  • 1

  • 0.5

  • 0.7

  • 0.3

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:

  1. There is a fixed number of trials, $n$.
  2. Each trial has two outcomes: success or failure.
  3. The probability of success, $p$, is the same for every trial.
  4. 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?

  • Drawing 5 cards from a pack without replacement

  • The number of heads in 10 tosses of a fair coin

  • The heights of 10 students

  • The number of tosses until the first head

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)

Worked example

Seeds that grow

  1. Each seed has a 30% chance of growing. 12 seeds are planted. $X \sim B(12, 0.3)$.
  2. Exactly 4 grow: $P(X = 4) = 0.231$.
  3. At most 2 grow: $P(X \le 2) = 0.253$.
  4. 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)?

  • 1 − P(X ≤ 6)

  • P(X ≤ 6)

  • 1 − P(X ≤ 5)

  • 1 − 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)}$.

Worked example

Expected number of seeds

  1. $X \sim B(12, 0.3)$.
  2. $E(X) = 12 \times 0.3 = 3.6$ seeds expected to grow.
  3. $\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?

  • 5

  • 2.5

  • 10

  • 4

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)$.
Worked example

$X \sim B(12, 0.25)$

  1. $P(X = 3) \approx 0.258$.
  2. $P(X \le 3) \approx 0.649$.
  3. $P(X \ge 4) = 1 - 0.649 = 0.351$.
Check yourself

How do you calculate $P(X > 5)$ with a cumulative function?

  • $1 - P(X \le 4)$

  • $P(X = 5)$

  • $1 - P(X \le 5)$

  • $P(X \le 5)$

Show the answer

$1 - P(X \le 5)$

Greater than 5 excludes 5.

6Binomial in context

Worked example

Quality control

  1. 5% of light bulbs are faulty. A box contains 20 bulbs.
  2. $X \sim B(20, 0.05)$.
  3. Expected faulty bulbs: $20 \times 0.05 = 1$.
  4. $P(\text{no faulty bulbs}) = 0.95^{20} \approx 0.358$.
  5. $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?

  • 0.05

  • 20

  • 5

  • 1

Show the answer

1

$np$.

7Going deeper: a guessing problem worked in full, and getting the inequality right

Worked example

a test has 12 multiple-choice questions, each with 4 options. A student guesses every answer. Let $X$ be the number correct.

  1. Model: $X \sim B(12, 0.25)$. The trials are independent, each has two outcomes, $n$ is fixed and $p$ is constant.
  2. Expected score: $np = 12 \times 0.25 = 3$.
  3. Variance: $np(1 - p) = 3 \times 0.75 = 2.25$. Standard deviation: 1.5.
  4. Exactly 3 correct: $P(X = 3) \approx 0.258$ (binomial pdf on the GDC).
  5. At most 5: $P(X \le 5) \approx 0.946$ (binomial cdf).
  6. At least 6: $P(X \ge 6) = 1 - P(X \le 5) \approx 0.054$.
  7. 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.

  1. Number faulty in a box: $X \sim B(20, 0.05)$.
  2. $P(X = 0) = 0.95^{20} \approx 0.358$.
  3. 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$.
  4. 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?

  • 4.00

  • 2.00

  • 1.41

  • 0.500

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