Mean and variance of continuous random variables

Mean and variance of continuous random variables

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

Studying this course? Keep your progress in one place.

Key facts

  • Variance is E(X2)−[E(X)]2\mathrm{E}(X^2)-[\mathrm{E}(X)]^2: always subtract the squared mean.
  • The mean is E(X)=∫x f(x) dx\mathrm{E}(X)=\int x\,f(x)\,dx over the range where f(x)≠0f(x)\ne0.
  • For any function, E(g(X))=∫g(x)f(x) dx\mathrm{E}(g(X))=\int g(x)f(x)\,dx, and Var(aX+b)=a2Var(X)\mathrm{Var}(aX+b)=a^2\mathrm{Var}(X).
  • The median and percentiles come from the cumulative distribution function: F(m)=0.5F(m)=0.5.
  • Compare mean, median and mode to describe skew, and justify it with the values.

Mean, variance and spread

Integrate x f(x)x\,f(x) for the mean, then use E(X2)−[E(X)]2\mathrm{E}(X^2)-[\mathrm{E}(X)]^2 for the variance.

The expected value is E(X)=∫x f(x) dx\mathrm{E}(X)=\int x\,f(x)\,dx, integrated only where f(x)≠0f(x)\ne0. First find E(X2)=∫x2f(x) dx\mathrm{E}(X^2)=\int x^2f(x)\,dx.

The variance is E(X2)−[E(X)]2\mathrm{E}(X^2)-[\mathrm{E}(X)]^2 and the standard deviation is its positive square root.

  • MeanE(X)=∫x f(x) dx\mathrm{E}(X)=\int x\,f(x)\,dx
  • VarianceE(X2)−[E(X)]2\mathrm{E}(X^2)-[\mathrm{E}(X)]^2
0.20.40.60.811.21.41.61.822.20.20.40.60.811.21.41.61.8xymean, x = 1.5(2, 1.5)f(x) = 3x²/8
f(x) = 3x²/8 on [0, 2]: the mean is at x = 1.5.

Worked example

f(x)=38x2f(x)=\frac38x^2 on 0≤x≤20\le x\le2. Find E(X)\mathrm{E}(X) and Var(X)\mathrm{Var}(X).

For a density with E(X2)=10\mathrm{E}(X^2)=10 and E(X)=3\mathrm{E}(X)=3, what is Var(X)\mathrm{Var}(X)?

Expectation of a function

Integrate the function against the density: E(g(X))=∫g(x)f(x) dx\mathrm{E}(g(X))=\int g(x)f(x)\,dx.

This covers E(X2)\mathrm{E}(X^2), E(1X)\mathrm{E}\left(\frac1X\right) and E(X)\mathrm{E}(\sqrt X).

For a linear function, E(aX+b)=aE(X)+b\mathrm{E}(aX+b)=a\mathrm{E}(X)+b and Var(aX+b)=a2Var(X)\mathrm{Var}(aX+b)=a^2\mathrm{Var}(X).

In general E(g(X)) is not g(E(X))g(\mathrm{E}(X)).

−0.20.20.40.60.811.20.511.52xyf(x) = 2xx² f(x) = 2x³
For f(x) = 2x on [0, 1], E(X²) is the area under x² f(x) = 2x³, which is 1/2.
  • Any functionE(g(X))=∫g(x)f(x) dx\mathrm{E}(g(X))=\int g(x)f(x)\,dx
  • Linear changeVar(aX+b)=a2Var(X)\mathrm{Var}(aX+b)=a^2\mathrm{Var}(X)

Worked example

With f(x)=38x2f(x)=\frac38x^2 on [0,2][0,2], find E(1X)\mathrm{E}\left(\frac1X\right).

If Var(X)=5\mathrm{Var}(X)=5, what is Var(3X+2)\mathrm{Var}(3X+2)?

Mode, median and percentiles

The mode is where ff is greatest; the median and percentiles come from solving F(x)F(x) equal to a probability.

The mode is where f(x)f(x) is greatest. Solve f′(x)=0f'(x)=0, but also check the end points. For f(y)=y2f(y)=\frac y2 on [0,2][0,2] the mode is the end point y=2y=2.

The cumulative distribution function is F(x)=∫−∞xf(t) dtF(x)=\int_{-\infty}^xf(t)\,dt. The median mm has F(m)=0.5F(m)=0.5 and the ppth percentile qq has F(q)=p100F(q)=\frac{p}{100}.

0.20.40.60.811.21.41.61.822.20.20.40.60.811.2xymode (2, 1)medianf(y) = y/2
f(y) = y/2 has no turning point: the mode is the end point y = 2.

Worked example

f(x)=3x−4f(x)=3x^{-4} for x≥1x\ge1. Find the 90th percentile.

For f(y)=y2f(y)=\frac y2 on [0,2][0,2], F(y)=y24F(y)=\frac{y^2}{4}. What is the median?

Skewness

Compare the mean, median and mode: their order tells you the direction of skew.

Skewness describes asymmetry. Always justify the description with the values.

  • Positive skew: mean >> median >> mode, with a long tail to the right.
  • Negative skew: mean << median << mode, with a long tail to the left.
  • Zero skew: mean == median == mode, as for a symmetrical density.

Positive skew

  • Mean > median > mode
  • Long tail on the right

Negative skew

  • Mean < median < mode
  • Long tail on the left

Zero skew

  • Mean = median = mode
  • Symmetrical
0.20.40.60.811.21.41.61.822.20.20.40.60.811.2xymeanmedianmodef(y) = y/2
f(y) = y/2: mean 1.33 < median 1.41 < mode 2, so negative skew.

A distribution has mean 5.2, median 4.8 and mode 4.1. What is the skew?

Assessing a model

Compare the model's mean, spread and range with the data, then give a judgement in context.

A density ff can be used to model a real quantity. Compare the model's mean, variance, median and percentiles with the data's, and check the range.

A good model agrees closely with the sample mean and variance and does not rule out values that actually occur. Always finish with a judgement.

  1. 1

    Compare the mean

    model against sample

  2. 2

    Compare the spread

    variance or range

  3. 3

    Check the range

    are observed values possible?

  4. 4

    Judge

    suitable or not, in context

Assessing a model

Example: a model with mean 3.333.33 and variance 5.565.56 against a sample with mean 3.43.4 and variance 5.85.8 fits the average behaviour. If f(d)=0f(d)=0 for d>10d>10 but 12.512.5 is observed, it is unsuitable for the upper tail.

A model has f(d)=0f(d)=0 for d>10d>10, but a value of 12.512.5 is observed. Is the model suitable?

Try an exam question

The continuous random variable XX has probability density function f(x)=2x9f(x)=\frac{2x}{9} for 0≤x≤30\le x\le3, and 00 otherwise. Find E(X)\mathrm{E}(X) and Var(X)\mathrm{Var}(X).

[4 marks]

That's the notes covered.

Carry on to the next subtopic.

Try a question

Find E(X)\mathrm{E}(X).

1 mark, marked against the mark scheme

Revision notes