Discrete Random
Variables
Understand how to model random outcomes with probability distributions, and master the expected value \( E(X) \) and variance \( \text{Var}(X) \).
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.
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).
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) \).
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) \)
How to Apply the Formulas
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.
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
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 \)?