Free access until 30 November 2026 · Physics and Maths questions and notes, updated continuously · Build a test

Topic 4 · IB Maths AA

Discrete random variables

Build your own probability distribution table, see its bar chart, E(X) and Var(X), then run thousands of random trials to watch the sample mean settle towards E(X).

xP(X = x)

E(X) = Σ x·P(X = x)
Var(X) = Σ x²·P(X = x) − [E(X)]²
σ = √Var(X)

E(X)
Var(X)
σ
Trials n
Sample mean x̄
Sample variance (÷n)
|x̄ − E(X)|

Try this

  1. Choose the fair die, work out E(X) and Var(X) by hand, then check them and run 10 000 trials: how close does x̄ get to 3.5?
  2. Pick the game: is it fair? Change the value of the top prize so that E(X) = 0 exactly, then simulate to test it.
  3. In a custom table, move probability towards the two extreme x values (keeping Σ P = 1) and watch Var(X) grow and the running mean wander for longer.

Common error: Var(X) needs E(X²) − [E(X)]², so square each x before multiplying by its probability and only square the mean at the end; always check Σ P = 1 first.