01 / 21

Discrete Random
Variables

Understand how to model random outcomes with probability distributions, and master the expected value \( E(X) \) and variance \( \text{Var}(X) \).

IB Mathematics AA

What Is a Random Variable?

A random variable \( X \) is a function that assigns a numerical value to each outcome of a random experiment. Instead of describing outcomes in words, we map them to numbers so we can calculate with them.

Experiment
Roll a fair six-sided die
Random Variable
\( X = \) number shown on top face
Possible Values
\( X \in \{1,2,3,4,5,6\} \)

Discrete vs Continuous

Random variables come in two flavours. In this lesson we focus on the discrete type: the set of possible values is countable (finite or countably infinite).

Discrete
Countable values: number of heads in 10 flips, goals in a match, dice score. Values can be listed.
Continuous
Uncountable values: height, time, temperature. Any value in an interval is possible.

The Probability Distribution

A probability distribution of a discrete random variable \( X \) is a table (or formula) that lists every possible value \( x_i \) together with its probability \( P(X = x_i) \).

0 1/6 1 2 3 4 5 6 x
\( P(X=x) \)
1/6 1/6 1/6 1/6 1/6 1/6

Expected Value: \( E(X) \)

The expected value (or mean) \( \mu \) of a discrete random variable is the long-run average you would obtain if you repeated the experiment infinitely many times.

Think of it as a weighted average: values that are more probable pull the mean toward them more strongly.

Variance: \( \text{Var}(X) \)

The variance measures how spread out the distribution is around its mean. A larger variance means values are more scattered.

\( E(X) \) vs \( \text{Var}(X) \): What's the Difference?

Expected Value \( E(X) \) Variance \( \text{Var}(X) \)
Measures Centre (average outcome) Spread (how far from mean)
Formula \( \sum x_i P(X=x_i) \) \( \sum (x_i - \mu)^2 P(X=x_i) \)
Units Same as \( X \) Squared units of \( X \)
Can be negative? Yes Never (always \( \geq 0 \))

Properties of \( E(X) \) and \( \text{Var}(X) \)

1
Linearity of expectation: \( E(aX + b) = a \cdot E(X) + b \)
2
Scaling variance: \( \text{Var}(aX + b) = a^2 \cdot \text{Var}(X) \). Adding a constant does not change spread.
3
Expectation of a constant: \( E(c) = c \) and \( \text{Var}(c) = 0 \).
4
Shortcut for variance: \( \text{Var}(X) = E(X^2) - [E(X)]^2 \). Often faster than the definition.

How to Apply the Formulas

1
List all values of \( X \) and their probabilities in a table. Verify \( \sum P = 1 \).
2
Compute \( E(X) \): add a column for \( x_i \cdot P(X=x_i) \) and sum.
3
Compute \( E(X^2) \): add a column for \( x_i^2 \cdot P(X=x_i) \) and sum.
4
Apply the shortcut: \( \text{Var}(X) = E(X^2) - [E(X)]^2 \).
5
Standard deviation: \( \sigma = \sqrt{\text{Var}(X)} \). Round only at the end.

Example 1: Fair Die

Let \( X \) be the score on a fair six-sided die. Find \( E(X) \) and \( \text{Var}(X) \).

Example 2: Biased Spinner

A spinner has outcomes \( X \in \{0, 1, 2, 5\} \) with probabilities shown below.

\( x \) 0 1 2 5
\( P(X=x) \) 0.3 0.4 0.2 0.1
\( x \cdot P \) 0 0.4 0.4 0.5
\( x^2 \cdot P \) 0 0.4 0.8 2.5

Example 3: Finding a Missing Probability

A random variable \( X \) takes values \( \{1, 2, 3\} \). Given that \( P(X=1) = 0.2 \), \( P(X=3) = 0.3 \), and \( E(X) = 2.1 \), find \( P(X=2) \).

Visualising Spread

Two distributions can have the same mean but very different variances. The bar charts below both have \( E(X) = 3 \), but Distribution B is more spread out.

Distribution A
\( \text{Var}(X) = 0.8 \)
1 2 3 4 5 .05 .20 .50 .20 .05 Distribution B
\( \text{Var}(X) = 2.0 \)
1 2 3 4 5 .20 .20 .20 .20 .20

Applying Linear Transformations

If \( X \) is the score on a fair die, a game pays you \( Y = 3X - 2 \) dollars. Find \( E(Y) \) and \( \text{Var}(Y) \).

Common Mistakes

✕ Forgetting to square
Using \( \text{Var}(aX) = a \cdot \text{Var}(X) \) instead of the correct \( a^2 \cdot \text{Var}(X) \). The scaling factor must be squared.
✕ Probabilities don't sum to 1
Always verify \( \sum P(X = x_i) = 1 \) before computing anything. A missing value means an incomplete distribution.
✕ Confusing \( E(X^2) \) with \( [E(X)]^2 \)
These are different quantities. \( E(X^2) = \sum x_i^2 P_i \), while \( [E(X)]^2 \) is the square of the mean. Mixing them up gives the wrong variance.

Summary of Key Formulas

Concept Formula Meaning
Validity \( \sum P(X = x_i) = 1 \) All probabilities add to 1
Expected value \( E(X) = \sum x_i P_i \) Long-run average
Variance \( E(X^2) - [E(X)]^2 \) Spread around mean
Std. deviation \( \sigma = \sqrt{\text{Var}(X)} \) Spread in original units
Linear \( E \) \( E(aX+b) = aE(X)+b \) Scale and shift mean
Linear \( \text{Var} \) \( \text{Var}(aX+b) = a^2 \text{Var}(X) \) Only scaling affects spread

Question 1 of 5

A discrete random variable \( X \) has the distribution: \( P(X=1) = 0.2 \), \( P(X=2) = 0.5 \), \( P(X=3) = 0.3 \). What is \( E(X) \)?

Question 2 of 5

For the same distribution (\( P(1)=0.2, P(2)=0.5, P(3)=0.3 \)), what is \( \text{Var}(X) \)?

Question 3 of 5

If \( E(X) = 4 \) and \( \text{Var}(X) = 3 \), what is \( E(2X + 5) \)?

Question 4 of 5

Using the same \( E(X) = 4 \) and \( \text{Var}(X) = 3 \), what is \( \text{Var}(2X + 5) \)?

Question 5 of 5

A discrete random variable has \( P(X=0) = k \), \( P(X=1) = 2k \), \( P(X=2) = 3k \). What is the value of \( k \)?