Mean and variance of discrete distributions

Mean and variance of discrete distributions

Spec 1.1 · Edexcel A-Level Further Maths: Revision notes

Studying this course? Keep your progress in one place.

Key facts

  • Mean: E(X)=μ=∑xP(X=x)E(X)=\mu=\sum xP(X=x), the long-run average, which need not be a value XX can take.
  • Variance: Var(X)=E(X2)−μ2\text{Var}(X)=E(X^2)-\mu^2, with E(X2)=∑x2P(X=x)E(X^2)=\sum x^2P(X=x); it cannot be negative.
  • E(g(X))=∑g(x)P(X=x)E(g(X))=\sum g(x)P(X=x), and E(aX+b)=aE(X)+bE(aX+b)=aE(X)+b, but E(g(X))≠g(E(X))E(g(X))\neq g(E(X)) in general.
  • Probabilities sum to 11: use this to find unknown constants.
  • A fair game has expected profit 00; a model should match the data's mean and spread.

The mean of a random variable

Weight each value by its probability and add.

A discrete random variable XX takes separate values xx with probabilities P(X=x)P(X=x) that sum to 1.

The expected value or mean is E(X)=μ=∑xP(X=x)E(X)=\mu=\sum xP(X=x). It is the long-run average of many observations, not necessarily a value XX can take.

For P(X=1)=0.5P(X=1)=0.5, P(X=2)=0.3P(X=2)=0.3, P(X=3)=0.2P(X=3)=0.2: E(X)=0.5+0.6+0.6=1.7E(X)=0.5+0.6+0.6=1.7. The plain average of the values (22) is wrong unless all probabilities are equal.

00.10.20.30.40.5123xP(X = x)
The distribution of X. The mean 1.7 is not a value X can take.
  • Expected valueE(X)=∑xP(X=x)E(X)=\sum xP(X=x)

P(X=0)=0.4P(X=0)=0.4, P(X=1)=0.4P(X=1)=0.4, P(X=4)=0.2P(X=4)=0.2. What is E(X)E(X)?

The variance

Find E(X2)E(X^2) by squaring each value before weighting, then subtract μ2\mu^2.

The variance measures spread: Var(X)=σ2=E(X2)−μ2\text{Var}(X)=\sigma^2=E(X^2)-\mu^2, where E(X2)=∑x2P(X=x)E(X^2)=\sum x^2P(X=x).

The standard deviation is the square root of the variance.

A variance cannot be negative; a negative answer means an arithmetic error or a forgotten square. Stopping at E(X2)E(X^2) and quoting it as the variance is a common slip: you must subtract μ2\mu^2.

00.10.20.30.40.512345ValueProbability
  • X
  • Y
Two distributions with the same mean of 3 (illustrative): Var(X) = 0.5 for the narrow one, Var(Y) = 2 for the spread-out one.
  • VarianceVar(X)=E(X2)−[E(X)]2\text{Var}(X)=E(X^2)-[E(X)]^2

Worked example

P(X=1)=0.5P(X=1)=0.5, P(X=2)=0.3P(X=2)=0.3, P(X=3)=0.2P(X=3)=0.2. Find Var(X)\text{Var}(X) and the standard deviation.

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

Expected value of a function

Apply gg to each value, then weight by the probability.

For any function gg, E(g(X))=∑g(x)P(X=x)E(g(X))=\sum g(x)P(X=x). For g(x)=x2g(x)=x^2 this is E(X2)E(X^2).

The special case g(x)=ax+bg(x)=ax+b gives E(aX+b)=aE(X)+bE(aX+b)=aE(X)+b.

In the example, E(2X2−1)=2(3.5)−1=6E(2X^2-1)=2(3.5)-1=6. In general E(g(X))≠g(E(X))E(g(X))\neq g(E(X)): E(X2)=3.5E(X^2)=3.5 but [E(X)]2=2.89[E(X)]^2=2.89, and the difference is exactly the variance.

Costs, profits and penalties are often functions of a random variable, so E(g(X))E(g(X)) gives the expected cost or profit. E(1/X)E(1/X) is not 1/E(X)1/E(X).

0.511.522.533.54246810xy[E(X)]² = 2.89E(X²) = 3.5y = x²E(X²) = 3.5
E(g(X)) is not g(E(X)): with mean 1.7, [E(X)]² = 2.89 but E(X²) = 3.5. The gap, 0.61, is the variance.
  • E(g(X))E(g(X))∑g(x)P(X=x)\sum g(x)P(X=x)
  • E(aX+b)E(aX+b)aE(X)+baE(X)+b

E(X)=4E(X)=4. What is E(3X+2)E(3X+2)?

Finding unknown constants

Use ∑P(X=x)=1\sum P(X=x)=1, then check every probability lies between 00 and 11.

Probabilities are often given by a formula with an unknown constant. Use ∑P(X=x)=1\sum P(X=x)=1 to find it. Check every probability lies between 00 and 11 once the constant is found.

Keep fractions exact until the end; rounding kk early causes errors in E(X)E(X) and Var(X)\text{Var}(X).

00.10.20.30.40.50.6123xP(X = x)
The distribution P(X = x) = x²/14 (values to 3 d.p.).

Worked example

P(X=x)=kx2P(X=x)=kx^2 for x=1,2,3x=1,2,3. Find kk, E(X)E(X) and Var(X)\text{Var}(X).

P(X=x)=kxP(X=x)=kx for x=1,2,3,4x=1,2,3,4. What is kk?

Expected profit and fair games

Define the profit for each outcome, weight by probability and add; the game is fair if the result is zero.

A game's profit is a function of the outcome, so E(profit)E(\text{profit}) is found by weighting each profit by its probability.

A game is fair if the expected profit is zero.

Define the profit variable first: payout minus cost. Do not use the payout as the value of XX. Interpret answers in context, with units. The variance tells you how much results vary around the average, which matters when the expected value is small.

−2−10123Win (P = 0.4)Lose (P = 0.6)OutcomeProfit (£)
A fair game (illustrative): win £5 for a £2 stake with probability 0.4. E(profit) = 0.4 × 3 + 0.6 × (−2) = 0.
  • Profitpayout − cost
  • Fair gameE(profit)=0E(\text{profit})=0

Worked example

A game costs £3 and pays £20 with probability 0.05, £6 with probability 0.2 and nothing otherwise. Find the expected profit.

A game has an expected profit of £0.50 for the player. Is it fair?

Assessing a model

Compare the model's mean and variance with the data's; both should be close.

A model for a real situation should reproduce the observed mean and variance.

Calculate E(X)E(X) and Var(X)\text{Var}(X) for the model and compare with the sample mean and variance (or standard deviation). If they are close, the model may be suitable.

If the model's variance is much smaller than the data's, it underestimates spread and the chance of extreme values; costs from E(g(X))E(g(X)) will be too low. Also check the model allows every value seen in the data. Always state a conclusion and say why.

  1. 1

    Model

    find E(X)E(X) and Var(X)\text{Var}(X)

  2. 2

    Data

    find the sample mean and variance

  3. 3

    Compare

    are both close?

  4. 4

    Conclude

    state suitability and give a reason

Assessing a model.

A model has the same mean as the data but a much smaller variance. What should you conclude?

Try an exam question

The discrete random variable XX has P(X=x)=k(5−x)P(X=x)=k(5-x) for x=1,2,3,4x=1,2,3,4. Find kk, E(X)E(X) and Var(X)\text{Var}(X).

[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