Skip to content
Gioi Toan
Start learning
A bar chart with three bars, the tallest one smiling

Notes on Lesson 2: Median and quartiles of grouped data (Maths 11 Chan troi sang tao, Chapter V)

Lesson summary

The median MeM_e of grouped data is the value that divides the data sample, arranged in non-decreasing order, into two halves with the same number of data values in each half.

The quartiles of grouped data consist of three marks Q1Q_1, Q2Q_2, Q3Q_3 that divide the arranged sample into four parts, each with about n4\frac{n}{4} data values.

The median is the place that splits the team in half.

This content is not yet available in English. It is shown below in the original Vietnamese.

  • Tính được trung vị, tứ phân vị của mẫu số liệu ghép nhóm và giải thích ý nghĩa

You have seen a statistical table of the heights of a football team, where people only write groups like [150;155)[150;155), [155;160)[155;160) together with the number of players in each group, and do not write each player's height. So how can we know how tall the player in the middle of the team is, or below what level half the team is? This lesson helps you compute the median and the quartiles of grouped data, that is, the marks that split the whole team in half and in quarters in ascending order, and then understand what each of these numbers says about the data sample.

Practise similar problems

Key ideas: what do you need to know?

Median of grouped data

  • The median MeM_e of grouped data is the value that divides the data sample, arranged in non-decreasing order, into two halves with the same number of data values in each half.
  • Let nn be the sample size, that is, the sum of the frequencies. Suppose the group containing the median is group number pp: [um;um+1)[u_m; u_{m+1}), with frequency nmn_m, and C=n1+n2+...+nm−1C = n_1 + n_2 + ... + n_{m-1} is the sum of the frequencies of the groups before it. Then

Me=um+n2−Cnm⋅(um+1−um).M_e = u_m + \frac{\frac{n}{2} - C}{n_m} \cdot (u_{m+1} - u_m).

  • The group containing the median is the first group whose cumulative frequency is greater than or equal to n2\frac{n}{2}.
  • For example: with n=56n = 56 we have n2=28\frac{n}{2} = 28; if the cumulative frequencies of the groups are 3;15;30;54;563; 15; 30; 54; 56, then the third group is the group containing the median, because 30≥2830 \ge 28 while the second group only reaches 15<2815 < 28.
  • Meaning: from grouped data in general we cannot determine exactly the median of the original data sample. The median of grouped data is an approximation for the median of the original data sample and can be taken as a representative value for the data sample.

In plain words: The median is the place that splits the team in half. Picture the whole class lining up in ascending order of height: the student standing exactly in the middle of the line is the median. With a grouped table, you do not know where each student stands, so you have to find which group the middle position falls into: keep adding up the frequencies from the lowest group, and the group that passes half the sample size contains the median. Why does the formula have a part multiplied by the class width? Because within that group, the data values are considered spread evenly over the whole interval, so however many parts of the group you need, you add that many parts of the length. Note one subtle point: if the middle position falls exactly at the boundary between two consecutive groups, that is, the median is the average of two data values belonging to those two groups, then we simply take that common endpoint as the median.

Phrase by phrase
median
The value that divides the arranged sample into two halves with an equal number of data values, denoted MeM_e.Example: With n=56n = 56, the median is the level at which 2828 students are shorter than or equal to it and 2828 students are taller than or equal to it.
group containing the median
The first group whose cumulative frequency is greater than or equal to n2\frac{n}{2}.Example: n=56n = 56, cumulative frequency 3;15;30;54;563; 15; 30; 54; 56, then the third group contains the median.
cumulative frequency
The sum of the frequencies from the first group to the group being considered.Example: With frequencies 3;12;153; 12; 15, the cumulative frequency of the third group is 3030.
approximation for the median of the original data sample
Because the whole group has been replaced by an interval, the median computed is only an approximation to the true median of the individual original data values.Example: We can compute Me=18,1M_e = 18,1 minutes, while the true median of the 5656 original data values might be 1818 or 18,218,2 minutes.

First quartile and third quartile

  • The quartiles of grouped data consist of three marks Q1Q_1, Q2Q_2, Q3Q_3 that divide the arranged sample into four parts, each with about n4\frac{n}{4} data values.
  • To compute the first quartile Q1Q_1: suppose the group containing Q1Q_1 is group [um;um+1)[u_m; u_{m+1}), with frequency nmn_m, and C=n1+n2+...+nm−1C = n_1 + n_2 + ... + n_{m-1}. Then

Q1=um+n4−Cnm⋅(um+1−um).Q_1 = u_m + \frac{\frac{n}{4} - C}{n_m} \cdot (u_{m+1} - u_m).

  • To compute the third quartile Q3Q_3: suppose the group containing Q3Q_3 is group [uj;uj+1)[u_j; u_{j+1}), with frequency njn_j, and C=n1+n2+...+nj−1C = n_1 + n_2 + ... + n_{j-1}. Then

Q3=uj+3n4−Cnj⋅(uj+1−uj).Q_3 = u_j + \frac{\frac{3n}{4} - C}{n_j} \cdot (u_{j+1} - u_j).

  • The group containing Q1Q_1 is the first group whose cumulative frequency is greater than or equal to n4\frac{n}{4}; the group containing Q3Q_3 is the first group whose cumulative frequency is greater than or equal to 3n4\frac{3n}{4}.
  • The second quartile Q2Q_2 is exactly the median MeM_e.
  • If the kk quartile is 12(xm+xm+1)\frac{1}{2}(x_m + x_{m+1}), where xmx_m and xm+1x_{m+1} belong to two consecutive groups, then we take Qk=ujQ_k = u_j, with uju_j the common endpoint of those two groups.
  • For example: n=56n = 56 then n4=14\frac{n}{4} = 14 and 3n4=42\frac{3n}{4} = 42; with cumulative frequencies 3;15;30;54;563; 15; 30; 54; 56, the second group contains Q1Q_1 and the fourth group contains Q3Q_3.

In plain words: The median splits it in two, the quartiles split it in four. Just picture the line of classmates ordered by height: Q1Q_1 is the classmate standing at the one-quarter mark, Q2Q_2 is the one in the middle, Q3Q_3 is the one at the three-quarters mark. Finding them works exactly like finding the median, only the mark you aim for changes: n4\frac{n}{4} for Q1Q_1, n2\frac{n}{2} for Q2Q_2, 3n4\frac{3n}{4} for Q3Q_3. Why count cumulative frequency instead of comparing each frequency? Because the mark 1414 is the 1414 position in the whole line, and to know which group that position falls in you have to know how many classmates you have already counted past. As for taking Qk=ujQ_k = u_j when the mark lands exactly on a boundary: there the two data values sit right on either side of the shared endpoint, their average is approximately that endpoint itself, so taking the endpoint keeps it simple.

Phrase by phrase
quartile
The three marks Q1Q_1, Q2Q_2, Q3Q_3 divide the sorted sample into four equal parts.Example: n=56n = 56 then Q1Q_1 is at mark 1414, Q2Q_2 at mark 2828, Q3Q_3 at mark 4242.
first quartile
The one-quarter mark of the sample, computed with a formula of the same shape as the median but with n2\frac{n}{2} replaced by n4\frac{n}{4}.Example: Groups [12,5;15,5)[12,5;15,5), n=56n = 56, C=3C = 3, nm=12n_m = 12: Q1=12,5+14−312⋅3=15,25Q_1 = 12,5 + \frac{14 - 3}{12} \cdot 3 = 15,25.
third quartile
The three-quarters mark of the sample, computed with mark 3n4\frac{3n}{4}.Example: Groups [18,5;21,5)[18,5;21,5), n=56n = 56, C=30C = 30, nj=24n_j = 24: Q3=18,5+42−3024⋅3=20Q_3 = 18,5 + \frac{42 - 30}{24} \cdot 3 = 20.
The second quartile Q2Q_2 is exactly the median MeM_e
The halfway mark is both the second quartile and the median, no need to compute it again.Example: n=56n = 56: Q2=Me=18,1Q_2 = M_e = 18,1.

Common mistakesWhen finding the median, mistakenly taking the sum of the frequencies of the groups before the group containing the median as the cumulative frequency of that group itself. For example, with cumulative frequency 3;15;303; 15; 30, the third group contains the median, so C=15C = 15, not 3030.

Common mistakesWhen the mark falls exactly on the boundary between two consecutive groups (the cumulative frequency exactly equals the mark), thinking you must take the average of the two endpoints or handle it separately. No need: choosing the earlier group gives exactly the right endpoint of that group, choosing the later group gives exactly the left endpoint, the two ways coincide and match the convention Qk=ujQ_k = u_j.

What the median and quartiles mean

  • The three quartile points divide the sorted data sample into four equal parts. As with the median, in general you cannot determine the quartile points of grouped data exactly.
  • The set of three quartiles of grouped data is an approximate value for the quartiles of the original data sample and is used as a measure of the centre trend of the data sample.
  • The first and third quartiles measure the centre trend of the lower half (the data less than Q2Q_2) and the upper half (the data greater than Q2Q_2) of the data sample.
  • The median is little affected by a few outliers, so when the sample has strongly differing values, the median is more reliable than the mean for knowing the general level.
  • The range from Q1Q_1 to Q3Q_3 contains the middle half of the data; the narrower this range, the more concentrated the middle half of the sample, the wider it is, the more spread out the data.
  • Example: a median Internet browsing time of 18,118,1 minutes means half of you use it for no more than about 18,118,1 minutes; Q1=15,25Q_1 = 15,25 and Q3=20Q_3 = 20 tell us that the middle half of the class uses it from about 15,2515,25 to 2020 minutes each evening.

In plain words: Each number tells a story in its own way. The median says "the classmate in the middle of the whole group is at this level", so a few classmates with very large values cannot make it jump, unlike the mean. The quartiles tell about the two halves: Q1Q_1 tells you around what level the lower half of the group lies, Q3Q_3 tells you around what level the upper half lies. When to use which? If you want to describe the "typical level" of a sample with a few strongly differing values, use the median. If you want to know whether the group is even, look at the range from Q1Q_1 to Q3Q_3: a narrow range means the whole group is approximately alike, a wide range means some classmates are very low and some are very high.

Phrase by phrase
measure of centre trend
The number in the middle, representing the whole data sample.Example: The median height of the class is a measure of centre trend.
lower half
The part of the data less than Q2Q_2, that is, less than the median.Example: With Q2=18,1Q_2 = 18,1, the lower half is the classmates who use less than about 18,118,1 minutes.
upper half
The part of the data greater than Q2Q_2.Example: With Q2=18,1Q_2 = 18,1, the upper half is the classmates who use more than about 18,118,1 minutes.
little affected by a few outliers
A few values that are too large or too small hardly change the median, because the median only cares about the middle position.Example: Adding one classmate who uses 200200 minutes to the sample leaves the median almost unchanged, while the mean rises clearly.

How to present a median and quartile calculation

  • Step 1: Compute the sample size nn as the sum of the frequencies, then compute the marks you need: n4\frac{n}{4} for Q1Q_1, n2\frac{n}{2} for MeM_e, 3n4\frac{3n}{4} for Q3Q_3.
  • Step 2: Make a cumulative frequency table by adding up the frequencies from the first group to the last.
  • Step 3: Compare the mark with the cumulative frequency column to pick the right group: the first group whose cumulative frequency is greater than or equal to the mark.
  • Step 4: Write down clearly the left endpoint umu_m, the frequency nmn_m of that group, the total frequency CC of the previous groups and the class width um+1−umu_{m+1} - u_m, then substitute into the formula.
  • Step 5: Check that the result lies within the range of the group you just used; if it falls outside that range, you substituted the wrong numbers.
  • Example: with n=56n = 56, cumulative frequency 3;15;30;54;563; 15; 30; 54; 56 and groups of width 33, the group containing Q1Q_1 is the second group [12,5;15,5)[12,5;15,5), so Q1=12,5+14−312⋅3=15,25Q_1 = 12,5 + \frac{14 - 3}{12} \cdot 3 = 15,25, which indeed lies in [12,5;15,5)[12,5;15,5).

In plain words: This type of exercise is not hard because of the arithmetic, it is hard because you have to pick the right group and substitute the right numbers. Follow the exact order: find the marker first, add up the frequencies next, and only then substitute into the formula. When you substitute, read it aloud in your head: "left endpoint plus, marker minus cumulative frequency before the group, divide by the group frequency, multiply by the class width" so you do not mix things up. The final check is well worth it: the result must fall inside the very interval of the group you just used, because the median and quartiles lie in the group that contains them. If it comes out outside, you almost certainly took the wrong CC or the wrong class width.

Phrase by phrase
add up the frequencies
Take the frequency of the previous group plus the frequency of the group being considered to get the cumulative frequency.Example: Frequency 6;14;126; 14; 12 gives cumulative frequency 6;20;326; 20; 32.
left endpoint
The number umu_m comes first in the group notation [um;um+1)[u_m; u_{m+1}).Example: The group [15,5;18,5)[15,5;18,5) has left endpoint 15,515,5.
class width
The difference um+1−umu_{m+1} - u_m between the two endpoints of the group.Example: The group [15,5;18,5)[15,5;18,5) has class width 33.
check that the result lies in the interval of the group
The median and quartiles must fall in the group that contains them, use this to spot a wrong substitution.Example: Q3=20Q_3 = 20 must lie in [18,5;21,5)[18,5;21,5), that is right.

Common mistakesForgetting to check whether the result lies within the interval of the group just used. The median and quartiles must fall in the group that contains them; if the result is outside that interval, the wrong numbers were substituted.

TipThree marks to remember: n4\frac{n}{4} for Q1Q_1, n2\frac{n}{2} for the median MeM_e, 3n4\frac{3n}{4} for Q3Q_3. Just keep adding up the frequencies until you pass the mark, and you get the group that contains it.

TipThe formula for the median and the quartiles follows the same pattern: left endpoint plus (mark minus the sum of the frequencies of the previous groups) divided by the group frequency, times the class width. Only the mark and the chosen group differ.

TipAfter calculating, check that the result lies within the range of the group just used and Q1≤Me≤Q3Q_1 \le M_e \le Q_3; if it does not, the formula or the numbers were wrong.

A complete example

  • Given the time spent on the Internet each evening (minutes) of 5656 students: [9,5;12,5)[9,5;12,5) has 33 students; [12,5;15,5)[12,5;15,5) has 1212 students; [15,5;18,5)[15,5;18,5) has 1515 students; [18,5;21,5)[18,5;21,5) has 2424 students; [21,5;24,5)[21,5;24,5) has 22 students.
  • Sample size n=3+12+15+24+2=56n = 3 + 12 + 15 + 24 + 2 = 56, so n4=14\frac{n}{4} = 14, n2=28\frac{n}{2} = 28, 3n4=42\frac{3n}{4} = 42. Cumulative frequencies: 3;15;30;54;563; 15; 30; 54; 56.
  • Median: the first group to reach 2828 is the third group [15,5;18,5)[15,5;18,5), with C=15C = 15, nm=15n_m = 15, class width 33, so Me=15,5+28−1515⋅3=18,1M_e = 15,5 + \frac{28 - 15}{15} \cdot 3 = 18,1 minutes.
  • First quartile: the first group to reach 1414 is the second group [12,5;15,5)[12,5;15,5), with C=3C = 3, nm=12n_m = 12, so Q1=12,5+14−312⋅3=15,25Q_1 = 12,5 + \frac{14 - 3}{12} \cdot 3 = 15,25 minutes.
  • Third quartile: the first group to reach 4242 is the fourth group [18,5;21,5)[18,5;21,5), with C=30C = 30, nj=24n_j = 24, so Q3=18,5+42−3024⋅3=20Q_3 = 18,5 + \frac{42 - 30}{24} \cdot 3 = 20 minutes.
  • Conclusion: half of the students use no more than about 18,118,1 minutes each evening; the middle half of the class use from about 15,2515,25 to 2020 minutes.

In plain words: Notice that the three calculations share one pattern, only the marker and the group differ. For the median, the marker 2828 falls in the third group, so take the third group. For Q1Q_1, the marker 1414 falls in the second group, so take the second group, and CC is only 33, not 1515. For Q3Q_3, the marker 4242 goes past the third group (only 3030), so you must move to the fourth group. The easiest place to go wrong is taking the wrong CC: CC is always the sum of the frequencies of the groups before the chosen group, not the cumulative frequency of the chosen group. The results 15,25<18,1<2015,25 < 18,1 < 20 are in the right order, which is also a sign that your work is reasonable.

Phrase by phrase
marker
The values n4\frac{n}{4}, n2\frac{n}{2}, 3n4\frac{3n}{4} are used to compare with the cumulative frequency when choosing the group.Example: For n=56n = 56, the markers are 1414, 2828, 4242.
third group [15,5;18,5)[15,5;18,5)
The group containing the median in the example, because the cumulative frequency 3030 is the first to pass the marker 2828.Example: Me=15,5+28−1515⋅3=18,1M_e = 15,5 + \frac{28 - 15}{15} \cdot 3 = 18,1.
sum of the frequencies of the groups before the chosen group
This is exactly CC in the formula, not the cumulative frequency of the chosen group.Example: Choosing the fourth group gives C=3+12+15=30C = 3 + 12 + 15 = 30.

Common mistakesChoosing the group containing the median by comparing n2\frac{n}{2} with the individual frequency of each group instead of with the cumulative frequency, so the wrong group is chosen. You must compare with the cumulative frequency.

Worked examples

Example 1

The time (minutes) spent on the Internet each evening by 56 students is grouped as follows:
Group [9,5;12,5)[9,5;12,5): 3; group [12,5;15,5)[12,5;15,5): 12; group [15,5;18,5)[15,5;18,5): 15; group [18,5;21,5)[18,5;21,5): 24; group [21,5;24,5)[21,5;24,5): 2.
Calculate the median of this grouped data.

Show the solution to example 1

Step 1: Calculate the sample size n=3+12+15+24+2=56n = 3 + 12 + 15 + 24 + 2 = 56, giving n2=28\frac{n}{2} = 28.
Why: The median splits the sample into two halves of 28 values each, so the marker to find is 28.
Step 2: Make the cumulative frequency table: 3;15;30;54;563; 15; 30; 54; 56.
Why: Add up the frequencies to see at which group at least 28 values have been counted.
Step 3: The first group with cumulative frequency greater than or equal to 28 is the third group [15,5;18,5)[15,5;18,5), because 30≥2830 \ge 28 while the second group only reaches 15<2815 < 28.
Step 4: For the third group: left endpoint um=15,5u_m = 15,5, frequency nm=15n_m = 15, sum of the frequencies of the previous groups C=3+12=15C = 3 + 12 = 15, class width 18,5−15,5=318,5 - 15,5 = 3.
Step 5: Substitute into the formula:
Me=15,5+28−1515⋅3=15,5+1315⋅3=15,5+2,6=18,1.M_e = 15,5 + \frac{28 - 15}{15} \cdot 3 = 15,5 + \frac{13}{15} \cdot 3 = 15,5 + 2,6 = 18,1.
Why: The marker 28 goes past the first 15 values, 13 more values are still needed; in the third group each value takes up 315\frac{3}{15} minutes, so add 13⋅315=2,613 \cdot \frac{3}{15} = 2,6 minutes.
Result: Me=18,1M_e = 18,1 minutes. Check: 18,118,1 lies in [15,5;18,5)[15,5;18,5), which is reasonable.

Example 2

Using the data table from the previous example (56 students, groups 3 minutes wide), calculate the first quartile Q1Q_1 and the third quartile Q3Q_3.

Show the solution to example 2

Step 1: Sample size n=56n = 56, so n4=14\frac{n}{4} = 14 and 3n4=42\frac{3n}{4} = 42.
Why: Q1Q_1 is the one-quarter mark, Q3Q_3 is the three-quarter mark of the 56 quantitative data values.
Step 2: Cumulative frequency: 3;15;30;54;563; 15; 30; 54; 56.
Step 3: The first group to reach 14 is the second group [12,5;15,5)[12,5;15,5), because 15≥1415 \ge 14 while the first group only reaches 3<143 < 14.
Step 4: For the second group: um=12,5u_m = 12,5, nm=12n_m = 12, C=3C = 3, length 33.
Q1=12,5+14−312⋅3=12,5+1112⋅3=12,5+2,75=15,25.Q_1 = 12,5 + \frac{14 - 3}{12} \cdot 3 = 12,5 + \frac{11}{12} \cdot 3 = 12,5 + 2,75 = 15,25.
Why: The mark 14 goes past the first 3 quantitative data values, still 11 quantitative data values short; each quantitative data value in the second group takes up 312\frac{3}{12} minutes, so add 11⋅312=2,7511 \cdot \frac{3}{12} = 2,75 minutes.
Step 5: The first group to reach 42 is the fourth group [18,5;21,5)[18,5;21,5), because 54≥4254 \ge 42 while the third group only reaches 30<4230 < 42.
Step 6: For the fourth group: uj=18,5u_j = 18,5, nj=24n_j = 24, C=3+12+15=30C = 3 + 12 + 15 = 30, length 33.
Q3=18,5+42−3024⋅3=18,5+1224⋅3=18,5+1,5=20.Q_3 = 18,5 + \frac{42 - 30}{24} \cdot 3 = 18,5 + \frac{12}{24} \cdot 3 = 18,5 + 1,5 = 20.
Why: The mark 42 goes past the first 30 quantitative data values, still 12 quantitative data values short; each quantitative data value in the fourth group takes up 324\frac{3}{24} minutes, so add 12⋅324=1,512 \cdot \frac{3}{24} = 1,5 minutes.
Result: Q1=15,25Q_1 = 15,25 minutes; Q3=20Q_3 = 20 minutes. Check: 15,2515,25 lies in [12,5;15,5)[12,5;15,5), 2020 lies in [18,5;21,5)[18,5;21,5), and 15,25<18,1<2015,25 < 18,1 < 20, which is reasonable.

Common mistakesMixing up the quartile marks: using n2\frac{n}{2} for Q1Q_1 or n4\frac{n}{4} for Q3Q_3. The correct marks are n4\frac{n}{4} for Q1Q_1, n2\frac{n}{2} for MeM_e, 3n4\frac{3n}{4} for Q3Q_3.

Example 3

The height (cm) of 50 students in class 11A is grouped:
[145;150)[145;150): 6; [150;155)[150;155): 14; [155;160)[155;160): 10; [160;165)[160;165): 12; [165;170)[165;170): 8.
a) Calculate the median MeM_e.
b) Calculate Q1Q_1 and Q3Q_3.
c) From the results, give a simple comment about the height of the class.

Show the solution to example 3

Step 1: Sample size n=6+14+10+12+8=50n = 6 + 14 + 10 + 12 + 8 = 50, so n4=12,5\frac{n}{4} = 12,5, n2=25\frac{n}{2} = 25, 3n4=37,5\frac{3n}{4} = 37,5.
Step 2: Cumulative frequency: 6;20;30;42;506; 20; 30; 42; 50.
Step 3: a) The first group to reach 25 is the third group [155;160)[155;160), because 30≥2530 \ge 25 while the second group only reaches 20<2520 < 25.
For the third group: um=155u_m = 155, nm=10n_m = 10, C=6+14=20C = 6 + 14 = 20, length 55.
Me=155+25−2010⋅5=155+2,5=157,5.M_e = 155 + \frac{25 - 20}{10} \cdot 5 = 155 + 2,5 = 157,5.
Why: The mark 25 goes past the first 20 quantitative data values, still 5 quantitative data values short; each quantitative data value in the third group takes up 510\frac{5}{10} cm, so add 5⋅510=2,55 \cdot \frac{5}{10} = 2,5 cm.
Step 4: b) The first group to reach 12.5 is the second group [150;155)[150;155), because 20≥12,520 \ge 12,5 while the first group only reaches 6<12,56 < 12,5.
For the second group: um=150u_m = 150, nm=14n_m = 14, C=6C = 6, length 55.
Q1=150+12,5−614⋅5=150+6,514⋅5≈150+2,32=152,32.Q_1 = 150 + \frac{12,5 - 6}{14} \cdot 5 = 150 + \frac{6,5}{14} \cdot 5 \approx 150 + 2,32 = 152,32.
Why: The mark 12.5 goes past the first 6 quantitative data values, still 6.5 quantitative data values short; each quantitative data value in the second group takes up 514\frac{5}{14} cm, so add 6,5⋅514≈2,326,5 \cdot \frac{5}{14} \approx 2,32 cm.
Step 5: The first group to reach 37.5 is the fourth group [160;165)[160;165), because 42≥37,542 \ge 37,5 while the third group only reaches 30<37,530 < 37,5.
For the fourth group: uj=160u_j = 160, nj=12n_j = 12, C=6+14+10=30C = 6 + 14 + 10 = 30, length 55.
Q3=160+37,5−3012⋅5=160+7,512⋅5=160+3,125=163,125.Q_3 = 160 + \frac{37,5 - 30}{12} \cdot 5 = 160 + \frac{7,5}{12} \cdot 5 = 160 + 3,125 = 163,125.
Why: The mark 37.5 goes past the first 30 quantitative data values, still 7.5 quantitative data values short; each quantitative data value in the fourth group takes up 512\frac{5}{12} cm, so add 7,5⋅512=3,1257,5 \cdot \frac{5}{12} = 3,125 cm.
Step 6: c) An approximate median of 157,5157,5 cm means that half of the students are no taller than about 157,5157,5 cm. The range from Q1≈152,32Q_1 \approx 152,32 cm to Q3≈163,125Q_3 \approx 163,125 cm contains the middle half of the class, about 10,810,8 cm wide, which shows that heights in the class vary quite a lot.
Result: a) Me=157,5M_e = 157,5 cm; b) Q1≈152,32Q_1 \approx 152,32 cm, Q3≈163,125Q_3 \approx 163,125 cm; c) the middle half of the class is about 152,3152,3 cm to 163,1163,1 cm tall, so heights are quite spread out.

Example 4

The number of students in 100 classes is grouped, with cumulative frequency:
[36;38)[36;38): 9 (cumulative 9); [38;40)[38;40): 20 (29); [40;42)[40;42): 20 (49); [42;44)[42;44): 30 (79); [44;46)[44;46): 21 (100).
a) Calculate the median MeM_e.
b) A parent says "every class in this school has about 43 students". Is that comment reasonable?

Show the solution to example 4

Step 1: a) The sample size is n=9+20+20+30+21=100n = 9 + 20 + 20 + 30 + 21 = 100, so n2=50\frac{n}{2} = 50.
Step 2: Cumulative frequency: 9;29;49;79;1009; 29; 49; 79; 100. The first group to reach 50 is the fourth group [42;44)[42;44), because 79≥5079 \ge 50 while the third group only reaches 49<5049 < 50.
Step 3: For the fourth group: um=42u_m = 42, nm=30n_m = 30, C=9+20+20=49C = 9 + 20 + 20 = 49, class width 22.
Me=42+50−4930⋅2=42+230≈42,07.M_e = 42 + \frac{50 - 49}{30} \cdot 2 = 42 + \frac{2}{30} \approx 42,07.
Why: The mark 50 passes the first 49 data values by exactly 1 unit, still 1 data value short; in the fourth group each data value accounts for 230\frac{2}{30} students, so add 230≈0,07\frac{2}{30} \approx 0,07 students, and the result is very close to the left endpoint 42.
Step 4: b) A grouped median of 42,0742,07 means that half the classes have no more than about 42,0742,07 students, and the other half have more.
Step 5: Looking at the data table: 49 classes have fewer than 42 students (nearly half), only 30 classes fall in the group [42;44)[42;44), that is around 43, and 21 classes have 44 students or more.
Step 6: So saying "every class has about 43 students" is not reasonable: fewer than one-third of the classes are around 43, while nearly half the classes have fewer than 42 students.
Result: a) Me≈42,07M_e \approx 42,07 students; b) the parent's remark is not reasonable.

Example 5

A shoe shop recorded the shoe sizes sold in one month, with groups 1 size wide:
[36;37)[36;37): 8; [37;38)[37;38): 25; [38;39)[38;39): 40; [39;40)[39;40): 22; [40;41)[40;41): 5.
a) Find the median and the first and third quartiles.
b) Which sizes should the shop stock more of? If next month there are 10 more pairs of size 45 (group [45;46)[45;46)), how does the median change, and should it be used to decide what to stock?

Show the solution to example 5

Step 1: a) The sample size is n=8+25+40+22+5=100n = 8 + 25 + 40 + 22 + 5 = 100, so n4=25\frac{n}{4} = 25, n2=50\frac{n}{2} = 50, 3n4=75\frac{3n}{4} = 75.
Step 2: Cumulative frequency: 8;33;73;95;1008; 33; 73; 95; 100.
Step 3: Median: the first group to reach 50 is the third group [38;39)[38;39), because 73≥5073 \ge 50 while the second group only reaches 33<5033 < 50.
For the third group: um=38u_m = 38, nm=40n_m = 40, C=8+25=33C = 8 + 25 = 33, class width 11.
Me=38+50−3340⋅1=38+1740=38,425.M_e = 38 + \frac{50 - 33}{40} \cdot 1 = 38 + \frac{17}{40} = 38,425.
Step 4: Q1Q_1: the first group to reach 25 is the second group [37;38)[37;38), because 33≥2533 \ge 25 while the first group only reaches 8<258 < 25.
For the second group: um=37u_m = 37, nm=25n_m = 25, C=8C = 8, class width 11.
Q1=37+25−825⋅1=37+1725=37,68.Q_1 = 37 + \frac{25 - 8}{25} \cdot 1 = 37 + \frac{17}{25} = 37,68.
Step 5: Q3Q_3: the first group to reach 75 is the fourth group [39;40)[39;40), because 95≥7595 \ge 75 while the third group only reaches 73<7573 < 75.
For the fourth group: uj=39u_j = 39, nj=22n_j = 22, C=8+25+40=73C = 8 + 25 + 40 = 73, class width 11.
Q3=39+75−7322⋅1=39+222≈39,09.Q_3 = 39 + \frac{75 - 73}{22} \cdot 1 = 39 + \frac{2}{22} \approx 39,09.
Step 6: b) The largest group is [38;39)[38;39) with 40 pairs, so the shop should stock more of size 38. The median 38,42538,425 also points to around size 38.
Step 7: If 10 more pairs of size 45 are added (group [45;46)[45;46)), the new sample size is n′=110n' = 110, the median mark is n′2=55\frac{n'}{2} = 55. New cumulative frequency: 8;33;73;95;100;1108; 33; 73; 95; 100; 110. The first group to reach 55 is still the third group [38;39)[38;39), because 73≥5573 \ge 55.
Me′=38+55−3340⋅1=38+2240=38,55.M_e' = 38 + \frac{55 - 33}{40} \cdot 1 = 38 + \frac{22}{40} = 38,55.
Why: Adding 10 pairs of size 45 raises the median mark from 50 to 55, but it still lies in the third group, so the median only moves up a little.
Step 8: The median changes very little (from 38,42538,425 to 38,5538,55), while the mean would be pulled up noticeably. So use the median (or the mode) to decide what to stock, and do not use the mean when there is an outlier.
Result: a) Me=38,425M_e = 38,425, Q1=37,68Q_1 = 37,68, Q3≈39,09Q_3 \approx 39,09; b) stock more of size 38; the new median is 38,5538,55, still more reliable than the mean.

Terms

Grouped data
A table that divides the data into groups of the form [um;um+1)[u_m; u_{m+1}) together with the frequency of each group.Example: Group [15,5;18,5)[15,5;18,5) has 1515 students.
Sample size
The total number of data values, equal to the sum of the frequencies, denoted nn.Example: n=3+12+15+24+2=56n = 3 + 12 + 15 + 24 + 2 = 56.
Frequency
The number of data values falling into one group, denoted nmn_m for the mmth group.Example: Group [18,5;21,5)[18,5;21,5) has frequency 2424.
Cumulative frequency
The sum of the frequencies from the first group up to the group being considered, used to choose the group containing the median and quartile.Example: Frequency 3;12;153; 12; 15 gives cumulative frequency 3;15;303; 15; 30.
Median
The value that divides the ordered data sample into two equal halves, denoted MeM_e.Example: Me=18,1M_e = 18,1 minutes.
Quartile
The three marks Q1Q_1, Q2Q_2, Q3Q_3 divide the sorted sample into four equal parts.Example: Q1=15,25Q_1 = 15,25, Q2=18,1Q_2 = 18,1, Q3=20Q_3 = 20.
Second quartile
The mark that splits the sample in half, which is the median MeM_e.Example: Q2=Me=18,1Q_2 = M_e = 18,1.
Approximate value
A value calculated from the grouped table, only an approximation of the corresponding values of the original data sample.Example: The median 18,118,1 minutes is an approximation for the true median of the original 5656 data values.
Measuring central tendency
Use a single number in the middle to represent the whole data sample.Example: The quartile of the grouped data is used as a value measuring central tendency.