Random variables and frequency tables
Categorical, discrete and continuous variables, frequency and relative frequency tables, relative frequency as an estimate of probability, histograms and polygons, and the mode.
Probability in chapter 14 started from equally likely outcomes. Most real questions don't have them: how many goals will the team score, how tall is a randomly chosen student? Data answers these. A frequency table is the first step in turning a pile of results into a probability you can use.
Three types of variable
The quantity being recorded is a random variable, usually called $X$. Before drawing anything, decide which type it is.
| Type | How you get a value | Examples |
|---|---|---|
| Categorical | Choose a label | Favourite sport, eye colour, postcode |
| Discrete numerical | Count | Goals scored, number of siblings |
| Continuous numerical | Measure | Height, time, mass |
A quick test: if a value of $2.5$ makes sense, the variable is continuous. Half a goal makes no sense, so goals are discrete.
Frequency and relative frequency
A soccer team recorded the number of goals it scored in each of its $25$ games.
| Goals $x$ | 0 | 1 | 2 | 3 | 4 | Total |
|---|---|---|---|---|---|---|
| Frequency $f$ | 4 | 7 | 8 | 4 | 2 | 25 |
| Relative frequency | 0.16 | 0.28 | 0.32 | 0.16 | 0.08 | 1 |
Relative frequency is the experimental side of probability from 14B. The more results you have, the more you can trust it as an estimate.
Use the table to estimate (a) the probability that the team scores at least $3$ goals in a game (b) how many games in a $50$-game season it will score at least $3$.
Graphing the data
- A frequency histogram has a column centred on each value, with the columns touching. Its height is the frequency.
- A frequency polygon joins the midpoints of the tops of the columns, and drops to the axis one step beyond each end.
- A relative frequency histogram looks identical, with the vertical axis relabelled $\tfrac{f}{n}$.
- Categorical data uses a column graph with gaps between the columns, because there is nothing between "soccer" and "netball".
Your turn
A spinner was spun $40$ times and landed on red $14$ times, blue $18$ times and green $8$ times. What type of variable is the colour? Estimate how many times it will land on blue in $200$ spins.
Show the working
Colour is categorical. The relative frequency of blue is $\dfrac{18}{40} = 0.45$, so in $200$ spins expect about $0.45 \times 200 = 90$ blues.
The number of cars in a household's driveway is:
It is counted: $0, 1, 2, \ldots$, and $1.5$ cars makes no sense. So it is discrete numerical.
The temperature at noon each day is:
Temperature is measured, and any value in a range is possible, so it is continuous numerical.
A survey records each student's phone number. This variable is:
A phone number is a label. Adding or averaging phone numbers means nothing, so it is categorical.
The numbers of books read last month by some students were: $0$ books, $6$ students; $1$ book, $12$; $2$ books, $10$; $3$ books, $8$; $4$ books, $4$. How many students were surveyed?
$6 + 12 + 10 + 8 + 4 = 40$.
For the books data, find the mode.
The highest frequency is $12$, for $1$ book. The mode is $1$, the value, not the frequency.
For the books data, find the relative frequency of $3$ books.
$\dfrac{8}{40} = 0.2$.
For the books data, estimate the probability that a student read at least $2$ books.
$\dfrac{10 + 8 + 4}{40} = \dfrac{22}{40} = 0.55$.
The relative frequencies in a table always:
Each is $\dfrac{f}{n}$, and the frequencies add to $n$, so the sum is $\dfrac{n}{n} = 1$.
Exam style: the books survey was a random sample from a school of $900$ students. Estimate how many students in the school read no books last month.
Relative frequency of $0$ books: $\dfrac{6}{40} = 0.15$. Estimate: $0.15 \times 900 = 135$ students.
Exam style: a table has frequencies $4$, $k$, $8$ and $6$. The relative frequency of the second value is $0.25$. Find $k$.
$n = 18 + k$, so $\dfrac{k}{18 + k} = 0.25$. Then $k = 4.5 + 0.25k$, so $0.75k = 4.5$ and $k = 6$. Check: $\dfrac{6}{24} = 0.25$.
Coaching Centre