Functions of a DRV

Functions of a DRV

Spec SA5 · AQA A-Level Further Maths: Revision notes

Studying this course? Keep your progress in one place.

Key facts

  • Y=g(X)Y=g(X) takes the values g(xi)g(x_i) with the same probabilities (add them if two values coincide).
  • E(g(X))=∑g(xi)piE(g(X))=\sum g(x_i)p_i: apply gg to the values, not the probabilities.
  • In general E(g(X))≠g(E(X))E(g(X))\ne g(E(X)); equality holds only for linear gg.
  • Var(g(X))=E([g(X)]2)−[E(g(X))]2\mathrm{Var}(g(X))=E([g(X)]^2)-[E(g(X))]^2.
  • A constant multiple scales the variance by its square.

A function of a DRV

A new random variable whose values are g(xi)g(x_i), each with the probability of the original value.

If XX is a DRV and gg is a function, then Y=g(X)Y=g(X) is also a DRV. It takes the values g(xi)g(x_i) with probability P(X=xi)P(X=x_i). If two values of xx give the same g(x)g(x), add their probabilities.

Examples: X2X^2, 5X35X^3, 18X−318X^{-3}, 6X−16X^{-1}. A table with rows xx, g(x)g(x) and P(X=x)P(X=x) keeps the working clear.

Negative powers need x≠0x\ne0.

00.10.20.30.40.5x = 1x = 2x = 3Value of XP(X = x)
The distribution of X: g(X) = X² keeps these probabilities, giving values 1, 4 and 9.

x = 1

x²:
1
P(X = x):
0.2

x = 2

x²:
4
P(X = x):
0.5

x = 3

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

X=−1,1,2X=-1,1,2 with probabilities 0.2,0.3,0.50.2,0.3,0.5. What is P(X2=1)P(X^2=1)?

Expectation of g(X)

Apply gg to each value, multiply by its probability and add.

E(g(X))=∑g(xi) pi.E\big(g(X)\big)=\sum g(x_i)\,p_i.

Apply gg to each value, multiply by its probability and add. You do not need the distribution of g(X)g(X) itself.

Constant multiples come out: E(18X−3)=18E(X−3)E(18X^{-3})=18E(X^{-3}).

00.511.522.5x = 1x = 2x = 3Value of Xg(x) × p
Each term g(x)p of E(X²): 1×0.2, 4×0.5 and 9×0.3 add to 4.9.
  • E(g(X))E(g(X))∑g(xi)pi\sum g(x_i)p_i
  • E(kg(X))E(kg(X))kE(g(X))kE(g(X))

Worked example

X=1,2,3X=1,2,3 with probabilities 0.2,0.5,0.30.2,0.5,0.3. Find E(X2)E(X^2) and E(5X3)E(5X^3).

X=1,2X=1,2 with probabilities 0.6,0.40.6,0.4. What is E(X2)E(X^2)?

Why E(g(X)) is not g(E(X))

Only when gg is linear: otherwise E(g(X))≠g(E(X))E(g(X))\ne g(E(X)).

In general E(g(X))≠g(E(X))E(g(X))\ne g(E(X)). For g(x)=x2g(x)=x^2, E(X2)=Var(X)+[E(X)]2≥[E(X)]2E(X^2)=\mathrm{Var}(X)+[E(X)]^2\ge[E(X)]^2.

The equality E(g(X))=g(E(X))E(g(X))=g(E(X)) holds only when gg is a linear function, g(x)=ax+bg(x)=ax+b.

012345[E(X)]²E(X²)QuantityValue
For the same X: E(X) = 2.1, so [E(X)]² = 4.41, but E(X²) = 4.9. They differ because g is not linear.

E(X2)E(X^2)

Value:
Var(X)+[E(X)]2\mathrm{Var}(X)+[E(X)]^2
Equal to g(E(X))g(E(X))?:
No

E(1/X)E(1/X)

Value:
not 1E(X)\frac1{E(X)}
Equal to g(E(X))g(E(X))?:
No

E(aX+b)E(aX+b)

Value:
aE(X)+baE(X)+b
Equal to g(E(X))g(E(X))?:
Yes

Worked example

X=2,3,4X=2,3,4 with probabilities 0.25,0.5,0.250.25,0.5,0.25. Compare E(X2)E(X^2) with [E(X)]2[E(X)]^2.

X=1,2X=1,2 with equal probabilities. Is E(1X)=1E(X)E\left(\frac1X\right)=\frac1{E(X)}?

Variance of g(X)

Treat g(X)g(X) as a variable: use E([g(X)]2)E([g(X)]^2) and [E(g(X))]2[E(g(X))]^2.

Treat Y=g(X)Y=g(X) as a variable and use Var(Y)=E(Y2)−[E(Y)]2\mathrm{Var}(Y)=E(Y^2)-[E(Y)]^2, where E(Y2)=∑[g(xi)]2piE(Y^2)=\sum[g(x_i)]^2p_i.

A constant multiple scales the variance: Var(kg(X))=k2Var(g(X))\mathrm{Var}(kg(X))=k^2\mathrm{Var}(g(X)).

For Var(5X3)\mathrm{Var}(5X^3) you need E(X6)E(X^6): Var(5X3)=25[E(X6)−(E(X3))2]\mathrm{Var}(5X^3)=25\left[E(X^6)-(E(X^3))^2\right].

05101520253035E([g(X)]²)[E(g(X))]²Var(g(X))QuantityValue
Var(X²) = E(X⁴) − [E(X²)]² = 32.5 − 24.01 = 8.49 for the same X.
  • Var(g(X))\mathrm{Var}(g(X))E([g(X)]2)−[E(g(X))]2E([g(X)]^2)-[E(g(X))]^2
  • Var(kg(X))\mathrm{Var}(kg(X))k2Var(g(X))k^2\mathrm{Var}(g(X))

Worked example

X=1,2,4X=1,2,4 with probabilities 0.4,0.4,0.20.4,0.4,0.2. Find Var(6X−1)\mathrm{Var}(6X^{-1}).

Using the example, what is Var(2X−1)\mathrm{Var}(2X^{-1})?

Building an answer

Write the distribution as a table, add rows for g(x)g(x), compute expectations, then apply the rules.

Context questions combine the rules: the area A=X2A=X^2 of a square tile with random side XX, and a cost C=0.4A+1C=0.4A+1, are functions of XX. Find the mean cost with E(aY+b)=aE(Y)+bE(aY+b)=aE(Y)+b.

Use a table method: list xx, g(x)g(x) and pp in rows so each product can be summed.

Check variance is positive; a negative value means E(Y2)E(Y^2) or E(Y)E(Y) is wrong.

  1. 1

    Write the distribution

    as a table; find unknowns from ∑p=1\sum p=1

  2. 2

    Add rows

    for g(x)g(x) and, for variance, [g(x)]2[g(x)]^2

  3. 3

    Compute expectations

    E(g(X))E(g(X)) and E([g(X)]2)E([g(X)]^2)

  4. 4

    Apply the rules

    Var=E(⋅2)−[E(⋅)]2\mathrm{Var}=E(\cdot^2)-[E(\cdot)]^2

  5. 5

    Round at the end

    keep exact values until the final answer

Method for any function of a DRV

X=1,2,3X=1,2,3 with probabilities 0.2,0.5,0.30.2,0.5,0.3, so E(X2)=4.9E(X^2)=4.9. The cost is C=0.4X2+1C=0.4X^2+1. What is E(C)E(C)?

Try an exam question

The discrete random variable XX takes the values 1,2,41,2,4 with probabilities 0.4,0.4,0.20.4,0.4,0.2. Find Var(6X)\mathrm{Var}\left(\dfrac6X\right).

[5 marks]

That's the notes covered.

Carry on to the next subtopic.

Try a question

Find E(X2)E(X^2).

1 mark, marked against the mark scheme

Revision notes