Lemonmath
Tiếng Việt

Range and interquartile range of grouped data

Lesson 3.1 · 20 min read · Updated

A school surveyed how long students in classes 12A and 12B take to travel from home to school, 4040 students in each class. The results were grouped as follows.

Time (minutes) [0,10)[0, 10) [10,20)[10, 20) [20,30)[20, 30) [30,40)[30, 40) [40,50)[40, 50)
Class 12A 44 1212 1212 88 44
Class 12B 22 66 2424 66 22

In both classes the times stretch from 00 to 5050 minutes. So which class has the more even travel times, and which number measures that?

In grade 10 we measured the spread of raw data. This lesson does the same when we only have a grouped table.

The range of grouped data

Exploring: what do we know about the largest and smallest values?

From the table for class 12A we do not know each student's exact time. We only know that the quickest student is in the class [0,10)[0, 10) and the slowest is in the class [40,50)[40, 50). So the difference between those two values is at most 50−0=5050-0=50 minutes. We take the number 5050 as the range of the grouped data.

In this lesson, grouped data have kk classes [u1,u2)[u_1, u_2), [u2,u3)[u_2, u_3), …, [uk,uk+1)[u_k, u_{k+1}) with frequencies n1n_1, n2n_2, …, nkn_k and sample size n=n1+n2+⋯+nkn=n_1+n_2+\cdots+n_k. We assume that the first and last classes have non-zero frequency.

For both classes, R=50−0=50R=50-0=50 minutes. The range cannot tell the two classes apart, because it depends only on the two classes at the ends. We need a measure that looks at the middle of the data.

The interquartile range

In grade 11 we found the quartiles of grouped data by "spreading out" the values evenly inside the class that contains them. Recall: the first quartile Q1Q_1 is at position n4\frac n4, the third quartile Q3Q_3 at position 3n4\frac{3n}{4}.

The fraction n4−Cnm\dfrac{\frac n4-C}{n_m} tells us how far into the class position n4\frac n4 lies. For example, if the class holds 1212 values and we need 66 more of them, then Q1Q_1 is in the middle of the class.

The first example finds all these measures for class 12A.

Doing the same for class 12B answers the opening question.

When n4\frac n4 is not a whole number, the formula is used in the same way. The class width need not be 1010 either.

Measures of grouped data are approximations

Grouping loses information about the individual values. The next example compares the measures from the raw data with those from the grouped table.

Key terms

Summary

  • Grouped data [u1,u2)[u_1, u_2), …, [uk,uk+1)[u_k, u_{k+1}), frequencies n1n_1, …, nkn_k, sample size nn.
  • R=uk+1−u1R=u_{k+1}-u_1 (right end of the last class minus left end of the first class).
  • Q1=um+n4−Cnm(um+1−um)Q_1=u_m+\dfrac{\frac n4-C}{n_m}(u_{m+1}-u_m), where class mm is the first class with cumulative frequency ≥n4\ge\frac n4 and CC is the cumulative frequency of the classes before it; Q3Q_3: replace n4\frac n4 by 3n4\frac{3n}{4}.
  • ΔQ=Q3−Q1\Delta_Q=Q_3-Q_1: the width of the middle half of the data; smaller means more even.
  • These are approximate values; ΔQ\Delta_Q is less affected by the two end classes than RR.

Practice

Each exercise comes with what you need and some steps to start. Try it yourself first, then open the solution.

Exercise 1

The masses (g) of 4040 apples are given in the table. Find RR, Q1Q_1, Q3Q_3 and ΔQ\Delta_Q.

Mass (g) [150,160)[150, 160) [160,170)[160, 170) [170,180)[170, 180) [180,190)[180, 190) [190,200)[190, 200)
Apples 44 1010 1414 88 44
What you need and how to start

What you need: R=uk+1−u1R=u_{k+1}-u_1; the formulas for Q1Q_1, Q3Q_3 of grouped data.

Steps:

  1. Write the cumulative frequencies.
  2. Find the classes containing position 1010 and position 3030.
  3. Substitute into the formula.
Show solution

Cumulative frequencies: 44, 1414, 2828, 3636, 4040; R=200−150=50R=200-150=50. Q1=160+10−410⋅10=166,Q3=180+30−288⋅10=182.5.Q_1=160+\frac{10-4}{10}\cdot10=166,\qquad Q_3=180+\frac{30-28}{8}\cdot10=182.5.

Answer. R=50R=50 g, Q1=166Q_1=166, Q3=182.5Q_3=182.5, ΔQ=16.5\Delta_Q=16.5 g.

Exercise 2

The daily reading times (minutes) of 5050 students are given in the table. Find Q1Q_1, Q3Q_3 and ΔQ\Delta_Q (to two decimal places).

Time (minutes) [0,20)[0, 20) [20,40)[20, 40) [40,60)[40, 60) [60,80)[60, 80) [80,100)[80, 100)
Students 55 99 1616 1212 88
What you need and how to start

What you need: the position of Q1Q_1 is n4=12.5\frac n4=12.5 and that of Q3Q_3 is 3n4=37.5\frac{3n}{4}=37.5; the class width is 2020.

Steps:

  1. Cumulative frequencies: 55, 1414, 3030, 4242, 5050.
  2. Choose the class for each position and substitute into the formula.
Show solution

Q1=20+12.5−59⋅20=20+503≈36.67,Q3=60+37.5−3012⋅20=72.5.Q_1=20+\frac{12.5-5}{9}\cdot20=20+\frac{50}{3}\approx36.67,\qquad Q_3=60+\frac{37.5-30}{12}\cdot20=72.5.

Answer. Q1≈36.67Q_1\approx36.67; Q3=72.5Q_3=72.5; ΔQ≈35.83\Delta_Q\approx35.83 minutes.

Exercise 3

A shop tests the battery life (hours) of 5050 phones of each of two models X and Y.

Battery life (hours) [8,10)[8, 10) [10,12)[10, 12) [12,14)[12, 14) [14,16)[14, 16) [16,18)[16, 18)
Model X 33 1010 2424 1010 33
Model Y 88 1212 1010 1212 88

Find the interquartile range of each model. If a customer wants a steady battery life, which model should they choose?

What you need and how to start

What you need: a smaller ΔQ\Delta_Q means the middle of the data is more concentrated.

Steps:

  1. Positions 12.512.5 and 37.537.5; write the cumulative frequencies for each model.
  2. Find Q1Q_1, Q3Q_3 and ΔQ\Delta_Q for each model and compare.
Show solution

Model X (cumulative 33, 1313, 3737, 4747, 5050): Q1=10+12.5−310⋅2=11.9,Q3=14+37.5−3710⋅2=14.1,ΔQ=2.2.Q_1=10+\frac{12.5-3}{10}\cdot2=11.9,\qquad Q_3=14+\frac{37.5-37}{10}\cdot2=14.1,\qquad \Delta_Q=2.2. Model Y (cumulative 88, 2020, 3030, 4242, 5050): Q1=10+12.5−812⋅2=10.75,Q3=14+37.5−3012⋅2=15.25,ΔQ=4.5.Q_1=10+\frac{12.5-8}{12}\cdot2=10.75,\qquad Q_3=14+\frac{37.5-30}{12}\cdot2=15.25,\qquad \Delta_Q=4.5. Both models have the same R=10R=10 hours, but the ΔQ\Delta_Q of X is much smaller.

Answer. ΔQ=2.2\Delta_Q=2.2 hours (X) and 4.54.5 hours (Y); choose model X.

Exercise 4

The weekly hours of exercise of 3030 students are given in the table.

Hours [0,2)[0, 2) [2,4)[2, 4) [4,6)[4, 6) [6,8)[6, 8) [8,10)[8, 10)
Students 33 77 1010 66 44

Is each claim true or false?

a) The range of the data is 1010.

b) The first quartile lies in the class [2,4)[2, 4).

c) Q3≈6.83Q_3\approx6.83.

d) The interquartile range is greater than 44.

What you need and how to start

What you need: R=uk+1−u1R=u_{k+1}-u_1; the class containing Q1Q_1 is the first class with cumulative frequency ≥n4\ge\frac n4.

Steps:

  1. Cumulative frequencies: 33, 1010, 2020, 2626, 3030; n4=7.5\frac n4=7.5, 3n4=22.5\frac{3n}{4}=22.5.
  2. Find Q1Q_1, Q3Q_3 and ΔQ\Delta_Q.
Show solution

a) True. R=10−0=10R=10-0=10.

b) True. 3<7.5≤103<7.5\le10, and Q1=2+7.5−37⋅2=237≈3.29Q_1=2+\dfrac{7.5-3}{7}\cdot2=\dfrac{23}{7}\approx3.29.

c) True. 20<22.5≤2620<22.5\le26, so Q3=6+22.5−206⋅2=416≈6.83Q_3=6+\dfrac{22.5-20}{6}\cdot2=\dfrac{41}{6}\approx6.83.

d) False. ΔQ=416−237=14942≈3.55<4\Delta_Q=\dfrac{41}{6}-\dfrac{23}{7}=\dfrac{149}{42}\approx3.55<4.

Answer. a) True; b) True; c) True; d) False.

Exercise 5

The masses (kg) of 4040 students are given in the table. Find the interquartile range (in kg, to two decimal places).

Mass (kg) [40,45)[40, 45) [45,50)[45, 50) [50,55)[50, 55) [55,60)[55, 60) [60,65)[60, 65)
Students 44 99 1515 88 44
What you need and how to start

What you need: the formulas for Q1Q_1, Q3Q_3; the class width is 55.

Steps:

  1. Cumulative frequencies: 44, 1313, 2828, 3636, 4040.
  2. Position 1010 lies in [45,50)[45, 50), position 3030 in [55,60)[55, 60).
Show solution

Q1=45+10−49⋅5=1453≈48.33,Q3=55+30−288⋅5=56.25.Q_1=45+\frac{10-4}{9}\cdot5=\frac{145}{3}\approx48.33,\qquad Q_3=55+\frac{30-28}{8}\cdot5=56.25. ΔQ=56.25−1453≈7.9167.\Delta_Q=56.25-\frac{145}{3}\approx7.9167.

Answer. 7.927.92.

Exercise 6

(Revisiting the median of grouped data, grade 11.) For the table of apple masses in Exercise 1, find the median MeM_e and check that Q1<Me<Q3Q_1<M_e<Q_3.

What you need and how to start

What you need: MeM_e is found like Q1Q_1 but at position n2\frac n2.

Steps:

  1. n2=20\frac n2=20; cumulative frequencies 44, 1414, 2828, …
  2. The class containing MeM_e is [170,180)[170, 180), with C=14C=14, nm=14n_m=14.
Show solution

Me=170+20−1414⋅10=170+307≈174.29.M_e=170+\frac{20-14}{14}\cdot10=170+\frac{30}{7}\approx174.29. Since 166<174.29<182.5166<174.29<182.5, we have Q1<Me<Q3Q_1<M_e<Q_3.

Answer. Me≈174.29M_e\approx174.29 g.

Exercise 7

(Revisiting Measures of dispersion.) Consider the raw data 3,7,8,11,12,14,15,16,18,21,24,293, 7, 8, 11, 12, 14, 15, 16, 18, 21, 24, 29.

a) Find RR and ΔQ\Delta_Q of the raw data.

b) Group them into the three classes [0,10)[0, 10), [10,20)[10, 20), [20,30)[20, 30) and find RR and ΔQ\Delta_Q of the grouped data.

What you need and how to start

What you need: with n=12n=12 even, each half has 66 values (grade 10); the formulas for grouped data.

Steps:

  1. a) Q1Q_1 is the median of the first 66 values, Q3Q_3 the median of the last 66.
  2. b) Count the frequency of each class; positions 33 and 99.
Show solution

a) R=29−3=26R=29-3=26; Q1=8+112=9.5Q_1=\dfrac{8+11}{2}=9.5, Q3=18+212=19.5Q_3=\dfrac{18+21}{2}=19.5, ΔQ=10\Delta_Q=10.

b) Frequencies 33, 66, 33 (cumulative 33, 99, 1212), R=30R=30. Q1=0+3−03⋅10=10,Q3=10+9−36⋅10=20,ΔQ=10.Q_1=0+\frac{3-0}{3}\cdot10=10,\qquad Q_3=10+\frac{9-3}{6}\cdot10=20,\qquad \Delta_Q=10.

Answer. a) R=26R=26, ΔQ=10\Delta_Q=10; b) R=30R=30, ΔQ=10\Delta_Q=10. Here ΔQ\Delta_Q is a very good approximation, while RR is larger than the true value.

Exercise 8

For class 12A (Example 1) we have Q1=15Q_1=15 and Q3=32.5Q_3=32.5 minutes. A new student who joins the class takes 6262 minutes to get to school. By the 1.5 ΔQ1.5\,\Delta_Q rule, is this time an outlier?

What you need and how to start

What you need: a value is an outlier if it is greater than Q3+1.5 ΔQQ_3+1.5\,\Delta_Q or less than Q1−1.5 ΔQQ_1-1.5\,\Delta_Q.

Steps:

  1. Compute ΔQ\Delta_Q and 1.5 ΔQ1.5\,\Delta_Q.
  2. Compute the upper limit and compare it with 6262.
Show solution

ΔQ=17.5\Delta_Q=17.5 and 1.5 ΔQ=26.251.5\,\Delta_Q=26.25. The upper limit is Q3+1.5 ΔQ=32.5+26.25=58.75<62.Q_3+1.5\,\Delta_Q=32.5+26.25=58.75<62.

Answer. Yes, 6262 minutes is an outlier for this class.

Exercise 9 Challenge

Grouped data have the following frequency table, where xx is an unknown positive integer.

Class [0,10)[0, 10) [10,20)[10, 20) [20,30)[20, 30) [30,40)[30, 40)
Frequency 44 xx 1010 66

We know that Q1=13.75Q_1=13.75 and that Q1Q_1 lies in the class [10,20)[10, 20). Find xx.

What you need and how to start

What you need: n=20+xn=20+x; Q1=um+n4−Cnm⋅hQ_1=u_m+\dfrac{\frac n4-C}{n_m}\cdot h.

Steps:

  1. Write Q1Q_1 in terms of xx with um=10u_m=10, C=4C=4, nm=xn_m=x, h=10h=10.
  2. Solve the equation, then check the condition for choosing the class.
Show solution

10+20+x4−4x⋅10=13.75  ⟺  x+44x⋅10=3.75  ⟺  10x+40=15x  ⟺  x=8.10+\frac{\frac{20+x}{4}-4}{x}\cdot10=13.75\iff\frac{x+4}{4x}\cdot10=3.75\iff 10x+40=15x\iff x=8. Check. n=28n=28, n4=7\frac n4=7 and 4<7≤124<7\le12, so Q1Q_1 does lie in [10,20)[10, 20): Q1=10+7−48⋅10=13.75Q_1=10+\frac{7-4}{8}\cdot10=13.75.

Answer. x=8x=8.

Mini test

Mini test

Marked like the Vietnamese graduation exam: Part I 0.25 points per question; Part II up to 1 point per question (1, 2, 3, 4 correct statements give 0.1, 0.25, 0.5, 1 point); Part III 0.5 points per question.

Part I. Multiple choice

Question 1.

The times (minutes) that 4040 passengers waited for a bus are given in the table. The range of these grouped data is

Time (minutes) [0,5)[0, 5) [5,10)[5, 10) [10,15)[10, 15) [15,20)[15, 20) [20,25)[20, 25)
Passengers 66 1414 1212 44 44
Question 2. For the data in Question 1, the class containing the third quartile Q3Q_3 is
Question 3. For the data in Question 1, the best approximation to the first quartile Q1Q_1 is
Question 4. By the interquartile range rule, a value xx of a data set is regarded as an outlier if

Part II. True or false

Question 1.

The 100100 m running times (seconds) of 3232 students are given in the table.

Time (seconds) [12,14)[12, 14) [14,16)[14, 16) [16,18)[16, 18) [18,20)[18, 20) [20,22)[20, 22)
Students 44 88 1010 88 22
a) The range of the data is 1010 seconds.
b) Q1=15Q_1=15.
c) The third quartile Q3Q_3 lies in the class [16,18)[16, 18).
d) By the 1.5 ΔQ1.5\,\Delta_Q rule, a time of 2424 seconds is an outlier.

Part III. Short answer

Question 1.

The monthly electricity use (kWh) of 8080 households is given in the table. Find the interquartile range of the data, giving your answer to 1 decimal place.

Electricity use (kWh) [50,100)[50, 100) [100,150)[100, 150) [150,200)[150, 200) [200,250)[200, 250) [250,300)[250, 300)
Households 88 2020 2828 1616 88

Question 2. For the data in the previous question, by the 1.5 ΔQ1.5\,\Delta_Q rule, above how many kWh a month is a household's electricity use regarded as an outlier? Give your answer to the nearest whole number.

Show answers and explanations
  1. Part I, question 1: C. R=uk+1−u1=25−0=25R=u_{k+1}-u_1=25-0=25. Option B uses the left end of the last class, option A is the width of one class, and option D is the difference of two frequencies, 14−414-4.
  2. Part I, question 2: B. The cumulative frequencies are 66, 2020, 3232, 3636, 4040, and 3n4=30\frac{3n}{4}=30 lies between 2020 and 3232, so Q3Q_3 is in the class [10,15)[10, 15) (in fact Q3=10+30−2012⋅5≈14.17Q_3=10+\dfrac{30-20}{12}\cdot5\approx14.17). Option A is the class with the largest frequency; options C and D are classes that come after the 30th value.
  3. Part I, question 3: D. n4=10\frac n4=10 lies in the class [5,10)[5, 10) with C=6C=6, nm=14n_m=14: Q1=5+10−614⋅5≈6.43Q_1=5+\dfrac{10-6}{14}\cdot5\approx6.43. Option B forgets to multiply by the width 55, option C includes the quartile's own class in CC, and option A uses the class [0,5)[0, 5) by mistake.
  4. Part I, question 4: A. An outlier lies further from the middle of the data than 1.51.5 times the interquartile range. Option B would make half of the data outliers; option D describes the values that are not outliers.
  5. Part II, question 1: a) True; b) True; c) False; d) True. a) True: 22−12=1022-12=10. b) True: the cumulative frequencies are 44, 1212, 2222, 3030, 3232, and Q1=14+8−48⋅2=15Q_1=14+\dfrac{8-4}{8}\cdot2=15. c) False: 3n4=24\frac{3n}{4}=24 lies between 2222 and 3030, so Q3Q_3 is in the class [18,20)[18, 20): Q3=18+24−228⋅2=18.5Q_3=18+\dfrac{24-22}{8}\cdot2=18.5. d) True: ΔQ=18.5−15=3.5\Delta_Q=18.5-15=3.5 and Q3+1.5⋅3.5=23.75<24Q_3+1.5\cdot3.5=23.75<24.
  6. Part III, question 1: 82.5. The cumulative frequencies are 88, 2828, 5656, 7272, 8080. Q1=100+20−820⋅50=130Q_1=100+\dfrac{20-8}{20}\cdot50=130 and Q3=200+60−5616⋅50=212.5Q_3=200+\dfrac{60-56}{16}\cdot50=212.5, so ΔQ=82.5\Delta_Q=82.5 kWh.
  7. Part III, question 2: 336. The upper limit is Q3+1.5 ΔQ=212.5+1.5⋅82.5=336.25Q_3+1.5\,\Delta_Q=212.5+1.5\cdot82.5=336.25, which rounds to 336336 kWh.