Random variables
Random variable X: Numerical outcome of random experiment.
Discrete: countable values (e.g., 0,1,2...).
Continuous: any value in range.
[Diagram: math-prob-bar] - Available in full study mode
Worked example
Coin flipped 3 times.
Let X=number of heads.
What are possible values?
Solution
- All outcomes: HHH, HHT, HTH, HTT, THH, THT, TTH, TTT
- X can be: 0 heads (TTT), 1 head (3 ways), 2 heads (3 ways), 3 heads (HHH)
- X ∈ {0,1,2,3} - discrete random variable
Final answer
Discrete RV: X ∈ {0,1,2,3}.
Probability distributions
Probability mass function (PMF): For each value x, assign probability P(X=x).
All probabilities sum to 1.
Worked example
Coin 3 times, X=heads.
Find P(X=0), P(X=1), P(X=2), P(X=3).
Solution
- P(X=0)=1/8 (1 way)
- P(X=1)=3/8 (3 ways)
- P(X=2)=3/8 (3 ways)
- P(X=3)=1/8 (1 way)
- Total: 1/8+3/8+3/8+1/8=1 ✓
Final answer
PMF table complete, probabilities sum to 1.
Practice with real exam questions
Answer exam-style questions and get AI feedback that shows you exactly what examiners want to see in a full-marks response.
Expected value (mean) and variance
Worked example
From coin example: find E(X) and Var(X).
Solution
- E(X)=0(1/8)+1(3/8)+2(3/8)+3(1/8)
- E(X)=0+3/8+6/8+3/8=12/8=1.5
- E(X2)=0²(1/8)+1²(3/8)+2²(3/8)+3²(1/8)=15/8
- Var(X)=15/8-1.5²=15/8-2.25=0.75
Final answer
E(X)=1.5, Var(X)=0.75, SD(X)=√0.75≈0.87.
IB-style question — find a value from E(X) [5 marks]
In a board game, a player moves a token and the score X (in points) has the distribution below, where n is a positive whole number.
x: −2, 1, n
P(X = x): 0.4, 0.45, 0.15
The expected score is E(X) = 1.
(a) Show that the probabilities given are consistent with a valid distribution.
(b) Find the value of n.
Step by step
- (a) Check the probabilities add to 1.
- They sum to 1 and each lies between 0 and 1, so the distribution is valid.
- (b) Write the expected value with n still unknown and set it equal to 1.
- Simplify the known terms.
- Collect and solve for n.
Final answer
(a) The probabilities add to 1 (and each is between 0 and 1), so the distribution is valid. (b) n = 9.
IB-style question — is the game fair?
A game costs $2 to play. You win $5 (net gain $3) with probability 0.3, otherwise you lose your $2.
(a) Find the expected gain per play. (b) Is the game fair? (c) Find the expected number of wins in 50 plays.
Step by step
- (a) E(gain) = Σ (gain × probability).
- (b) A fair game has E = 0. Here E = −$0.50, so it is NOT fair (it favours the house).
- (c) Expected number of wins = n × P(win) (this is np, not E(gain)).
Final answer
(a) −$0.50. (b) not fair. (c) 15 wins.
[Diagram: math-prob-bar] - Available in full study mode
Linear transformations
Key insight: E changes linearly.
Variance: only a² matters (not b).
Worked example
E(X)=1.5, Var(X)=0.75.
Find E(2X+5) and Var(2X+5).
Solution
- E(2X+5)=2E(X)+5=2(1.5)+5=8
- Var(2X+5)=2²Var(X)=4(0.75)=3
Final answer
E=8, Var=3, SD≈1.73.