Histograms

AS · S1 · 13 min

A histogram shows the shape of a large set of grouped, continuous data. It looks like a bar chart, but it works on a different principle: the area of each bar, not its height, represents the frequency. That is what lets classes have different widths without distorting the picture. Paper 5 almost always includes a histogram question, and the marks go on three things: the correct class boundaries, the correct frequency densities, and an accurately drawn diagram with labelled axes.

Why area, not height

Imagine 3030 people aged 3030 to 4949 and 3030 people aged 2020 to 2424. If both bars had height 3030, the wider bar would look four times as important, yet both classes hold the same number of people. The fix is to make the bar heights show how densely packed the data are: 3030 people over 2020 years is 1.51.5 people per year, and 3030 people over 55 years is 66 people per year. Then area == height ×\times width == frequency, and the picture is honest.

Definition

The frequency density of a class is its frequency divided by its class width. In a histogram each bar is drawn between the class boundaries with height equal to the frequency density, so the area of each bar equals (or is proportional to) the class frequency.

Key result
frequency density=frequencyclass widthfrequency=frequency density×class width\text{frequency density} = \frac{\text{frequency}}{\text{class width}} \qquad\qquad \text{frequency} = \text{frequency density} \times \text{class width}

Class boundaries

The bars of a histogram touch, so they must start and end at the class boundaries: the values where one class genuinely ends and the next begins. How you find them depends on how the data were recorded.

Key result
How the data are recordedClass written asBoundariesWidth
Continuous, given with inequalities10≤x<2010 \le x < 201010 and 20201010
Continuous, rounded to the nearest unit1010–19199.59.5 and 19.519.51010
Discrete (whole numbers)1010–19199.59.5 and 19.519.51010
Age in completed years1010–19191010 and 20201010
Continuous, to 11 d.p.2.52.5–2.92.92.452.45 and 2.952.950.50.5

The rule behind the table: the lower boundary is the smallest value that would be recorded in the class, and the upper boundary is where the next class starts. A length of 19.7 cm19.7\ \text{cm} recorded to the nearest cm becomes 2020, so it falls in the class 2020–2929; the boundary between "1010–1919" and "2020–2929" is therefore 19.519.5.

Age is the exception because people do not round their ages; they truncate. Someone who is 1919 years and 1111 months says they are 1919, so "1010–1919" includes everyone up to (but not including) their 2020th birthday.

The class width is upper boundary minus lower boundary, never the difference of the numbers written in the table: "1010–1919" has width 1010, not 99.

The mid-point (class mark), used for estimating the mean, is halfway between the boundaries: for "1010–1919" rounded to the nearest unit it is 9.5+19.52=14.5\tfrac{9.5 + 19.5}{2} = 14.5; for ages "1010–1919" it is 1515.

Drawing a histogram

Method
  1. Find the class boundaries and class widths.
  2. Calculate each frequency density, frequency ÷\div width. Add columns for these to the table.
  3. Draw a horizontal axis with a continuous, uniform scale for the variable (label it with units) and a vertical axis labelled frequency density, with a uniform scale.
  4. Draw each bar between its class boundaries with height equal to its frequency density. Bars touch; there are no gaps (unless a class has frequency 00).
  5. Check one bar: height ×\times width should give back the frequency.

Here is a histogram for the journey times of 100100 people.

Time tt (minutes)0≤t<100 \le t < 1010≤t<1510 \le t < 1515≤t<2015 \le t < 2020≤t<3020 \le t < 3030≤t<5030 \le t < 50
Frequency881414232330302525
Class width1010555510102020
Frequency density0.80.82.82.84.64.63.03.01.251.25
0 10 20 30 40 50 Time (minutes) 0 1 2 3 4 5 Frequency density
Bar heights are frequency densities; the area of each bar is the class frequency. The tallest bar marks the modal class, 15 to 20 minutes.

Notice that the class with the largest frequency (20≤t<3020 \le t < 30, 3030 people) is not the tallest bar. The modal class is the class with the highest frequency density, here 15≤t<2015 \le t < 20, because that is where the data are most concentrated.

Reading a histogram

Going backwards is just as common in exams: you are given the histogram (or the frequency densities) and asked for frequencies.

  • The frequency of a class is its frequency density times its width.
  • To estimate how many values lie in part of a class, assume the values are spread evenly through the class, and take the matching fraction of the bar's area: frequency density ×\times the width of the part you want.

If the histogram is drawn with a vertical axis that is not frequency density (for example the question says "the bar has height 3 cm3\ \text{cm}"), then area is only proportional to frequency. Find the constant from a bar whose frequency you know: frequency =k×= k \times area.

Worked examples

Frequency densities with rounded data (routine)

The lengths of 8080 fish, measured to the nearest centimetre, are summarised.

Length (cm)1010–14141515–19192020–29293030–4949
Frequency1515252530301010

Find the class boundaries and the frequency densities needed to draw a histogram.

Solution

Lengths are rounded to the nearest cm, so each class extends 0.50.5 below and above the numbers written.

Length (cm)BoundariesWidthFrequencyFrequency density
1010–14149.59.5 to 14.514.555151533
1515–191914.514.5 to 19.519.555252555
2020–292919.519.5 to 29.529.51010303033
3030–494929.529.5 to 49.549.5202010100.50.5

The bars are drawn from 9.59.5 to 49.549.5 on the horizontal axis with these heights.

Discrete data in a histogram

The numbers of words in 7070 sentences are grouped as 11–55, 66–1010, 1111–2020 and 2121–4040, with frequencies 1212, 1818, 2424 and 1616. Find the frequency densities, and state the modal class.

Solution

Word counts are whole numbers, so the gaps between classes are bridged at the half-way points: boundaries 0.5,5.5,10.5,20.5,40.50.5, 5.5, 10.5, 20.5, 40.5, widths 5,5,10,205, 5, 10, 20.

Frequency densities: 125=2.4\tfrac{12}{5} = 2.4, 185=3.6\tfrac{18}{5} = 3.6, 2410=2.4\tfrac{24}{10} = 2.4, 1620=0.8\tfrac{16}{20} = 0.8.

The modal class is 66–1010 words (highest frequency density, 3.63.6), even though 1111–2020 has the largest frequency.

Reading frequencies and part-classes

The masses, mm kg, of 120120 suitcases are shown in a histogram. The frequency densities are:

Mass mm (kg)0≤m<100 \le m < 1010≤m<1510 \le m < 1515≤m<2015 \le m < 2020≤m<3020 \le m < 3030≤m<4030 \le m < 40
Frequency density1.51.566882.52.5dd

(a) Find dd. (b) Estimate the number of suitcases with mass more than 18 kg18\ \text{kg}. (c) Estimate the number with mass between 12 kg12\ \text{kg} and 24 kg24\ \text{kg}.

Solution

(a) Frequencies are density ×\times width: 1.5×10=151.5 \times 10 = 15, 6×5=306 \times 5 = 30, 8×5=408 \times 5 = 40, 2.5×10=252.5 \times 10 = 25. These total 110110, so the last class has 120−110=10120 - 110 = 10 suitcases, and d=1010=1d = \tfrac{10}{10} = 1.

(b) From 1818 to 2020: 8×2=168 \times 2 = 16. Then all of the last two classes: 25+10=3525 + 10 = 35. Estimate: 16+35=5116 + 35 = 51 suitcases.

(c) From 1212 to 1515: 6×3=186 \times 3 = 18. From 1515 to 2020: 4040. From 2020 to 2424: 2.5×4=102.5 \times 4 = 10. Estimate: 18+40+10=6818 + 40 + 10 = 68 suitcases.

These are estimates because we have assumed the masses are spread evenly within each class.

Bar dimensions on paper (exam-hard)

The masses mm grams of some objects are grouped as follows.

Mass mm (g)0≤m<40 \le m < 44≤m<64 \le m < 66≤m<106 \le m < 1010≤m<2010 \le m < 20
Frequency2020242416161010

In a histogram drawn on paper, the bar for 0≤m<40 \le m < 4 is 2 cm2\ \text{cm} wide and 5 cm5\ \text{cm} high. Find the width and height of each of the other bars.

Solution

Widths. A class of width 4 g4\ \text{g} is drawn 2 cm2\ \text{cm} wide, so the scale is 0.5 cm0.5\ \text{cm} per gram. The other widths are 2×0.5=1 cm2 \times 0.5 = 1\ \text{cm}, 4×0.5=2 cm4 \times 0.5 = 2\ \text{cm} and 10×0.5=5 cm10 \times 0.5 = 5\ \text{cm}.

Areas. The first bar has area 2×5=10 cm22 \times 5 = 10\ \text{cm}^2 for a frequency of 2020, so 1 cm21\ \text{cm}^2 represents 22 objects, i.e. area =12×= \tfrac{1}{2} \times frequency.

ClassFrequencyArea (cm2\text{cm}^2)Width (cm)Height (cm)
4≤m<64 \le m < 624241212111212
6≤m<106 \le m < 101616882244
10≤m<2010 \le m < 201010555511

Check with frequency densities: 5,12,4,15, 12, 4, 1 per gram. The heights 5,12,4,1 cm5, 12, 4, 1\ \text{cm} are exactly these, so the vertical scale is 1 cm1\ \text{cm} per unit of frequency density.

Unknown frequencies from a density condition (exam-hard)

A histogram is drawn for 200200 values grouped as 0≤x<100 \le x < 10 (frequency aa), 10≤x<2010 \le x < 20 (frequency 5050), 20≤x<4020 \le x < 40 (frequency bb) and 40≤x<8040 \le x < 80 (frequency 3030). The bars for the first and third classes have the same height. Find aa and bb and state the modal class.

Solution

Equal heights means equal frequency densities: a10=b20\tfrac{a}{10} = \tfrac{b}{20}, so b=2ab = 2a.

Total: a+50+2a+30=200a + 50 + 2a + 30 = 200, so 3a=1203a = 120, a=40a = 40 and b=80b = 80.

Frequency densities: 44, 55, 44, 0.750.75. The modal class is 10≤x<2010 \le x < 20, though the class 20≤x<4020 \le x < 40 has the largest frequency.

Watch out

Using frequency as bar height with unequal classes. This is the most heavily penalised histogram error; the whole diagram scores almost nothing. Always calculate frequency density, even if the classes look equal (check them; often one is not).

Watch out

Wrong boundaries. Drawing "1010–1919" from 1010 to 1919 leaves gaps between bars and gives width 99. For rounded or discrete data, use 9.59.5 to 19.519.5. For ages, use 1010 to 2020.

Watch out

Labelling the vertical axis "frequency". It must say "frequency density". An unlabelled or mislabelled axis loses a mark even when the bars are right.

Exam tip
  • Show a table with boundaries, widths and frequency densities. This earns method marks even if the drawing is slightly off.
  • Choose scales that use most of the graph paper and are easy to plot (e.g. 2 cm2\ \text{cm} for 1010 units). Awkward scales cause plotting errors.
  • Bars must be accurate to within half a small square; use a sharp pencil and a ruler.
  • A histogram's horizontal axis starts at the lowest boundary; do not draw an extra bar or a gap from 00 unless the data start there.
  • For any estimate from a histogram (part of a class, the median, the mean), say it is an estimate and why: values are assumed evenly spread within each class.
Summary
  • Area represents frequency; height is frequency density == frequency ÷\div class width.
  • Bars run between class boundaries and touch.
  • Rounded continuous or discrete "1010–1919" gives boundaries 9.59.5 and 19.519.5; ages "1010–1919" give 1010 and 2020; "10≤x<2010 \le x < 20" gives 1010 and 2020.
  • Class width is the difference of the boundaries.
  • Frequency == density ×\times width; for part of a class, assume an even spread.
  • The modal class has the highest frequency density, not necessarily the highest frequency.
  • When the axis is not labelled in frequency density, frequency =k×= k \times area; find kk from a known bar.

Practice questions

Question
  1. Write down the class boundaries and class width for: (a) masses 2.02.0–2.4 kg2.4\ \text{kg}, measured to the nearest 0.1 kg0.1\ \text{kg}; (b) the number of goals, 55–99; (c) ages 3030–3939 years; (d) 45≤t<6045 \le t < 60.
  2. The heights of 8080 plants, measured to the nearest cm, are grouped as 55–99 (88 plants), 1010–1414 (2020), 1515–2424 (3232) and 2525–4444 (2020). Calculate the frequency densities.
  3. A histogram has bars for 0≤x<50 \le x < 5 (height 2.42.4), 5≤x<105 \le x < 10 (height 4.84.8), 10≤x<2010 \le x < 20 (height 3.13.1) and 20≤x<4020 \le x < 40 (height 0.650.65), where the heights are frequency densities. Find the total frequency.
  4. For the histogram in question 3, estimate how many values lie between 88 and 1515.
  5. Explain why, in question 3, the modal class is not the class with the largest frequency.
  6. The times of 160160 runners are grouped as 20≤t<2520 \le t < 25 (frequency 1616), 25≤t<3025 \le t < 30 (4848), 30≤t<4030 \le t < 40 (6464), 40≤t<6040 \le t < 60 (3232). In a histogram the bar for 25≤t<3025 \le t < 30 is 1.5 cm1.5\ \text{cm} wide and 6 cm6\ \text{cm} high. Find the width and height of the bar for 40≤t<6040 \le t < 60.
  7. In a histogram of 150150 values, the classes are 0≤x<20 \le x < 2, 2≤x<52 \le x < 5, 5≤x<105 \le x < 10 and 10≤x<2010 \le x < 20. The first class has frequency 1515. The second and third classes have the same frequency density, and the fourth class has frequency density 1.51.5. Find the frequencies of the second and third classes.
  8. The numbers of pages in 6060 books are grouped as 100100–199199 (99 books), 200200–249249 (1818), 250250–299299 (2121) and 300300–499499 (1212). Calculate the frequency densities, and estimate the number of books with more than 275275 pages.
Answers
  1. (a) 1.951.95 and 2.452.45, width 0.5 kg0.5\ \text{kg}. (b) Discrete: 4.54.5 and 9.59.5, width 55. (c) Ages: 3030 and 4040, width 1010 years. (d) 4545 and 6060, width 1515.

  2. Boundaries 4.5,9.5,14.5,24.5,44.54.5, 9.5, 14.5, 24.5, 44.5; widths 5,5,10,205, 5, 10, 20. Frequency densities 85=1.6\tfrac{8}{5} = 1.6, 205=4\tfrac{20}{5} = 4, 3210=3.2\tfrac{32}{10} = 3.2, 2020=1\tfrac{20}{20} = 1.

  3. Frequencies: 2.4×5=122.4 \times 5 = 12, 4.8×5=244.8 \times 5 = 24, 3.1×10=313.1 \times 10 = 31, 0.65×20=130.65 \times 20 = 13. Total =80= 80.

  4. From 88 to 1010: 4.8×2=9.64.8 \times 2 = 9.6. From 1010 to 1515: 3.1×5=15.53.1 \times 5 = 15.5. Estimate 9.6+15.5=25.19.6 + 15.5 = 25.1, so about 2525 values.

  5. The class 10≤x<2010 \le x < 20 has the largest frequency (3131) but it is twice as wide as 5≤x<105 \le x < 10; its values are spread over a wider interval. The modal class is the one where values are most concentrated, i.e. the highest frequency density: 5≤x<105 \le x < 10 (density 4.84.8).

  6. Width: 55 minutes is drawn as 1.5 cm1.5\ \text{cm}, so 0.3 cm0.3\ \text{cm} per minute; the class 40≤t<6040 \le t < 60 has width 20×0.3=6 cm20 \times 0.3 = 6\ \text{cm}. Area: 1.5×6=9 cm21.5 \times 6 = 9\ \text{cm}^2 represents 4848 runners, so 1 cm21\ \text{cm}^2 represents 489=163\tfrac{48}{9} = \tfrac{16}{3} runners. 3232 runners need 32×316=6 cm232 \times \tfrac{3}{16} = 6\ \text{cm}^2, so height =66=1 cm= \tfrac{6}{6} = 1\ \text{cm}.

  7. Fourth class: 1.5×10=151.5 \times 10 = 15. Let the common frequency density of classes 2 and 3 be dd; their widths are 33 and 55, so their frequencies are 3d3d and 5d5d. Then 15+3d+5d+15=15015 + 3d + 5d + 15 = 150, so 8d=1208d = 120 and d=15d = 15. The frequencies are 3×15=453 \times 15 = 45 and 5×15=755 \times 15 = 75. (Check: 15+45+75+15=15015 + 45 + 75 + 15 = 150.)

  8. Pages are discrete: boundaries 99.5,199.5,249.5,299.5,499.599.5, 199.5, 249.5, 299.5, 499.5; widths 100,50,50,200100, 50, 50, 200. Frequency densities 0.09,0.36,0.42,0.060.09, 0.36, 0.42, 0.06. "More than 275275 pages" means 276276 or more, i.e. from 275.5275.5. From 275.5275.5 to 299.5299.5: 0.42×24=10.080.42 \times 24 = 10.08. Plus all 1212 in the last class. Estimate 10.08+12=22.0810.08 + 12 = 22.08, about 2222 books.

How well do you know this?

Builds on

Where this leads

Console

Search notes, courses and tools, or run an action