- Bar charts and pie charts · coming soon
- Frequency tables and grouped data · coming soon
- Cumulative frequency
- Drawing histograms from frequency tables
- Reading histograms
- The normal distribution · coming soon
A picture that tells a lie
A town asks 75 people how long their journey to work takes. The answers are grouped into classes, like this:
| Journey time, (minutes) | Frequency |
|---|---|
| 10 | |
| 18 | |
| 24 | |
| 14 | |
| 9 |
Someone draws the table as bars, with the number of people as the height of each bar. Each bar runs along the number line from the start of its class to its end. Here is the result.
Look at the picture before you look at the numbers. The block on the right is the biggest thing in it. It seems to say that a huge crowd of people travel for half an hour or more. Now read the numbers. Only 9 people are in that class. It is the smallest class in the table.
Every height in the picture is the right frequency. And yet the picture misleads you. The idea that fixes it is called frequency density, and it is the real difference between a histogram and a bar chart. "One has gaps and one does not" is true, but it is not the reason.
Two kinds of data, two kinds of bars
Start with something you already know. Thirty students say how they travel to school: walk, bus, car or bicycle. That is a list of categories. A bar chart shows it.
In a bar chart, each bar stands for one category, and its height is the frequency. The width means nothing: thin or fat bars say the same thing. The gaps are there because "walk" and "bus" are separate answers, with nothing between them.
Bar charts are also used for discrete numbers: data that can only take separate values, such as the number of brothers and sisters a student has. These values have an order, 0, 1, 2, 3. But nobody has 2.4 brothers and sisters. There is nothing between 2 and 3, so a gap between the bars is honest.
The heights of students are different. A height can be 161 cm, 161.3 cm or 161.32 cm. Every value on the number line is possible. Data like this are continuous. To draw them, we group them into classes, such as . The classes sit side by side along the number line, with no space between them. One class ends exactly where the next one begins. So the bars touch. A gap in a histogram would mean something real: an empty class, with nobody in it.
Here is the real difference. In a histogram, the width of a bar means something. It is the width of the class, measured on the number line. In a bar chart, the width means nothing. Everything else in this lecture follows from that one fact.
There is a second reason to care. Box plots, from the last topic, show the four quarters of the data. They cannot show what happens inside a quarter: two clumps, or a gap in the middle. A histogram shows the whole outline of the data, clump by clump. That is why a histogram is often the first picture drawn of a new set of data.
Your eye reads area
Go back to the journey times. When the bars have different widths, your eye does not compare heights. It compares how much space each bar covers: its area.
The class 30 to 60 minutes is six times as wide as the class 0 to 5 minutes. Its bar was given a height of 9, almost as tall as the 0 to 5 bar. So it covered about five times as much space: 9 × 30 = 270 against 10 × 5 = 50. The picture said "five times as many people". The truth is "slightly fewer people".
So here is the question. How should the 30 to 60 bar be drawn, so that the picture tells the truth? Decide before you read on.
In the survey, 10 people take 0 to 5 minutes and 9 people take 30 to 60 minutes. In an honest picture, how does the bar for 30 to 60 minutes compare with the bar for 0 to 5 minutes? Choose, then see the honest picture.
The journey times drawn honestly. The numbers above the bars are the numbers of people; each one equals the area of its bar.
The honest bar is short and wide. Its height is not "how many people". Its height is "how many people per minute". That is the whole change.
Frequency density: people per minute
Think about how crowded each class is. In the class 0 to 5 minutes, 10 people share 5 minutes: 10 ÷ 5 = 2 people for each minute. In the class 30 to 60 minutes, 9 people share 30 minutes: 9 ÷ 30 = 0.3 people for each minute. The first class is crowded. The last is thinly spread.
You have met this kind of number before. A million people on 100 square kilometres is 10 000 people per square kilometre. A million people on 10 000 square kilometres is only 100 per square kilometre. Population density divides by area. Frequency density divides by class width.
For each class of a histogram:
The height of each bar is its frequency density. Then the area of each bar is its frequency:
Look at the second line. It is not a new fact to learn. It is the first line multiplied by the class width. If height is "people per minute" and width is "minutes", then height × width is "people". The units tell you that the area must be a count.
That is it. That is the whole idea. In a bar chart, height shows frequency. In a histogram, area shows frequency, and height shows how crowded the class is. So frequency density has units: people per minute, students per centimetre, parcels per kilogram. Some books leave the units off the axis, but they are always there.
Picture one bar as a rectangle: area = frequency, height = frequency density, width = class width. If you know two of them, the rectangle gives you the third. There is one relationship, not three formulas:
In a histogram, the tallest bar always belongs to the class with the most people. True or false?
Show the answer
False. Look at the honest journey picture. The tallest bar is 5 to 10 minutes (3.6), with 18 people. The class with the most people is 10 to 20 minutes, with 24, but its bar is only 2.4 high. It is twice as wide, so it holds more people with less crowding. The tallest bar shows the most crowded class. To find the class with the most people, compare areas, not heights. When all the classes have the same width, the two questions have the same answer, which is why the difference is easy to miss.
Change the classes, keep the truth
Here is the strongest reason to use frequency density. The person who groups the data chooses the classes. Two people with the same 75 journey times could choose different classes. A good picture should not change its story because of that choice.
Test it below. The 75 journey times were first recorded in twelve classes, each 5 minutes wide. You can remove a boundary to merge two classes, or put it back to split them. Then switch the vertical axis between frequency density and frequency.
Tap a boundary to remove it or put it back. Boundaries in use are shaded. Use the presets to jump between groupings. Then switch the vertical axis and watch the right-hand side of the picture.
Class boundaries (minutes):
Presets:
Vertical axis:
The 75 journey times in 5-minute classes have frequencies 10, 18, 13, 11, 8, 6, 3, 2, 2, 1, 1 and 0. The table shows the six classes from 30 to 60 minutes, and what happens when they are merged into one class.
| Classes (minutes) | Frequency | Frequency density |
|---|---|---|
| 30 to 35 | 3 | 0.6 |
| 35 to 40 | 2 | 0.4 |
| 40 to 45 | 2 | 0.4 |
| 45 to 50 | 1 | 0.2 |
| 50 to 55 | 1 | 0.2 |
| 55 to 60 | 0 | 0 |
| 30 to 60, merged | 9 | 0.3 |
With frequency density, the merged bar is 0.3 high: the average of the six heights it replaces, (0.6 + 0.4 + 0.4 + 0.2 + 0.2 + 0) ÷ 6 = 0.3. It sits low, like the bars it replaces. With frequency, the merged bar would be 9 high, three times taller than any of the six bars it replaces, and 30 minutes wide.
With frequency density, merging classes barely changes the outline. A merged bar sits at the average height of the bars it replaces, and the total area stays 75. With frequency on the axis, every merge builds a tower. The right-hand side seems to fill up, though not one person has moved.
This is why a histogram is honest. Its picture depends on the data, not on the person who chose the classes.
Equal widths: why frequency seemed to work
You may have drawn histograms with frequency up the side. If all the classes had the same width, that was not wrong. When every class has width 10, every bar is one tenth of its frequency. The shape is exactly the same; only the numbers on the vertical axis change. The areas are still in the right proportions.
Many courses accept frequency on the vertical axis when the widths are equal; some always ask for frequency density. What matters in every course is the rule underneath both: the area of each bar must be proportional to its frequency. Frequency density makes the area exactly equal to the frequency, and it works for any classes, equal or not. That is why it is the safe habit.
The histogram was hiding in the cumulative frequency curve
The lecture on cumulative frequency drew a curve for the heights of 80 students. It noticed that the curve is steep where the data are crowded and flat where they are thin. Over each class, the curve rises by that class's frequency.
Now divide each rise by the class width. Rise ÷ run is the gradient of the curve over that class. It is also the frequency ÷ class width. So it is the frequency density.
| Height (cm) | Frequency | Rise of the cumulative frequency curve | Frequency density (students per cm) |
|---|---|---|---|
| 150 to 155 | 5 | 0 → 5 | 1 |
| 155 to 160 | 12 | 5 → 17 | 2.4 |
| 160 to 165 | 24 | 17 → 41 | 4.8 |
| 165 to 170 | 21 | 41 → 62 | 4.2 |
| 170 to 175 | 13 | 62 → 75 | 2.6 |
| 175 to 180 | 5 | 75 → 80 | 1 |
Look at the histogram of heights near the start of this lecture. Its bars are 1, 2.4, 4.8, 4.2, 2.6 and 1 high. Those are the gradients of the cumulative frequency curve, class by class. The cumulative frequency curve shows the running total. The histogram shows how fast the total is growing. Where the histogram is tallest, the curve is steepest.
Worked examples
The ages of 60 people at a community event (invented data) are grouped into classes 10 years wide. Find the frequency densities and describe the histogram.
| Age, (years) | Frequency | Frequency density |
|---|---|---|
| 12 | 1.2 | |
| 18 | 1.8 | |
| 15 | 1.5 | |
| 9 | 0.9 | |
| 6 | 0.6 |
Think first. Every class is 10 years wide, so every frequency is divided by the same number, 10. For example, 12 ÷ 10 = 1.2 people per year.
Describe it. The tallest bar is 30 to 40 years. With equal widths, the tallest bar also holds the most people (18). After 40, the bars fall steadily. A frequency chart would have exactly this shape, ten times as tall.
Check. Each area is a density × 10. The areas are 12, 18, 15, 9 and 6, which add up to 60, the number of people ✓.
Find the frequency densities for the 75 journey times from the start of the lecture.
Find the widths first. A class width is the upper boundary minus the lower boundary. The class is 20 − 10 = 10 minutes wide. It is not 20 wide, and it is not 15. The widths are 5, 5, 10, 10 and 30.
Then divide.
| Class (minutes) | Frequency | Class width | Frequency density |
|---|---|---|---|
| 0 to 5 | 10 | 5 | 10 ÷ 5 = 2 |
| 5 to 10 | 18 | 5 | 18 ÷ 5 = 3.6 |
| 10 to 20 | 24 | 10 | 24 ÷ 10 = 2.4 |
| 20 to 30 | 14 | 10 | 14 ÷ 10 = 1.4 |
| 30 to 60 | 9 | 30 | 9 ÷ 30 = 0.3 |
Read it. The most crowded journey times are 5 to 10 minutes: 3.6 people per minute. Long journeys are rare: only 0.3 people per minute between 30 and 60 minutes. The honest picture is the one in the Predict activity above.
Check. The areas are 2 × 5 = 10, 3.6 × 5 = 18, 2.4 × 10 = 24, 1.4 × 10 = 14 and 0.3 × 30 = 9. They add up to 75 ✓.
A histogram shows the masses of parcels at a post office (invented data). The bar for kg has height 8. The bar for kg has height 6. (a) How many parcels are in each class? (b) Another class holds 18 parcels and its bar is 1.5 high. How wide is it?
(a) Height is parcels per kilogram, so area is parcels. The first class is 5 − 2 = 3 kg wide: 8 × 3 = 24 parcels. The second is 10 − 5 = 5 kg wide: 6 × 5 = 30 parcels.
The second bar is lower, but it holds more parcels, because its class is wider. The heights alone would have given the wrong answer.
(b) The bar is a rectangle with area 18 and height 1.5. So its width is 18 ÷ 1.5 = 12 kg. If the class starts at 10 kg, it is .
Check. 1.5 × 12 = 18 ✓. And 24 ÷ 3 = 8, 30 ÷ 5 = 6, the heights we started with ✓.
On a histogram with unequal widths, the tallest bar is the most crowded class, not the biggest one. To find how many values a class holds, multiply its height by its width. If a question asks "which class has the most", compare areas.
The width of is 10, the difference between the boundaries. It is not 20 (the upper boundary) and it is not 15 (the midpoint). Write the widths in their own column before you divide.
Bars for "walk, bus, car, bicycle" drawn touching are still a bar chart. Categories have no width, so frequency density means nothing for them. The other way round, a histogram of continuous data needs no gaps: a gap says "nobody is in this class".
Work each one on paper first. Open a hint only when you are stuck.
-
Bar chart or histogram? Give a reason for each. (a) The number of brothers and sisters of 40 students. (b) The times of 50 runners in a 100 m race. (c) The favourite subjects of a class. (d) The masses of 60 mangoes. (e) The number of goals scored in each of 30 football matches.
Hint 1
Ask: can the data take any value on a number line, or only separate values or categories?
Hint 2
Can a match have 2.5 goals? Can a mango weigh 182.7 g?
Full answer
(a) Bar chart: whole numbers only, nothing between 2 and 3. (b) Histogram: time is continuous, so it is grouped into classes that touch. (c) Bar chart: categories, with no order and no width. (d) Histogram: mass is continuous. (e) Bar chart: goals are whole numbers. Check: the histograms are exactly the measured quantities (time, mass), where every value in a class is possible ✓.
-
The lengths of 60 phone calls are grouped like this: minutes: 14 calls; : 16; : 18; : 9; : 3. (a) Find each frequency density. (b) Which bar is tallest? Which class has the most calls?
Hint 1
Write the widths first: 2, 2, 4, 6, 6.
Hint 2
14 ÷ 2 = 7 calls per minute. Do the same for the others.
Full answer
(a) 14 ÷ 2 = 7, 16 ÷ 2 = 8, 18 ÷ 4 = 4.5, 9 ÷ 6 = 1.5, 3 ÷ 6 = 0.5 calls per minute. (b) The tallest bar is 2 to 4 minutes (8). The class with the most calls is 4 to 8 minutes (18): its bar is lower, but twice as wide. Check: 7 × 2 + 8 × 2 + 4.5 × 4 + 1.5 × 6 + 0.5 × 6 = 14 + 16 + 18 + 9 + 3 = 60 ✓.
-
A histogram shows the ages of 100 people using a library. The bars have these heights (people per year): : 1.5; : 2.2; : 1.6; : 0.9. The last bar, , is missing. How high should it be?
Hint 1
Find the number of people in each of the four classes you know. The total must be 100.
Hint 2
1.5 × 10 = 15. Remember that the third and fourth classes are 20 years wide.
Full answer
The four known classes hold 1.5 × 10 + 2.2 × 10 + 1.6 × 20 + 0.9 × 20 = 15 + 22 + 32 + 18 = 87 people. So the last class holds 100 − 87 = 13 people, spread over 30 years. Its height is 13 ÷ 30 ≈ 0.43 people per year. Check: 0.4333… × 30 = 13, and 87 + 13 = 100 ✓.
-
Aisha draws the journey times with a vertical axis labelled "frequency per 5 minutes". Her bar for 0 to 5 minutes is 10 high, and her bar for 10 to 20 minutes is 12 high. (a) How many people are in each of these two classes? (b) Is her histogram honest? Explain using area. (c) Convert her height of 12 into a frequency density in people per minute.
Hint 1
"Per 5 minutes" means each height counts people in a 5-minute stretch. How many 5-minute stretches fit into the class 10 to 20?
Hint 2
The class 10 to 20 is two 5-minute stretches, each with 12 people.
Full answer
(a) 0 to 5 is one 5-minute stretch: 10 people. 10 to 20 is two stretches: 12 × 2 = 24 people. These match the survey ✓. (b) Yes. Each of her heights is 5 times the frequency density, so each area is 5 times the frequency. Areas are still proportional to frequencies, which is the rule that matters. Only the scale is different. (c) 12 people per 5 minutes is 12 ÷ 5 = 2.4 people per minute, which is the frequency density from Worked Example 2 ✓. Some exam questions use a scale like this, or give a key such as "1 square = 5 people". Work out what one unit of area means first.
Density is one of the most useful ideas in science: people per square kilometre, kilograms per cubic metre, calls per minute. Each time, you divide an amount by the space it is spread over, so that big spaces and small spaces can be compared fairly. A histogram is density drawn as a picture.
Now imagine thousands of values in very narrow classes. The tops of the bars start to look like a smooth curve, and the area under the curve between two values still counts how many lie between them. At Pre-University, that smooth curve becomes the normal distribution, and the area under it becomes a probability. The idea is already in your hands: area, not height.
The idea is older than its name. The statistician Karl Pearson used the word "histogram" in his public lectures in London in 1891, and it appeared in print in 1895. Even then, Pearson called it a common kind of graph.
- A bar chart shows categories or separate values, and the width of its bars means nothing.
- A histogram shows continuous data grouped into classes, and each bar covers its class on the number line, so the bars touch.
- Frequency density is frequency divided by class width, and it measures how crowded a class is.
- In a histogram the height of a bar is its frequency density and the area of the bar is its frequency.
- With unequal class widths, the tallest bar shows the most crowded class, and areas, not heights, compare how many values each class holds.
- Frequency density keeps the picture honest when classes are merged or split, and its height is the gradient of the cumulative frequency curve.