Expectation and variance of discrete random variables

Expectation and variance of discrete random variables

Spec 5.3 · Edexcel International A Level Maths: Revision notes

Studying this course? Keep your progress in one place.

Key facts

  • E(X)=∑x P(X=x)E(X)=\sum x\,P(X=x): the long-run average, weighting each value by its probability.
  • Var(X)=E(X2)−[E(X)]2\mathrm{Var}(X)=E(X^2)-[E(X)]^2 with E(X2)=∑x2P(X=x)E(X^2)=\sum x^2P(X=x); variance is never negative.
  • E(aX+b)=aE(X)+bE(aX+b)=aE(X)+b and Var(aX+b)=a2Var(X)\mathrm{Var}(aX+b)=a^2\mathrm{Var}(X): bb does not affect the spread.
  • For unknown probabilities use ∑p=1\sum p=1 and the given mean or variance as simultaneous equations.
  • The expected net gain of a game is E(X)−fE(X)-f; it is fair if E(X)=fE(X)=f.

The mean, E(X)

The expectation is the long-run average value: each value weighted by its probability.

The expectation (mean) of a discrete random variable is the long-run average value, found by weighting each value by its probability.

E(X)E(X) need not be a possible value of XX. If XX takes values symmetrically about a centre, the mean is at the centre.

00.10.20.30.40123xP(X = x)
X takes 0, 1, 2, 3 with probabilities 0.2, 0.3, 0.4, 0.1. E(X) = 0.3 + 0.8 + 0.3 = 1.4, which is not a possible value of X.
  • ExpectationE(X)=∑x P(X=x)E(X)=\sum x\,P(X=x)

Worked example

P(X=0)=0.2P(X=0)=0.2, P(X=1)=0.3P(X=1)=0.3, P(X=2)=0.4P(X=2)=0.4, P(X=3)=0.1P(X=3)=0.1. Find E(X)E(X).

XX takes the values 2 and 4 with probability 0.5 each. What is E(X)E(X)?

E(X²) and the variance

Find E(X2)E(X^2) by squaring each value before weighting, then subtract [E(X)]2[E(X)]^2.

E(X2)=∑x2P(X=x)E(X^2)=\sum x^2P(X=x): square each value first, then weight by its probability.

The variance measures spread: Var(X)=E(X2)−[E(X)]2\mathrm{Var}(X)=E(X^2)-[E(X)]^2. The standard deviation is Var(X)\sqrt{\mathrm{Var}(X)}.

A table of xx, P(X=x)P(X=x), xPxP and x2Px^2P keeps this tidy. For the distribution below, the totals are E(X)=1.4E(X)=1.4 and E(X2)=2.8E(X^2)=2.8, so Var(X)=2.8−1.42=0.84\mathrm{Var}(X)=2.8-1.4^2=0.84.

If you are given Var(X)\mathrm{Var}(X) and E(X)E(X), then E(X2)=Var(X)+[E(X)]2E(X^2)=\mathrm{Var}(X)+[E(X)]^2.

00.20.40.60.811.21.41.60123xTerm
  • xP
  • x²P
Terms of the sums for the same distribution: Σ xP = 1.4 and Σ x²P = 2.8, so Var(X) = 2.8 − 1.4² = 0.84.
  • VarianceVar(X)=E(X2)−[E(X)]2\mathrm{Var}(X)=E(X^2)-[E(X)]^2
  • E(X2)E(X^2)∑x2 P(X=x)\sum x^2\,P(X=x)

x = 0

P(X = x):
0.2
xP:
0
x²P:
0

x = 1

P(X = x):
0.3
xP:
0.3
x²P:
0.3

x = 2

P(X = x):
0.4
xP:
0.8
x²P:
1.6

x = 3

P(X = x):
0.1
xP:
0.3
x²P:
0.9

E(X)=3E(X)=3 and E(X2)=11E(X^2)=11. What is Var(X)\mathrm{Var}(X)?

Linear transformations

The mean is shifted and scaled like the values; the variance is multiplied by a2a^2 and ignores the constant bb.

For constants aa and bb, the mean is shifted and scaled in the same way as the values.

The constant bb has no effect on the spread, because adding a constant moves every value by the same amount.

The multiplier aa is squared in the variance. For a negative multiplier, for example 5−2X5-2X: Var(5−2X)=(−2)2Var(X)=4Var(X)\mathrm{Var}(5-2X)=(-2)^2\mathrm{Var}(X)=4\mathrm{Var}(X).

01020304050MeanVarianceStatisticValue
  • W
  • V = 3W − 4
V = 3W − 4 with E(W) = 10 and Var(W) = 6: the mean becomes 26 but the variance is multiplied by 9, giving 54.
  • MeanE(aX+b)=aE(X)+bE(aX+b)=aE(X)+b
  • VarianceVar(aX+b)=a2Var(X)\mathrm{Var}(aX+b)=a^2\mathrm{Var}(X)

Worked example

E(W)=10E(W)=10, Var(W)=6\mathrm{Var}(W)=6 and V=3W−4V=3W-4. Find E(V)E(V) and Var(V)\mathrm{Var}(V).

Var(X)=5\mathrm{Var}(X)=5. What is Var(2X+7)\mathrm{Var}(2X+7)?

Finding unknown probabilities

Write one equation from ∑p=1\sum p=1 and another from the given mean or variance, then solve simultaneously.

Often the distribution contains unknowns. Write one equation from ∑p=1\sum p=1 and another from a given mean or variance, then solve the simultaneous equations.

Check your constants by confirming the probabilities add to 1 and the mean agrees with the given value.

  1. 1

    Use ∑p=1\sum p=1

    first equation

  2. 2

    Use the given mean or variance

    second equation

  3. 3

    Solve simultaneously

    for the unknowns

  4. 4

    Check

    probabilities add to 1 and mean agrees

Finding unknown probabilities.

Worked example

P(X=1)=0.1P(X=1)=0.1, P(X=2)=aP(X=2)=a, P(X=3)=0.4P(X=3)=0.4, P(X=4)=bP(X=4)=b with E(X)=2.9E(X)=2.9. Find aa, bb and Var(X)\mathrm{Var}(X).

P(X=1)=pP(X=1)=p, P(X=2)=2pP(X=2)=2p, P(X=3)=0.4P(X=3)=0.4. What is pp?

Interpreting expectation in context

The expected net gain of a game is E(X)−fE(X)-f; it is fair if E(X)=fE(X)=f. It is a long-run average, not a single result.

In a game with prize XX and an entry fee ff, the expected net gain is E(X)−fE(X)-f. The game is fair if E(X)=fE(X)=f.

A positive expected gain favours the player; a negative one favours the organiser.

Remember that E(X)E(X) is a long-run average: any single game gives only the prizes available. Say 'on average' or 'in the long run' when interpreting an expectation.

00.10.20.30.40.5830PrizeProbability
Prize 8 with probability 1/6, 3 with 2/6 and 0 with 3/6. E(X) = 7/3; with a fee of 2 the expected net gain is 1/3.
  • Expected net gainE(X)−fE(X)-f
  • Fair gameE(X)=fE(X)=f

Worked example

A die roll pays 8 pounds for a 6, 3 pounds for a 4 or 5, and nothing otherwise. The fee is 2 pounds. Find the expected net gain.

A game costs 5 pounds and has E(X)=5E(X)=5. What is it called?

Try an exam question

The discrete random variable XX has P(X=0)=0.3P(X=0)=0.3, P(X=1)=0.4P(X=1)=0.4, P(X=2)=0.2P(X=2)=0.2 and P(X=3)=0.1P(X=3)=0.1. Find E(X)E(X), Var(X)\mathrm{Var}(X) and Var(3X−1)\mathrm{Var}(3X-1).

[5 marks]

That's the notes covered.

Carry on to the next subtopic.

Try a question

Find E(X)E(X).

1 mark, marked against the mark scheme

Revision notes