Continuous random variables
Random variables that can take any value in an interval, described by a probability density function. Probabilities as areas, and the mean, variance, median and mode found by integration.
1What you need to know
Tick these off as you go. By the end of the page you should be able to do all of them without notes.
- Explain what a probability density function (pdf) is, and why AHL 4.14
- Use to find an unknown constantAHL 4.14
- Find probabilities as areas under the pdfAHL 4.14
- Find the mode, the median and the mean of a continuous random variableAHL 4.14
- Find the variance, and use and AHL 4.14
- Work with piecewise pdfsAHL 4.14
2Notes & worked examples
Each idea is followed by a worked example. Try the question yourself first, then reveal the solution one step at a time.
A discrete random variable lists its values and their probabilities, and . A continuous random variable, such as a time or a length, can take any value in an interval, so it cannot list them. Instead it has a probability density function : probabilities are areas under the graph of . Every formula from discrete random variables carries over, with replaced by .
2.1 The probability density function
A function is a pdf on an interval if two things are true:
Then , and outside .
Because a single point has no width, for every . So for a continuous random variable and are the same. Note also that itself is not a probability, and can be bigger than 1: only areas are probabilities.
2.2 Mode and median
The mode is the value of where is greatest. Find it as you would any maximum: solve , but also check the endpoints, because the maximum is often at the end of the interval.
The median splits the area in half:
2.3 Mean and variance
The second form of the variance is almost always easier: find , then subtract the square of the mean. This is the same "mean of the squares minus the square of the mean" as for discrete variables.
2.4 Linear transformations
If , every value is stretched by and shifted by . The shift moves the mean but does not change the spread.
2.5 Piecewise pdfs
Some pdfs are defined by different formulas on different parts of the interval. Split every integral at the joins and add the pieces.
| Discrete | Continuous | |
|---|---|---|
| Total probability | ||
| Mean | ||
| Mode | most likely value | where is greatest |
| can be positive | always 0 |
On Paper 2, integrate numerically: menu → Calculus → Numerical integral, e.g. . For a median, use nSolve on with as the variable, or graph and intersect with . For the mode, use Analyze Graph → Maximum, and remember to compare with the endpoints.
3Explore it
Choose a pdf and drag the endpoints: the shaded area is . The dashed lines mark the mean (navy) and the median (green).
4Common mistakes & exam tips
Common mistakes
- Treating as a probability. Only areas under are probabilities.
- Finding the mode with only, and missing a maximum at an endpoint.
- Forgetting to subtract when finding the variance from .
- Writing . The disappears and is squared.
- For a piecewise pdf, integrating one formula over the whole interval instead of splitting at the join.
Exam tips
- Always find any unknown constant first: every later part depends on it.
- On Paper 1 expand brackets before integrating; on Paper 2 integrate numerically and keep full accuracy.
- A quick sketch of the pdf tells you where the mode is, roughly where the median is, and whether the mean is left or right of it.
- For a median on Paper 2, set up clearly before solving with the GDC: the equation earns the method mark.
5Practice
Fluency questions build the basics. Problem-solving questions make you think about which method to use.
6Exam-style questions
Original questions in the style of the IB exam, with full markschemes. Give yourself about 1 minute per mark.
A continuous random variable has probability density function for , and otherwise.
- (a)Show that .[2]
- (b)Find .[2]
- (c)Find .[3]
- (d)Show that .[3]
- (e)Find .[2]
| (a) | |
| M1 | |
| A1 | |
| AG | |
| (b) | |
| M1 | |
| A1 | |
| (c) | |
| M1 | |
| A1 | |
| A1 | |
| (d) | |
| M1A1 | |
| A1AG | |
| (e) | |
| M1 | |
| A1 | |
For the random variable in the previous question, with , :
- (a)Find the median of .[3]
- (b)Write down the mode of .[1]
| (a) | |
| M1 | |
| or GDC | (M1) |
| A1 | |
| (b) | |
| (since is decreasing on ) | A1 |
The time, hours, that a machine runs before it needs a reset is modelled by the probability density function for , and otherwise.
- (a)Find the value of .[2]
- (b)Find the mode of .[2]
- (c)Find .[2]
- (d)Find the median of .[2]
- (e)Find .[1]
| (a) | |
| M1 | |
| (1.24867…) | A1 |
| (b) | |
| or GDC maximum | M1 |
| A1 | |
| (c) | |
| M1 | |
| A1 | |
| (d) | |
| M1 | |
| A1 | |
| (e) | |
| A1 | |
7Check yourself
Six quick questions, marked instantly. Aim for 6/6 before moving on. Fractions like 3/2 are accepted.
8Past-paper practice
Once you're scoring well above, try real IB questions. Your school or teacher will have these papers.
| Paper | Question | Focus | Difficulty |
|---|---|---|---|
| May 2022 · TZ1 · Paper 1 | Q7 | Finding for a pdf involving , then a probability | ★★★ |
| May 2023 · TZ2 · Paper 1 | Q6 | A constant pdf on : mean and variance in terms of | ★★ |
| May 2024 · TZ1 · Paper 2 | Q8 | A piecewise pdf with an unknown constant | ★★ |
| Nov 2021 · Paper 2 | Q7 | Median, and | ★★★ |
| Nov 2025 · TZ1 · Paper 2 | Q11 | Finding | ★★★ |
