SL 4.7 · Discrete Foundations

1. Probability Distribution and Expected Value $E(X)$

A discrete random variable $X$ takes numerical values from a countable set with corresponding probabilities $P(X = x)$.

  • Total Probability Condition: $$\sum_{x} P(X = x) = 1 \quad \text{and} \quad 0 \le P(X = x) \le 1 \text{ for all } x$$
  • Expected Value (Population Mean $\mu$): The long-run average outcome of the random experiment: $$E(X) = \mu = \sum x \cdot P(X = x)$$
  • Variance and Standard Deviation: $$\text{Var}(X) = \sigma^2 = E(X^2) - [E(X)]^2 = \sum x^2 P(X = x) - \mu^2$$ $$\sigma = \sqrt{\text{Var}(X)}$$
  • Concept of a Fair Game: A game is defined as fair if the expected net gain (profit) is zero: $$E(\text{Net Gain}) = 0 \iff E(\text{Payout}) = \text{Cost to play}$$

Worked Example 1.1 · Finding Distribution Parameter and Fair Game

A discrete random variable $X$ has the probability distribution given by $P(X = 1) = 0.2$, $P(X = 2) = 0.5$, and $P(X = 5) = k$.
(a) Find $k$.
(b) Calculate $E(X)$.
(c) If a player pays $\$C$ to play and receives $\$X$ as a payout, find $C$ so that the game is fair.

  1. (a) $\sum P(X = x) = 1 \implies 0.2 + 0.5 + k = 1 \implies k = 0.3$.
  2. (b) $E(X) = \sum x P(X = x) = 1(0.2) + 2(0.5) + 5(0.3) = 0.2 + 1.0 + 1.5 = 2.7$.
  3. (c) For a fair game, expected net profit is zero: $E(X - C) = E(X) - C = 0 \implies C = \$2.70$.

Answer: (a) $k = 0.3$; (b) $E(X) = 2.7$; (c) Cost $C = \$2.70$.

SL 4.8 · The Binomial Model

2. Binomial Distribution: Conditions and Parameters

A binomial random variable $X \sim B(n, p)$ models the number of successes in $n$ repeated trials.

  • The BINS Conditions (Essential for Exam Explanations):
    • Binary outcomes: Each trial results in either "Success" ($S$) or "Failure" ($F$).
    • Independent trials: The outcome of any trial does not influence any other trial.
    • Number of trials is fixed: Exactly $n$ trials are conducted.
    • Same probability: The probability of success $p$ is constant across all trials ($P(\text{Failure}) = 1 - p = q$).
  • Probability Mass Function: $$P(X = r) = \binom{n}{r} p^r (1 - p)^{n - r}, \quad r = 0, 1, 2, \dots, n$$ where $\binom{n}{r} = \frac{n!}{r!(n - r)!}$.
  • Mean and Variance: $$E(X) = \mu = np$$ $$\text{Var}(X) = \sigma^2 = np(1 - p) = npq$$

Worked Example 1.2 · Binomial Probability and At-Least-One

An archer has a probability of $0.8$ of hitting the bullseye on each shot ($p = 0.8$). She takes $5$ shots independently. Calculate: (a) the probability of hitting exactly 3 bullseyes, (b) the probability of hitting at least one bullseye, and (c) the expected number of bullseyes.

  1. (a) Model: $X \sim B(5, 0.8)$. $$P(X = 3) = \binom{5}{3} (0.8)^3 (0.2)^{5 - 3} = 10 \times 0.512 \times 0.04 = 0.2048$$
  2. (b) "At least one" uses the complement rule: $$P(X \ge 1) = 1 - P(X = 0) = 1 - \binom{5}{0} (0.8)^0 (0.2)^5 = 1 - (0.2)^5 = 1 - 0.00032 = 0.99968$$
  3. (c) $E(X) = np = 5(0.8) = 4$ bullseyes.

Answer: (a) $0.2048$; (b) $0.99968$; (c) Expected hits $= 4$.

SL 4.8 · Calculator Mechanics

3. Cumulative Binomial Probabilities

In Paper 2, questions frequently involve inequalities. GDC cumulative distribution functions $\text{binomCdf}(n, p, k)$ evaluate $P(X \le k)$.

  • Converting Inequalities for GDC / Analytical Solution:
    • $P(X \le k) = \text{binomCdf}(n, p, k)$
    • $P(X < k) = P(X \le k - 1)$
    • $P(X \ge k) = 1 - P(X \le k - 1)$
    • $P(X > k) = 1 - P(X \le k)$
    • $P(a \le X \le b) = P(X \le b) - P(X \le a - 1)$
Number of successes (r) P(X = r) 0.10 0.20 0.30 0 1 2 3 μ = np = 3.2 4 5 6 7 8 P(X ≤ 3) = 0.5941 P(X ≥ 4) = 1 - P(X ≤ 3) = 0.4059 Fig 4.5: Probability Mass Function for X ~ B(8, 0.4)
Figure 4.5: Discrete binomial distribution $X \sim B(8, 0.4)$ centered at $\mu = 3.2$, highlighting cumulative upper-tail evaluation.

Worked Example 1.3 · Fair Game & Expected Value

A game is played by rolling a fair six-sided die. If the die lands on a $6$, the player wins $\$10$. If it lands on a $4$ or $5$, the player wins $\$3$. Otherwise, the player wins nothing.
(a) Construct a probability distribution table for the winnings $W$. [2 marks]
(b) Calculate the expected payout $E(W)$. [2 marks]
(c) Determine how much the host should charge to play for the game to be fair. [1 mark]

  1. Part (a): Probability distribution table: $$P(W = 10) = \frac{1}{6}, \quad P(W = 3) = \frac{2}{6} = \frac{1}{3}, \quad P(W = 0) = \frac{3}{6} = \frac{1}{2} \quad [A1][A1]$$
  2. Part (b): Expected payout $E(W) = \sum w P(W = w)$: $$E(W) = 10\left(\frac{1}{6} \right) + 3\left(\frac{2}{6} \right) + 0\left(\frac{3}{6} \right) = \frac{10}{6} + \frac{6}{6} + 0 = \frac{16}{6} = \frac{8}{3} \approx \$2.67 \quad [M1][A1]$$
  3. Part (c): Fair game charge: For a game to be fair, the cost to play must equal the expected return $E(W)$, so the host should charge $\frac{8}{3} \approx \$2.67$ [R1].

Answers: (a) Table with values $10, 3, 0$; (b) $\$2.67$; (c) $\$2.67$.

Worked Example 1.4 · Binomial Cumulative Probability

A biased coin has probability $p = 0.65$ of landing on heads. The coin is tossed $12$ times. Let $X$ be the number of heads obtained.
(a) State the distribution of $X$, including its parameters. [1 mark]
(b) Find the probability of obtaining exactly $8$ heads. [2 marks]
(c) Find the probability of obtaining at least $9$ heads. [3 marks]

  1. Part (a): Distribution: $$X \sim B(12, 0.65) \quad [A1]$$
  2. Part (b): Exact binomial probability $P(X = 8)$: $$P(X = 8) = \binom{12}{8} (0.65)^8 (0.35)^4 = 495 \times (0.03186) \times (0.01501) \approx 0.2367 \implies 0.237 \quad [M1][A1]$$
  3. Part (c): At least 9 heads $P(X \ge 9)$: $$P(X \ge 9) = 1 - P(X \le 8) \quad [M1]$$ Using GDC `binomcdf(12, 0.65, 8)` $\approx 0.6533$: $$P(X \ge 9) = 1 - 0.6533 = 0.3467 \implies 0.347 \quad [M1][A1]$$

Answers: (a) $X \sim B(12, 0.65)$; (b) $0.237$; (c) $0.347$.

Worked Example 1.5 · Solving for Unknown Trials $n$

An archer hits the bullseye with probability $p = 0.2$. Let $n$ be the number of arrows shot.
Find the minimum number of arrows the archer must shoot so that the probability of hitting at least one bullseye is greater than $0.98$. [5 marks]

  1. Step 1: Formulate the probability inequality: $$P(X \ge 1) > 0.98 \implies 1 - P(X = 0) > 0.98 \quad [M1]$$
  2. Step 2: Express $P(X = 0)$ in terms of $n$: $$P(X = 0) = (1 - 0.2)^n = (0.8)^n \quad [A1]$$ $$1 - (0.8)^n > 0.98 \implies (0.8)^n < 0.02 \quad [M1]$$
  3. Step 3: Solve using natural logarithms: $$\ln((0.8)^n) < \ln(0.02) \implies n\ln(0.8) < \ln(0.02) \quad [M1]$$ Since $\ln(0.8) \approx -0.2231 < 0$, divide and flip the inequality sign: $$n > \frac{\ln(0.02)}{\ln(0.8)} = \frac{-3.91202}{-0.22314} \approx 17.53 \quad [A1]$$
  4. Step 4: Select the smallest integer: $$n = 18 \text{ arrows} \quad [A1]$$

Answer: $18$ arrows.

Topic 4.7 & 4.8 Practice Exercises

10 tiered problems covering discrete probability distributions, expected values, fair games, binomial formulas, and cumulative tails.

Question 1

The discrete random variable $X$ has the probability distribution:

$x$0123
$P(X = x)$$0.1$$0.4$$k$$0.2$

(a) Find the value of $k$.
(b) Calculate $E(X)$.

Show Step-by-Step Solution

Part (a): Total probability:

$$0.1 + 0.4 + k + 0.2 = 1 \implies k + 0.7 = 1 \implies k = 0.3$$

Part (b): Expected value:

$$E(X) = \sum x P(X = x) = 0(0.1) + 1(0.4) + 2(0.3) + 3(0.2) = 0 + 0.4 + 0.6 + 0.6 = 1.6$$

Final Answer: (a) $k = 0.3$; (b) $E(X) = 1.6$.

Question 2

A random variable follows a binomial distribution $X \sim B(10, 0.3)$.
(a) Find $E(X)$.
(b) Find the exact variance $\text{Var}(X)$.

Show Step-by-Step Solution

Part (a): Expected value:

$$E(X) = np = 10 \times 0.3 = 3$$

Part (b): Variance:

$$\text{Var}(X) = np(1 - p) = 10 \times 0.3 \times 0.7 = 2.1$$

Final Answer: (a) $E(X) = 3$; (b) $\text{Var}(X) = 2.1$.

Question 3

Let $X \sim B(4, 0.5)$. Using the binomial formula, calculate $P(X = 2)$ in exact fraction form.

Show Step-by-Step Solution

Step 1: Formula:

$$P(X = 2) = \binom{4}{2} (0.5)^2 (0.5)^{4 - 2} = \binom{4}{2} (0.5)^4$$

Step 2: Combinations: $\binom{4}{2} = \frac{4 \times 3}{2 \times 1} = 6$.

Step 3: Calculation:

$$P(X = 2) = 6 \times \left(\frac{1}{2}\right)^4 = 6 \times \frac{1}{16} = \frac{6}{16} = \frac{3}{8} = 0.375$$

Final Answer: $\frac{3}{8}$

Question 4

State whether a binomial distribution is an appropriate model in each situation, giving a reason:
(a) Rolling a fair die 20 times and counting the number of times a 6 appears.
(b) Drawing 5 cards from a standard deck without replacement and counting the number of Aces.

Show Step-by-Step Solution

Part (a): Yes, the binomial model is appropriate: there are fixed trials ($n = 20$), binary outcomes (6 or not 6), independent rolls, and constant probability ($p = \frac{1}{6}$).

Part (b): No, sampling without replacement violates the independence condition; the probability of drawing an Ace changes after each draw.

Final Answer: (a) Yes (satisfies BINS); (b) No (trials are dependent due to lack of replacement).

Question 5

A carnival game costs $\$5$ to play. A player spins a wheel with outcomes and payouts shown:

Payout ($X$)$\$0$$\$4$$\$10$$\$20$
Probability$0.60$$0.25$$0.10$$0.05$

(a) Calculate the expected payout $E(X)$.
(b) Determine whether the game is in favor of the player or the game host.

Show Step-by-Step Solution

Part (a): Expected payout:

$$E(X) = 0(0.60) + 4(0.25) + 10(0.10) + 20(0.05) = 0 + 1.00 + 1.00 + 1.00 = \$3.00$$

Part (b): Expected profit:
Player pays $\$5$ to play. Expected net gain $= E(X) - 5 = 3.00 - 5.00 = -\$2.00$.
Because the player loses an average of $\$2.00$ per game, the game is not fair and strongly favors the host (the host makes an expected profit of $\$2.00$ per play).

Final Answer: (a) $E(X) = \$3.00$; (b) Favors the host (expected host profit of $\$2.00$ per game).

Question 6

In a factory, the probability that a light bulb is defective is $0.04$. A random sample of $25$ bulbs is selected for inspection.
(a) Write down the probability distribution of $X$, the number of defective bulbs.
(b) Find the probability that exactly 2 bulbs are defective.
(c) Find the probability that at least 1 bulb is defective.

Show Step-by-Step Solution

Part (a): Distribution: $X \sim B(25, 0.04)$.

Part (b): Exactly 2 defective:

$$P(X = 2) = \binom{25}{2} (0.04)^2 (0.96)^{23} = 300 \times 0.0016 \times 0.3908 \approx 0.1876 \approx 0.188$$

Part (c): At least 1 defective:

$$P(X \ge 1) = 1 - P(X = 0) = 1 - (0.96)^{25} \approx 1 - 0.3604 = 0.6396 \approx 0.640$$

Final Answer: (a) $X \sim B(25, 0.04)$; (b) $0.188$; (c) $0.640$.

Question 7

Let $X \sim B(12, 0.35)$. Find:
(a) $P(X \le 4)$
(b) $P(X \ge 5)$
(c) $P(3 \le X \le 6)$

Show Step-by-Step Solution

Part (a): Using cumulative binomial $\text{binomCdf}(12, 0.35, 4)$:

$$P(X \le 4) \approx 0.5833 \approx 0.583$$

Part (b): Complementary rule:

$$P(X \ge 5) = 1 - P(X \le 4) = 1 - 0.5833 = 0.4167 \approx 0.417$$

Part (c): Double cumulative difference:

$$P(3 \le X \le 6) = P(X \le 6) - P(X \le 2)$$ $$\text{binomCdf}(12, 0.35, 6) \approx 0.9154$$ $$\text{binomCdf}(12, 0.35, 2) \approx 0.1511$$ $$P(3 \le X \le 6) = 0.9154 - 0.1511 = 0.7643 \approx 0.764$$

Final Answer: (a) $0.583$; (b) $0.417$; (c) $0.764$.

Question 8

A basketball player makes free throws with probability $p = 0.75$. Find the minimum number of free throws $n$ she must attempt so that the probability of making at least one basket is greater than $0.999$.

Show Step-by-Step Solution

Step 1: Set up the inequality:

$$P(X \ge 1) > 0.999 \implies 1 - P(X = 0) > 0.999$$ $$1 - (1 - 0.75)^n > 0.999 \implies 1 - (0.25)^n > 0.999$$ $$(0.25)^n < 0.001$$

Step 2: Solve using logarithms:

$$\ln(0.25^n) < \ln(0.001) \implies n\ln(0.25) < \ln(0.001)$$ Since $\ln(0.25) \approx -1.3863 < 0$, dividing reverses the inequality sign: $$n > \frac{\ln(0.001)}{\ln(0.25)} = \frac{-6.90775}{-1.38629} \approx 4.983$$

Step 3: Minimum integer: Since $n$ must be an integer, $n = 5$.

Final Answer: Minimum $n = 5$ attempts.

Question 9

A multiple-choice quiz contains 10 questions, each with 4 options (one correct, so $p = 0.25$).
(a) A student guesses all 10 questions independently. Find the probability that the student passes (scores 5 or more).
(b) Given that the student scored at least 3 correct, find the probability that they actually passed.
(c) The quiz is taken by a class of 30 students who all guess independently. Find the probability that at least 2 students pass.

Show Step-by-Step Solution

Part (a): Probability of passing:
$X \sim B(10, 0.25)$. $$P(X \ge 5) = 1 - P(X \le 4) = 1 - \text{binomCdf}(10, 0.25, 4) \approx 1 - 0.92187 = 0.07813 \approx 0.0781$$

Part (b): Conditional probability:
$$P(X \ge 5 | X \ge 3) = \frac{P(X \ge 5 \cap X \ge 3)}{P(X \ge 3)} = \frac{P(X \ge 5)}{P(X \ge 3)}$$ $$P(X \ge 3) = 1 - P(X \le 2) = 1 - \text{binomCdf}(10, 0.25, 2) \approx 1 - 0.52559 = 0.47441$$ $$P(X \ge 5 | X \ge 3) = \frac{0.07813}{0.47441} \approx 0.1647 \approx 0.165$$

Part (c): Binomial of Binomials:
Let $Y$ be the number of students who pass out of $30$: $Y \sim B(30, p_1)$ where $p_1 = 0.07813$. $$P(Y \ge 2) = 1 - P(Y \le 1)$$ $$P(Y = 0) = (1 - 0.07813)^{30} = (0.92187)^{30} \approx 0.0886$$ $$P(Y = 1) = \binom{30}{1}(0.07813)^1(0.92187)^{29} = 30(0.07813)(0.09612) \approx 0.2253$$ $$P(Y \le 1) = 0.0886 + 0.2253 = 0.3139$$ $$P(Y \ge 2) = 1 - 0.3139 = 0.6861 \approx 0.686$$

Final Answer: (a) $0.0781$; (b) $0.165$; (c) $0.686$.

Question 10

A continuous-improvement engineer tests a machine that produces components. The probability of a defective component is $p$. In a batch of 8 components, the probability of obtaining exactly 1 defective component is 4 times the probability of obtaining exactly 2 defective components.
(a) Form an algebraic equation in terms of $p$ and show that $p = \frac{1}{15}$.
(b) Calculate the mean and standard deviation of defective components in a larger batch of 300 components.
(c) Find the probability that a batch of 300 components has fewer than 15 defective components.

Show Step-by-Step Solution

Part (a): Set up the ratio:
$X \sim B(8, p)$. $$P(X = 1) = \binom{8}{1} p^1 (1 - p)^7 = 8p(1 - p)^7$$ $$P(X = 2) = \binom{8}{2} p^2 (1 - p)^6 = 28p^2 (1 - p)^6$$ Given $P(X = 1) = 4 P(X = 2)$: $$8p(1 - p)^7 = 4 \times 28p^2(1 - p)^6 = 112p^2(1 - p)^6$$ Since $p \neq 0$ and $p \neq 1$, divide both sides by $8p(1 - p)^6$: $$1 - p = 14p \implies 1 = 15p \implies p = \frac{1}{15} \quad \blacksquare$$

Part (b): Batch of 300:
$N = 300, p = \frac{1}{15}$. $$\mu = Np = 300 \times \frac{1}{15} = 20$$ $$\sigma^2 = Np(1 - p) = 20 \times \left(1 - \frac{1}{15}\right) = 20 \times \frac{14}{15} = \frac{280}{15} = \frac{56}{3} \approx 18.667$$ $$\sigma = \sqrt{\frac{56}{3}} \approx 4.32$$

Part (c): Fewer than 15 defectives:
"Fewer than 15" means $P(W \le 14)$ where $W \sim B\left(300, \frac{1}{15}\right)$: $$P(W \le 14) = \text{binomCdf}\left(300, \frac{1}{15}, 14\right) \approx 0.0963$$

Final Answer: (a) $p = \frac{1}{15}$; (b) Mean $= 20$, $\sigma \approx 4.32$; (c) $0.0963$.

IB Formula Booklet References (Topic 4)

Expected Value of a Discrete Random Variable $X$:

$$E(X) = \sum_{x} x P(X = x)$$

Binomial Distribution $X \sim B(n, p)$:

$$P(X = r) = \binom{n}{r} p^r (1 - p)^{n - r}, \quad r = 0, 1, \dots, n$$ $$E(X) = np$$ $$\text{Var}(X) = np(1 - p)$$

Must-Memorize Shortcuts & Definitions

Total Probability Axiom:

$$\sum_{x} P(X = x) = 1$$

At Least One Shortcut:

$$P(X \ge 1) = 1 - P(X = 0) = 1 - (1 - p)^n$$

Fair Game Criterion:

$$E(\text{Net Profit}) = E(\text{Payout}) - \text{Cost} = 0 \iff E(\text{Payout}) = \text{Cost}$$

Critical IB Examination Pitfalls

  • Inequality Boundaries: Confusing "fewer than $k$" ($X \le k - 1$) with "at most $k$" ($X \le k$). Discrete distributions are sensitive to whether the boundary is included!
  • Forgetting the Combinatorial Factor $\binom{n}{r}$: Writing only $p^r(1-p)^{n-r}$ calculates the probability of a single specific sequence of successes and failures, forgetting that the successes can occur in $\binom{n}{r}$ different orders.
  • Logarithmic Inequality Reversal: When solving $(1-p)^n < \alpha$ for $n$, dividing by $\ln(1-p)$ MUST flip the inequality because $\ln(1-p)$ is always negative for $0 < p < 1$.
  • Fair Game Payout vs Net Profit: Ensure you subtract the ticket cost when computing net profit; a game is fair when expected net profit is zero, NOT when expected payout is zero.

Topic 4.7 & 4.8 Diagnostic Mini Test

Section A: 4 Diagnostic MCQs with immediate feedback. Section B: 2 Exam-style Free Response Questions with full markschemes.

Section A: Diagnostic Multiple Choice

Question 1: A discrete random variable $X$ has $P(X = 1) = 0.3$, $P(X = 2) = 0.5$, and $P(X = 4) = 0.2$. What is $E(X)$?

Question 2: For a binomial distribution $X \sim B(20, 0.2)$, what is the variance $\text{Var}(X)$?

Question 3: If $X \sim B(5, 0.4)$, which expression gives the probability of at least one success?

Question 4: In a casino game, a player pays $\$10$ to enter. Under what condition is the game mathematically fair?

Section B: Examination-Style Free Response Questions

Question 5 (6 marks)

The probability distribution of a discrete random variable $Y$ is given by $P(Y = y) = c(y^2 + 1)$ for $y \in \{0, 1, 2, 3\}$.
(a) Find the exact value of the constant $c$. [3 marks]
(b) Calculate $E(Y)$. [3 marks]

Show Full Markscheme

(a) Value of $c$:
$\sum P(Y = y) = 1 \implies c(0^2+1) + c(1^2+1) + c(2^2+1) + c(3^2+1) = 1$. [M1]
$c(1 + 2 + 5 + 10) = 1 \implies 18c = 1 \implies c = \frac{1}{18}$. [A2]

(b) Expected value:
$E(Y) = \sum y P(Y = y) = 0\left(\frac{1}{18}\right) + 1\left(\frac{2}{18}\right) + 2\left(\frac{5}{18}\right) + 3\left(\frac{10}{18}\right)$. [M1]
$E(Y) = \frac{0 + 2 + 10 + 30}{18} = \frac{42}{18} = \frac{7}{3} \approx 2.33$. [A2]

Question 6 (8 marks)

A biased coin has probability $p$ of landing on Heads. The coin is tossed 6 times.
(a) Write down an expression in terms of $p$ for the probability of obtaining exactly 4 Heads. [2 marks]
(b) Given that the probability of obtaining 4 Heads is twice the probability of obtaining 5 Heads, find the value of $p$. [3 marks]
(c) Using $p = \frac{5}{9}$, find the probability of obtaining at least 3 Heads in 6 tosses, correct to 3 significant figures. [3 marks]

Show Full Markscheme

(a) Binomial expression:
$P(X = 4) = \binom{6}{4} p^4 (1 - p)^2 = 15p^4(1 - p)^2$. [A1 A1]

(b) Finding $p$:
$P(X = 5) = \binom{6}{5} p^5(1 - p)^1 = 6p^5(1 - p)$. [A1]
$P(X = 4) = 2 \times P(X = 5) \implies 15p^4(1 - p)^2 = 12p^5(1 - p)$. [M1]
Since $0 < p < 1$, divide both sides by $3p^4(1 - p)$:
$5(1 - p) = 4p \implies 5 - 5p = 4p \implies 9p = 5 \implies p = \frac{5}{9} \quad [A1]$

(c) At least 3 Heads:
$X \sim \text{B}\left(6, \frac{5}{9}\right)$.
$P(X \ge 3) = 1 - P(X \le 2) = 1 - \text{binomCdf}\left(6, \frac{5}{9}, 2\right) \approx 0.748$. [M1][A2]