Frequency distribution
A distribution describes the set of values that our random variable can take.
Frequency distribution of one variable
We usually show a distribution as a table or a graph. We start by carrying out an experiment. Mrs Logarithm teaches maths to class 8C, and we can look at the grades her students got on their school reports. The population of this experiment is all the students in class 8C. There are 30 of them. We write the results of the experiment in a table:
| Grade | Number of students |
|---|---|
| 9 | 7 |
| 7 | 13 |
| 5 | 6 |
| 3 | 3 |
| 1 | 1 |
This table shows the frequency distribution of the discrete variable “final maths grade on the school report”. We could show the same distribution in a bar chart like this:
Frequency distribution by subgroup
In the previous example we had just one bar for each grade, telling us how many students got that grade. We can split these frequencies into some interesting subgroups. For example, we might be interested in which grades the boys got and which the girls got. Instead of one column we introduce two, one for the boys and one for the girls. Such a table then shows the frequency distribution by subgroup.
| Grade | Number of boys | Number of girls |
|---|---|---|
| 9 | 5 | 2 |
| 7 | 6 | 7 |
| 5 | 4 | 2 |
| 3 | 1 | 2 |
| 1 | 1 | 0 |
The same data in a bar chart:
Relative frequency
Sometimes we do not need to know the absolute number of students who got this or that grade. We may just want to know what percentage of the students got the lowest grade, and so on. This is what relative frequency is for.
We know that class 8C has 30 students in total. Let us call this number N, so N = 30. To work out a relative frequency, we take the frequency and divide it by N. So we find the relative frequency of grade 5, if we do not distinguish between boys and girls, by dividing 6/30, where 6 is the number of students who got grade 5. The result is a relative frequency of 0.2. If we want the result as a percentage, we multiply this number by one hundred: 0.2 · 100 = 20%. We can again write the relative frequencies in a table:
| Grade | Frequency | Relative frequency |
|---|---|---|
| 9 | 7 | 0.2333… |
| 7 | 13 | 0.4333… |
| 5 | 6 | 0.2 |
| 3 | 3 | 0.1 |
| 1 | 1 | 0.0333… |
Relative frequency can be shown in a graph too:
Cumulative frequency
Next to the column with the frequency of each final grade we can show another column, with the cumulative frequency. Look at the following table:
| Grade | Number of students | Cumulative frequency |
|---|---|---|
| 9 | 7 | 7 |
| 7 | 13 | 20 |
| 5 | 6 | 26 |
| 3 | 3 | 29 |
| 1 | 1 | 30 |
In the second row the cumulative frequency column holds the value 20. We got it by adding the numbers of students in the first and second rows, that is 7 + 13 = 20. In the third row the cumulative frequency is therefore 26, because 7 + 13 + 6 = 26. In other words, it is the sum of the frequencies of all the rows above the current row, plus the value from the current row.
In the first row the cumulative frequency is therefore the same as the frequency, and in the last row the cumulative frequency equals the size of the whole population (there are thirty students in the class).
We can also work out cumulative relative frequencies:
| Grade | Relative frequency | Cumulative relative frequency |
|---|---|---|
| 9 | 0.2333 | 0.2333… |
| 7 | 0.4333 | 0.6666… |
| 5 | 0.2 | 0.86666… |
| 3 | 0.1 | 0.96666… |
| 1 | 0.0333 | 1 |
In the first row the cumulative relative frequency again has the same value as in the Relative frequency column. In the last row we have 1, which means 100% of the population.
Frequency distribution of a continuous variable
If the random variable is not discrete but continuous, it is usually shown not in a table or a bar chart but in an ordinary graph, as a classic function. A continuous variable is, for example, temperature. On the website of the Czech Hydrometeorological Institute (chmi.cz) we can look up the mean temperature in Prague in January for the years 1961–1990 and show it in a graph as a continuous curve: