Data and random variables
Classify random variables as discrete or continuous, construct frequency and cumulative relative frequency tables, and use relative frequency as an estimate of probability.
Worked examples
Classifying a variable and constructing a frequency table
Straightforward
Problem
The scores for 15 students on a maths quiz (out of 5) are listed below.
(a) Is quiz score a discrete or continuous variable? Give a reason.
(b) Construct a frequency table showing the frequency and relative frequency of each score.
(a) Is quiz score a discrete or continuous variable? Give a reason.
(b) Construct a frequency table showing the frequency and relative frequency of each score.
1
Decide whether quiz score is discrete or continuous.
Quiz scores can only be the whole numbers 0, 1, 2, 3, 4 or 5 — they cannot take values such as 3.7. They are counted, not measured. Therefore quiz score is a discrete variable.
2
Tally the frequency of each score from the list.
3
Divide each frequency by the total (15) to find the relative frequency.
| Score | Frequency | Relative frequency |
|---|---|---|
| 2 | 2 | |
| 3 | 5 | |
| 4 | 4 | |
| 5 | 4 | |
|---|---|---|
| 2 | 2 | |
| 3 | 5 | |
| 4 | 4 | |
| 5 | 4 | |
Answer
(a) Discrete, because scores can only take whole-number values and are counted, not measured. (b) See table above: relative frequencies are , , and for scores 2, 3, 4 and 5 respectively.
Reading the median and quartiles from a cumulative relative frequency table
Moderate
Problem
Twenty-five students recorded the number of hours they spent studying in a week. The results are in the frequency table below.
| Hours | Frequency |
|---|---|
| 0 | 2 |
| 1 | 5 |
| 2 | 8 |
| 3 | 6 |
| 4 | 4 |
(a) Complete the relative frequency and cumulative relative frequency columns.
(b) Estimate the median.
(c) Estimate the lower quartile .
| Hours | Frequency |
|---|---|
| 0 | 2 |
| 1 | 5 |
| 2 | 8 |
| 3 | 6 |
| 4 | 4 |
(a) Complete the relative frequency and cumulative relative frequency columns.
(b) Estimate the median.
(c) Estimate the lower quartile .
1
Calculate the relative frequency for each row by dividing by the total of 25.
2
Build the cumulative relative frequency column by accumulating the relative frequencies.
| Hours | Frequency | Relative frequency | Cumulative relative frequency |
|---|---|---|---|
| 0 | 2 | 0.08 | 0.08 |
| 1 | 5 | 0.20 | 0.28 |
| 2 | 8 | 0.32 | 0.60 |
| 3 | 6 | 0.24 | 0.84 |
| 4 | 4 | 0.16 | 1.00 |
|---|---|---|---|
| 0 | 2 | 0.08 | 0.08 |
| 1 | 5 | 0.20 | 0.28 |
| 2 | 8 | 0.32 | 0.60 |
| 3 | 6 | 0.24 | 0.84 |
| 4 | 4 | 0.16 | 1.00 |
3
Estimate the median: find the first value at which the cumulative relative frequency reaches or exceeds 0.50.
At : cumulative relative frequency .
At : cumulative relative frequency .
The median is hours.
At : cumulative relative frequency .
The median is hours.
4
Estimate : find the first value at which the cumulative relative frequency reaches or exceeds 0.25.
At : cumulative relative frequency .
At : cumulative relative frequency .
So hour.
At : cumulative relative frequency .
So hour.
Answer
(a) See table in step 2. (b) Median hours. (c) hour.
Using relative frequency as a probability estimate
Challenging
Problem
A fair six-sided die is rolled 90 times. The frequency of each face is shown in the table.
| Face | 1 | 2 | 3 | 4 | 5 | 6 |
|---|---|---|---|---|---|---|
| Frequency | 17 | 14 | 16 | 13 | 15 | 15 |
(a) Find the relative frequency of rolling an even number.
(b) The theoretical probability of rolling an even number on a fair die is . Compare this with the relative frequency from part (a) and explain any discrepancy.
| Face | 1 | 2 | 3 | 4 | 5 | 6 |
|---|---|---|---|---|---|---|
| Frequency | 17 | 14 | 16 | 13 | 15 | 15 |
(a) Find the relative frequency of rolling an even number.
(b) The theoretical probability of rolling an even number on a fair die is . Compare this with the relative frequency from part (a) and explain any discrepancy.
1
Identify the even-numbered faces and sum their frequencies.
Even faces: 2, 4 and 6.
2
Divide by the total number of rolls to find the relative frequency.
3
Compare the relative frequency to the theoretical probability and explain the difference.
Theoretical probability: .
Relative frequency: .
The discrepancy of approximately 0.033 is expected. With only 90 trials, random variation causes the relative frequency to differ from the theoretical value. With a much larger number of rolls, the relative frequency would be expected to converge to .
Relative frequency: .
The discrepancy of approximately 0.033 is expected. With only 90 trials, random variation causes the relative frequency to differ from the theoretical value. With a much larger number of rolls, the relative frequency would be expected to converge to .
Answer
(a) . (b) The relative frequency (0.467) is close to but not equal to the theoretical probability (0.500). This is expected with 90 trials — random variation in a finite sample causes the relative frequency to differ from the theoretical value; larger samples produce closer agreement.
Practise
Q1·Straightforward
Which of the following is a discrete random variable?
Explanation
The number of cars is a count and can only take non-negative integer values (0, 1, 2, 3, ...), so it is a discrete random variable. Height, time and volume are measured quantities that can take any value in a range, making them continuous.
Q2·Straightforward
Which of the following is a continuous random variable?
Explanation
Mass is a measured quantity that can take any value within a range (e.g. 0.142 kg, 0.1423 kg), so it is continuous. Goals, absent students and text messages are all counts and can only take non-negative integer values, making them discrete.
Q3·Straightforward
The number of siblings reported by 10 students is listed below.
How many students reported having 2 siblings?
How many students reported having 2 siblings?
Explanation
Going through the list: . The value 2 appears at positions 2, 4 and 7 — a total of 3 times.
Q4·Straightforward
The number of siblings reported by 10 students is listed below.
Express the relative frequency of reporting 0 siblings as a fraction in simplest form.
Express the relative frequency of reporting 0 siblings as a fraction in simplest form.
/
Explanation
The value 0 appears at positions 1, 5 and 9 — a total of 3 times out of 10 students. The relative frequency is , which is already in simplest form.
Q5·Moderate
The number of books read last month by 25 students is summarised in the table below.
| Books | Frequency | Relative frequency | Cumulative relative frequency |
|---|---|---|---|
| 0 | 3 | 0.12 | 0.12 |
| 1 | 7 | 0.28 | 0.40 |
| 2 | 9 | 0.36 | 0.76 |
| 3 | 4 | 0.16 | 0.92 |
| 4 | 2 | 0.08 | 1.00 |
What is the cumulative relative frequency for 2 books or fewer?
| Books | Frequency | Relative frequency | Cumulative relative frequency |
|---|---|---|---|
| 0 | 3 | 0.12 | 0.12 |
| 1 | 7 | 0.28 | 0.40 |
| 2 | 9 | 0.36 | 0.76 |
| 3 | 4 | 0.16 | 0.92 |
| 4 | 2 | 0.08 | 1.00 |
What is the cumulative relative frequency for 2 books or fewer?
Explanation
The cumulative relative frequency for 2 books or fewer is . This means 76% of students read 2 or fewer books.
Q6·Moderate
The number of books read last month by 25 students is summarised in the table below.
| Books | Frequency | Relative frequency | Cumulative relative frequency |
|---|---|---|---|
| 0 | 3 | 0.12 | 0.12 |
| 1 | 7 | 0.28 | 0.40 |
| 2 | 9 | 0.36 | 0.76 |
| 3 | 4 | 0.16 | 0.92 |
| 4 | 2 | 0.08 | 1.00 |
Using the cumulative relative frequency, estimate the median number of books read. The median is the first value at which the cumulative relative frequency reaches or exceeds 0.50.
| Books | Frequency | Relative frequency | Cumulative relative frequency |
|---|---|---|---|
| 0 | 3 | 0.12 | 0.12 |
| 1 | 7 | 0.28 | 0.40 |
| 2 | 9 | 0.36 | 0.76 |
| 3 | 4 | 0.16 | 0.92 |
| 4 | 2 | 0.08 | 1.00 |
Using the cumulative relative frequency, estimate the median number of books read. The median is the first value at which the cumulative relative frequency reaches or exceeds 0.50.
Explanation
The cumulative relative frequency is 0.40 at 1 book (below 0.50) and 0.76 at 2 books (at or above 0.50). The median is therefore estimated as 2 books.
Q7·Moderate
Twenty students sat a quiz scored out of 5. Their scores are summarised below.
| Score | Frequency | Relative frequency | Cumulative relative frequency |
|---|---|---|---|
| 1 | 2 | 0.10 | 0.10 |
| 2 | 4 | 0.20 | 0.30 |
| 3 | 8 | 0.40 | 0.70 |
| 4 | 5 | 0.25 | 0.95 |
| 5 | 1 | 0.05 | 1.00 |
Estimate the lower quartile . The lower quartile is the first value at which the cumulative relative frequency reaches or exceeds 0.25.
| Score | Frequency | Relative frequency | Cumulative relative frequency |
|---|---|---|---|
| 1 | 2 | 0.10 | 0.10 |
| 2 | 4 | 0.20 | 0.30 |
| 3 | 8 | 0.40 | 0.70 |
| 4 | 5 | 0.25 | 0.95 |
| 5 | 1 | 0.05 | 1.00 |
Estimate the lower quartile . The lower quartile is the first value at which the cumulative relative frequency reaches or exceeds 0.25.
Explanation
The cumulative relative frequency is 0.10 at score 1 (below 0.25) and 0.30 at score 2 (at or above 0.25). So .
Q8·Moderate
Twenty students sat a quiz scored out of 5. Their scores are summarised below.
| Score | Frequency | Relative frequency | Cumulative relative frequency |
|---|---|---|---|
| 1 | 2 | 0.10 | 0.10 |
| 2 | 4 | 0.20 | 0.30 |
| 3 | 8 | 0.40 | 0.70 |
| 4 | 5 | 0.25 | 0.95 |
| 5 | 1 | 0.05 | 1.00 |
Estimate the upper quartile . The upper quartile is the first value at which the cumulative relative frequency reaches or exceeds 0.75.
| Score | Frequency | Relative frequency | Cumulative relative frequency |
|---|---|---|---|
| 1 | 2 | 0.10 | 0.10 |
| 2 | 4 | 0.20 | 0.30 |
| 3 | 8 | 0.40 | 0.70 |
| 4 | 5 | 0.25 | 0.95 |
| 5 | 1 | 0.05 | 1.00 |
Estimate the upper quartile . The upper quartile is the first value at which the cumulative relative frequency reaches or exceeds 0.75.
Explanation
The cumulative relative frequency is 0.70 at score 3 (below 0.75) and 0.95 at score 4 (at or above 0.75). So .
Q9·Challenging
A four-sector spinner labelled 1, 2, 3 and 4 is spun 80 times. Sector 3 lands face up 16 times. Using relative frequency as an estimate of probability, find from this experiment. Give your answer as a fraction in simplest form.
/
Explanation
The relative frequency estimate is . This is used as an estimate for the probability of landing on sector 3 based on this experiment.
Q10·Challenging
For a fair four-sector spinner, the theoretical probability of landing on any one sector is . In 80 spins, sector 3 appeared 16 times, giving a relative frequency of . Which statement best explains the discrepancy between these two values?
Explanation
A discrepancy between relative frequency and theoretical probability is expected with a small sample. As the number of trials increases, the relative frequency tends to approach the theoretical probability. A single experiment with 80 trials is not sufficient to conclude that the spinner is biased.
Q11·Challenging
A factory tests 150 light bulbs from a production run and finds 9 defective bulbs. Use relative frequency to estimate the probability that a randomly selected bulb from this production run is defective. Give your answer as a fraction in simplest form.
/
Explanation
The relative frequency estimate is . This serves as an estimate of the probability that a randomly selected bulb is defective.
Q12·Challenging
A fair die is rolled in two experiments.
- Experiment A: 30 rolls, a 6 appears 3 times. Relative frequency .
- Experiment B: 300 rolls, a 6 appears 42 times. Relative frequency .
The theoretical probability of rolling a 6 is . Which experiment gives a relative frequency closer to the theoretical probability?
- Experiment A: 30 rolls, a 6 appears 3 times. Relative frequency .
- Experiment B: 300 rolls, a 6 appears 42 times. Relative frequency .
The theoretical probability of rolling a 6 is . Which experiment gives a relative frequency closer to the theoretical probability?
Explanation
The deviation of Experiment A from the theoretical probability is . The deviation of Experiment B is . Experiment B is closer. A larger sample generally produces a relative frequency closer to the theoretical probability.