# Continuous Random Variables (Edexcel IAL Maths S2)

> Mathematics · Edexcel IAL S2
> Source: https://www.owlsprep.com/study/edexcel-ial-math-s2-continuous-random-variables/

This guide covers all core content for continuous random variables in Edexcel IAL Maths S2, including pdf/CDF manipulation, mean, variance, median, mode and quartile calculation for polynomial and piecewise functions.

**Prerequisites:** [Integration of polynomial functions](https://www.owlsprep.com/study/edexcel-ial-math-p1-integration-polynomials/); [Basic differentiation rules](https://www.owlsprep.com/study/edexcel-ial-math-p1-differentiation/); [Basic probability concepts from S1](https://www.owlsprep.com/study/edexcel-ial-math-s1-probability-basics/)

## Learning objectives

- Define a continuous random variable and distinguish it from discrete random variables
- Interpret and manipulate probability density functions (pdfs) and cumulative distribution functions (CDFs)
- Use the relationship between pdf and CDF via integration and differentiation
- Calculate mean, variance, and expectation of linear functions of continuous random variables
- Find mode, median, quartiles and percentiles for continuous distributions with polynomial or piecewise pdfs

## Definition and Core Properties of Continuous Random Variables

**Continuous Random Variable (CRV)** — A random variable that can take any value within a continuous range of possible outcomes, rather than discrete separate values. Probabilities are calculated as areas under its probability density function.

Unlike discrete random variables (covered in S1), the probability that a continuous random variable $X$ takes a single exact value $P(X=a)$ is always 0, so $P(a < X < b) = P(a \leq X \leq b) = P(a < X \leq b) = P(a \leq X < b)$ for all $a < b$.

> **note**
>
> You will only encounter pdfs that are simple polynomials, or piecewise combinations of polynomials, in this unit. Non-polynomial functions like exponential distributions are out of scope for Edexcel IAL S2.

**Worked example:** State whether each of the following is a valid continuous random variable: (a) The height of a randomly selected 17-year-old student, (b) The number of heads obtained when flipping a fair coin 10 times, (c) The time taken for a runner to complete a 5km race.

1. (a) Height can take any value in a continuous range (e.g., 165.3cm, 165.34cm) so this is a CRV.
2. (b) The number of heads can only take integer values (0 to 10), so this is a discrete random variable, not continuous.
3. (c) Race time can take any positive real value, so this is a CRV.

> **Exam tip:** If an exam question asks for $P(X=k)$ for a CRV, you can immediately write 0 as your answer with no calculation required.

## Probability Density Functions (pdf) and Cumulative Distribution Functions (CDF)

**Probability Density Function (pdf, $f(x)$)** — The function used to calculate probabilities for a continuous random variable. It satisfies two key conditions: 1. $f(x) \geq 0$ for all real $x$, 2. The total area under the curve over all real $x$ is equal to 1: $\int_{-\infty}^{+\infty} f(x) dx = 1$.

Probabilities for intervals are calculated as the integral of the pdf over that interval: $P(a < X \leq b) = \int_a^b f(x) dx$.

**Cumulative Distribution Function (CDF, $F(x)$)** — The function that gives the probability that $X$ takes a value less than or equal to $x_0$: $F(x_0) = P(X \leq x_0) = \int_{-\infty}^{x_0} f(t) dt$. It is a non-decreasing function with $F(-\infty)=0$ and $F(+\infty)=1$.

The pdf and CDF are directly related by differentiation: $f(x) = \frac{dF(x)}{dx}$. This relationship lets you convert between the two representations as needed.

**Worked example:** A continuous random variable $X$ has pdf $f(x) = \begin{cases} kx(2-x) & 0 \leq x \leq 2 \\ 0 & \text{otherwise} \end{cases}$. (a) Find the value of constant $k$. (b) Calculate $P(0.5 < X < 1.5)$. (c) Find the CDF $F(x)$.

1. (a) Use the total area condition for pdfs:
2. $$\int_0^2 kx(2-x) dx = k \int_0^2 (2x - x^2) dx = k \left[ x^2 - \frac{x^3}{3} \right]_0^2 = k \left(4 - \frac{8}{3}\right) = k \cdot \frac{4}{3} = 1$$
3. Solve for $k$: $k = \frac{3}{4}$.
4. (b) Integrate the pdf over the interval [0.5, 1.5]:
5. $$P(0.5 < X < 1.5) = \frac{3}{4} \int_{0.5}^{1.5} (2x - x^2) dx = \frac{3}{4} \left[ x^2 - \frac{x^3}{3} \right]_{0.5}^{1.5}$$
6. $$= \frac{3}{4} \left( \left(2.25 - 1.125\right) - \left(0.25 - 0.0417\right) \right) = \frac{3}{4} \times 0.9167 = 0.6875 = \frac{11}{16}$$
7. (c) Split the CDF into three intervals: <0, 0≤x≤2, >2. For $x < 0$, $F(x)=0$. For $x>2$, $F(x)=1$. For $0 \leq x \leq 2$:
8. $$F(x) = \frac{3}{4} \int_0^x (2t - t^2) dt = \frac{3}{4} \left[ t^2 - \frac{t^3}{3} \right]_0^x = \frac{3x^2 - x^3}{4}$$
9. Final CDF: $F(x) = \begin{cases} 0 & x < 0 \\ \frac{3x^2 - x^3}{4} & 0 \leq x \leq 2 \\ 1 & x > 2 \end{cases}$

> **Exam tip:** Always check that your CDF is continuous at the boundaries of piecewise intervals. Discontinuities in your CDF indicate an integration error, and you will lose marks for this in exams.

*Calculator:* allowed

## Mean and Variance of Continuous Random Variables

The expectation (mean) and variance of a CRV are calculated using formulae given in your formula booklet, using integration of the pdf. The formula for variance uses the result $Var(X) = E(X^2) - [E(X)]^2$, the same as for discrete random variables.

**Expectation and Variance for CRVs** — Mean: $\mu = E(X) = \int_{-\infty}^{+\infty} x f(x) dx$. Expectation of a function of $X$: $E(g(X)) = \int_{-\infty}^{+\infty} g(x) f(x) dx$. Variance: $\sigma^2 = Var(X) = E(X^2) - (E(X))^2 = \int_{-\infty}^{+\infty} x^2 f(x) dx - \mu^2$.

**Worked example:** Using the pdf from the previous worked example ($f(x) = \frac{3}{4}x(2-x)$ for $0 \leq x \leq 2$), calculate (a) $E(X)$, (b) $E(3X + 2)$, (c) $Var(X)$.

1. (a) Calculate E(X):
2. $$E(X) = \int_0^2 x \cdot \frac{3}{4}(2x - x^2) dx = \frac{3}{4} \int_0^2 (2x^2 - x^3) dx = \frac{3}{4} \left[ \frac{2x^3}{3} - \frac{x^4}{4} \right]_0^2$$
3. $$= \frac{3}{4} \left( \frac{16}{3} - 4 \right) = \frac{3}{4} \times \frac{4}{3} = 1$$
4. (b) Use linearity of expectation: $E(aX + b) = aE(X) + b$. So $E(3X + 2) = 3E(X) + 2 = 3(1) + 2 = 5$.
5. (c) First calculate E(X²):
6. $$E(X^2) = \int_0^2 x^2 \cdot \frac{3}{4}(2x - x^2) dx = \frac{3}{4} \int_0^2 (2x^3 - x^4) dx = \frac{3}{4} \left[ \frac{x^4}{2} - \frac{x^5}{5} \right]_0^2$$
7. $$= \frac{3}{4} \left( 8 - 6.4 \right) = \frac{3}{4} \times 1.6 = 1.2 = \frac{6}{5}$$
8. Then Var(X) = E(X²) - [E(X)]² = $\frac{6}{5} - 1^2 = \frac{1}{5} = 0.2$

> **Exam tip:** Linearity of expectation works for all linear combinations of random variables, so you do not need to re-integrate for functions like $E(2X + 5)$: use the rule to save time in exams.

*Calculator:* allowed

## Mode, Median and Quartiles

Measures of location for CRVs include mode, median and quartiles, each calculated using different rules from the pdf or CDF as detailed below.

**Measures of Location for CRVs** — Mode: The value of $x$ where $f(x)$ takes its maximum value. Median: The value $m$ such that $F(m) = 0.5$. Lower quartile $Q_1$: $F(Q_1) = 0.25$. Upper quartile $Q_3$: $F(Q_3) = 0.75$. Any percentile $p$ is the value $x_p$ such that $F(x_p) = p/100$.

> **tip**
>
> To find the mode, first check if the pdf is increasing/decreasing over its domain: if it is, the mode will be at the boundary of the interval. For quadratic or higher functions, find the stationary point by differentiating $f(x)$ and setting the derivative to zero, then confirm it is a maximum.

**Worked example:** Using the same pdf and CDF as the previous examples, find (a) the mode of $X$, (b) the median of $X$, (c) the upper quartile $Q_3$.

1. (a) Find the maximum of $f(x) = \frac{3}{4}(2x - x^2)$ for $0 \leq x \leq 2$. Differentiate $f(x)$ with respect to $x$:
2. $$f'(x) = \frac{3}{4}(2 - 2x) = \frac{3}{2}(1 - x)$$
3. Set derivative equal to zero: $1 - x = 0 \implies x = 1$. Check second derivative is negative (confirm maximum): $f''(x) = -\frac{3}{2} < 0$. So mode = 1.
4. (b) Median $m$ satisfies $F(m) = 0.5$. Use the CDF from earlier:
5. $$\frac{3m^2 - m^3}{4} = 0.5 \implies 3m^2 - m^3 = 2 \implies m^3 - 3m^2 + 2 = 0$$
6. Factor the cubic: $m=1$ is a root, so factorize to $(m - 1)(m^2 - 2m - 2) = 0$. Only $m=1$ lies in [0,2], so median = 1.
7. (c) Upper quartile $Q_3$ satisfies $F(Q_3) = 0.75$:
8. $$\frac{3Q_3^2 - Q_3^3}{4} = 0.75 \implies 3Q_3^2 - Q_3^3 = 3 \implies Q_3^3 - 3Q_3^2 + 3 = 0$$
9. Solve numerically (calculator permitted): $Q_3 \approx 1.35$ (2 decimal places).

> **Exam tip:** When solving cubics for median/quartiles, first test integer values in the domain of the distribution, as these are often roots. If not, use trial and improvement or your calculator's equation solver for the required accuracy.

*Calculator:* allowed

## Common pitfalls

- **Wrong:** Assuming pdf values cannot be greater than 1, treating them as direct probabilities
  - Why it fails: Pdfs measure density, not probability. Only the total area under the pdf equals 1, individual points can have values >1 for narrow distributions.
  - Correct: Validate pdfs by checking total area under the curve equals 1, not individual $f(x)$ values.
- **Wrong:** Forgetting to add cumulative probability from earlier intervals when calculating CDF for piecewise pdfs
  - Why it fails: The CDF accumulates all probability left of $x$, so skipping previous intervals leads to a discontinuous, incorrect CDF.
  - Correct: For piecewise pdfs, calculate $F(x)$ as the sum of total area of all left intervals plus the integral over the current interval to $x$.
- **Wrong:** Calculating variance as $E(X^2)$ instead of $E(X^2) - (E(X))^2$
  - Why it fails: Variance measures spread around the mean, so subtracting the squared mean is required to get the correct value.
  - Correct: Write the full variance formula before substituting values to avoid missing the subtraction step.
- **Wrong:** Setting $f(m) = 0.5$ to find the median, using the pdf instead of the CDF
  - Why it fails: The median is the point with 50% cumulative probability below it, which is defined by the CDF, not the pdf height.
  - Correct: Always use the CDF for median, quartiles and percentiles, setting $F(x) = p$ for the required cumulative probability $p$.
- **Wrong:** Calculating $P(X=a)$ for a CRV as a non-zero value
  - Why it fails: Continuous random variables have infinitely many possible outcomes, so the probability of any single exact value is zero.
  - Correct: Immediately answer 0 for any $P(X=a)$ question for a CRV, and ignore equality signs when calculating interval probabilities.

## Cheatsheet

| Quantity | Formula | Key Notes |
| --- | --- | --- |
| $P(a < X \leq b)$ | $\int_a^b f(x) dx$ | Equal to $F(b) - F(a)$ |
| CDF $F(x)$ | $\int_{-\infty}^x f(t) dt$ | $F(-\infty)=0$, $F(+\infty)=1$, non-decreasing |
| Pdf from CDF | $f(x) = \frac{dF(x)}{dx}$ | Differentiate each interval for piecewise CDFs |
| Mean $E(X)$ | $\int x f(x) dx$ | $E(aX + b) = aE(X) + b$ |
| Variance $Var(X)$ | $\int x^2 f(x) dx - (E(X))^2$ | Given in formula booklet |
| Mode | Max of $f(x)$ | Check boundaries and stationary points |
| Median $m$ | $F(m) = 0.5$ | Solve using CDF |
| Quartiles | $F(Q_1)=0.25$, $F(Q_3)=0.75$ | Use numerical methods if needed |

## What's next

Now that you have mastered continuous random variables, you are ready to move on to named continuous distributions, starting with the continuous uniform (rectangular) distribution, the next core topic in Edexcel IAL S2. You will apply all the skills you learned here (pdf/CDF manipulation, mean, variance, median and mode calculation) to this standardized distribution, before moving on to hypothesis testing and sampling distributions later in the unit. Make sure you practice a range of past exam questions on this topic, as it is frequently tested as a standalone 8-12 mark question, and often combined with other S2 topics in later sections of the exam. Pay special attention to piecewise functions, as these appear in over 70% of CRV questions on Edexcel IAL S2 papers.

---

From [OwlsPrep](https://www.owlsprep.com) — free study guides for A-Level, IB, AP and IGCSE, written against the official syllabus. Canonical page: https://www.owlsprep.com/study/edexcel-ial-math-s2-continuous-random-variables/
