IB Mathematics: Analysis and Approaches · Topic 4 · Statistics and probability
4.14 Continuous random variables
Describe a continuous random variable by its density function, find probabilities as areas, and calculate its mean, mode, median and variance.
1/5A continuous random variable can take any value in an interval
Part 1 of 5: A continuous random variable can take any value in an interval
A bus may arrive at any moment in a ten-minute window. The waiting time is not limited to whole numbers, so it can take any value in an interval. Such a quantity is a continuous random variable.
There are infinitely many possible values, so we cannot list them with probabilities. Probability is described over ranges instead. For a continuous variable, for every single value . Strict and non-strict inequalities therefore give the same probability, so . Every question about a continuous variable concerns an interval.
Key term
continuous random variable
A continuous random variable is a random variable that can take any value in an interval of real numbers.
Part 2 of 5: A density function turns probability into area
Single values carry no probability, so a curve describes the distribution instead. The curve is the probability density function, written . The probability that lies between and is the area under the curve between them: .
Two conditions make valid. First, for all , because a negative height would give a negative probability. Second, the total area is 1, so .
Worked example
Finding k and a probability
- The total area must be 1: .
- , so .
- .
- .
Answer: and .
Key term
probability density function
A probability density function is a function with total area 1, whose area between and gives .

Quick check
One question on the part you just read
Easy
Show answer and explanation
Answer: B · Worked explanation
Part 3 of 5: The expected value is a weighted integral of x
Next we describe the centre of the distribution. For a discrete variable the mean is a sum of each value times its probability. For a continuous variable the sum becomes an integral, because the values are spread along a line.
The expected value is . In practice, integrate only where is not zero. It is the long-run average of many observations, and it need not be a likely value. Its value always lies between the smallest and largest possible values of .
Worked example
Expected value for the density f(x) = x/8
- .
- .
- .
Answer: .
Notice that the mean lies closer to the end where the density is larger. It is the balance point of the area.
Key term
expected value
The expected value of a continuous random variable is , taken over all values of .
Part 4 of 5: Variance measures spread through squared distances
The mean says where the distribution is centred. It does not say how far values spread out. The variance is defined as . A more convenient form is .
Find by integrating over the interval. Then subtract the square of the mean. The standard deviation is the square root of the variance, and it has the same units as . Variance is never negative, because it averages squared distances. A larger variance means a wider spread of values.
Worked example
Variance for the density f(x) = x/8
- .
- .
- .
Answer: .
Key term
variance
The variance of a random variable is , and it measures spread in squared units of .

Quick check
One question on the part you just read
Easy
Show answer and explanation
Answer: C · Worked explanation
Part 5 of 5: Mode and median come from the curve and its area
Two more measures of centre use the curve itself. The mode is the value of where is greatest. Look for a turning point where , and also compare the values at the ends of the interval.
The median splits the area into two equal halves. Solve , starting the integral where begins.
Worked example
Mode and median for the density f(x) = x/8
- increases across the interval, so its greatest value is at .
- Median: .
- So and .
Answer: The mode is 4 and the median is .
Here the mean lies below the median , which lies below the mode 4. The long tail on the left pulls the mean down. A long tail on the right would reverse this order.
Key terms · tap one for its definition
mode
The mode of a continuous random variable is the value of at which takes its greatest value.
median
The median of a continuous random variable is the value for which , so half the area lies below it.
Check your recall[14 marks]
6 written questions. Answer each one in your head or on paper, then open the mark scheme.
- 1.State[2 marks]
State the two conditions that a function must satisfy to be a probability density function.
Show mark schemeHide mark scheme
Model answer
for all , and the total area under the curve is 1, so .
- 1 mark for stating that for all
- 1 mark for stating that the total area under the curve (the integral over all ) equals 1
- 2.Calculate[2 marks]
Calculate for a continuous random variable with for , and otherwise.
Show mark schemeHide mark scheme
Model answer
, so .
- 1 mark for setting and integrating to obtain
- 1 mark for obtaining
- 3.Calculate[2 marks]
Calculate for a continuous random variable with for , and otherwise.
Show mark schemeHide mark scheme
Model answer
.
- 1 mark for setting up with the correct limits
- 1 mark for obtaining
- 4.Determine[3 marks]
Determine for a continuous random variable with for , and otherwise.
Show mark schemeHide mark scheme
Model answer
.
- 1 mark for setting up
- 1 mark for integrating to obtain
- 1 mark for obtaining
- 5.Explain[2 marks]
Explain why for a continuous random variable .
Show mark schemeHide mark scheme
Model answer
Probability is the area under the density curve. A single value has no width, so the area above it is zero.
- 1 mark for stating that probability is area under the density curve
- 1 mark for explaining that a single value has zero width, so zero area
- 6.Determine[3 marks]
Determine the median of a continuous random variable with for , and otherwise.
Show mark schemeHide mark scheme
Model answer
, so .
- 1 mark for setting
- 1 mark for obtaining
- 1 mark for obtaining

Practice this topic
10 quick-fire multiple-choice questions, easy to hard. Tap an answer to see if you're right and the worked explanation. (The written questions with mark schemes are under “Check your recall” above.)
0 right0 of 10 answered
Includes the 2 quick checks in the note above.
EasyState[1 mark]
Show answer and explanation
Answer: B · Worked explanation
MediumCalculate[2 marks]
Show answer and explanation
Answer: B · Worked explanation
MediumCalculate[2 marks]
Show answer and explanation
Answer: B · Worked explanation
MediumCalculate[2 marks]
Show answer and explanation
Answer: B · Worked explanation
MediumCalculate[2 marks]
Show answer and explanation
Answer: B · Worked explanation
HardDetermine[2 marks]
Show answer and explanation
Answer: B · Worked explanation
HardDetermine[2 marks]
Show answer and explanation
Answer: B · Worked explanation
HardCalculate[2 marks]
Show answer and explanation
Answer: A · Worked explanation