Maths4U
Menu

Maths4U Original · Learn, check, explain

Calculating E(g(X)) for a continuous random variable — 9231 FPS

Normalise a density and compute probabilities and moments by integration. Find a transformed distribution through its CDF and support.

Notes and key methods

A density f is nonnegative and integrates to one over its support. Probabilities are areas: \(P(a<X<b)=\int_a^b f(x)\,dx\). A density may be larger than 1; a probability cannot.

Use \(E(X)=\int xf(x)\,dx\), \(E(X^2)=\int x^2f(x)\,dx\) and \(\operatorname{Var}(X)=E(X^2)-E(X)^2\). A median m solves \(\displaystyle \int_{- \infty }^{m} f(x)\, dx= \frac{1}{2}\).

To find the distribution of \(\displaystyle Y=g(X)\), first determine its support and write \(F_Y(y)=P(g(X)\le y)\). On a monotone increasing branch, invert g to obtain \(F_X(g^{-1}(y))\), then differentiate.

A decreasing transformation reverses the inequality. If g is not one-to-one, collect every inverse branch that contributes. The Jacobian formula uses the absolute derivative of the inverse.

Check the conditions

Three worked examples

Example 1 · Continuous densities and moments

X has density \(f(x)=kx^{1}\) for \(0\le x\le 5\) and zero elsewhere.

Diagram for this worked example
Use the labelled scales alongside the numerical method.
  1. Find k.
  2. Find E(X).
  3. Find Var(X).
  4. Find the median of X.
Show the reasoning

(a)

\(\displaystyle k\frac{5^{2}}{2}=1\implies k=\frac{2}{25}\)

Answer: \(\displaystyle \frac{2}{25}\).

(b)

\(\displaystyle \int_0^L xf(x)\,dx=\frac{10}{3}\)

Answer: \(\displaystyle \frac{10}{3}\).

(c)

\(\displaystyle E(X^2)-E(X)^2=\frac{25}{18}\)

Answer: \(\displaystyle \frac{25}{18}\).

(d)

\(\displaystyle (\frac{m}{5})^{2}= \frac{1}{2}\implies m= 52^{- \frac{1}{2}}\)

Answer: \(3.53553390593274\).

Example 2 · Transformations of continuous variables

X has density \(\displaystyle \frac{2x}{36}\) on \(0\le x\le 6\). Define \(\displaystyle Y=X^{2}\). For \(0\le y\le 36\), \(\displaystyle F_{Y}(y)= P(X\le \sqrt{y})= \frac{y}{36}\).

  1. Find the constant density of Y on its support.
  2. Find E(Y).
  3. Find Var(Y).
  4. Find \(\displaystyle P(Y\le 1)\).
Show the reasoning

(a)

\(\displaystyle f_{Y}(y)= F_{Y}'(y)= \frac{1}{36}\)

Answer: \(\displaystyle \frac{1}{36}\).

(b)

\(\displaystyle E(Y)= \frac{36}{2}= 18\)

Answer: \(18\).

(c)

\(\displaystyle \operatorname{Var}(Y)= \frac{(36)^{2}}{12}= 108\)

Answer: \(108\).

(d)

\(\displaystyle F_{Y}(1)= \frac{1}{36}\)

Answer: \(\displaystyle \frac{1}{36}\).

Example 3 · Continuous densities and moments

X has density \(f(x)=kx^{3}\) for \(0\le x\le 2\) and zero elsewhere.

Diagram for this worked example
Use the labelled scales alongside the numerical method.
  1. Find k.
  2. Find E(X).
  3. Find Var(X).
  4. Find the median of X.
Show the reasoning

(a)

\(\displaystyle k\frac{2^{4}}{4}=1\implies k=\frac{1}{4}\)

Answer: \(\displaystyle \frac{1}{4}\).

(b)

\(\displaystyle \int_0^L xf(x)\,dx=\frac{8}{5}\)

Answer: \(\displaystyle \frac{8}{5}\).

(c)

\(\displaystyle E(X^2)-E(X)^2=\frac{8}{75}\)

Answer: \(\displaystyle \frac{8}{75}\).

(d)

\(\displaystyle (\frac{m}{2})^{4}= \frac{1}{2}\implies m= 22^{- \frac{1}{4}}\)

Answer: \(1.68179283050743\).

Common mistakes

Practise with answer checking

Original exam-style problems

Write complete solutions before opening the worked solution. The marking guidance rewards reasoning as well as answers.

Examination practice · 2020–2026

Apply the method to recent source-labelled questions from this chapter.

Browse recent examination questions · All topic resources and the full bank

Next skill: Finding the probability density function and cumulative distribution function of Y = g(X) →