Mathematics in Action

Median, Q1, and Q3

Example 4.1.10 on p.114
Find the median, lower half, and upper half of the daily sales data set for the Home Town Pharmacy of ex. 4.1.1.
First Step: List all the data points in increasing order.
The Location of a data point is where it is in the ordered data set. Ex. the smallest number is location 1, the next number is location 2, and so on.

Data Set [$975, $1,225, $1,339, $1,732, $1,781, $2,218, $2,548]
Location 1 2 3 4 5 6 7

Data Set [$975, $1,225, $1,339, $1,732, $1,781, $2,218, $2,548]
Location 1 2 3 4 5 6 7

The middle number on the list is $1,732. This is the Median.

The points below the median are $975, $1,225, and $1,339.
So the Lower Half is [$975, $1,225, $1,339]

The median of the Lower Half is $1,225. So Q1=$1,225.

The points above the median are $1,871, $2,218, and $2,548.
So the Upper Half is [$1,781, $2,218, $2,548].

The median of the Upper Half is $2,218. So Q3=$2,218.

The 5-Number summary for this example is [Min=$975; Q1=$1,225; Median=$1,732; Q3=$2,218; Max=$2,548].

Example 4.1.11:

Find the median, lower half, and upper half of the following sorted data set.

Data Set [$75K, $96K, $107K, $110K, $110K, $118K, $130K, $135K, $150K, $520K]
Location 1 2 3 4 5 6 7 8 9 10

Data Set [$75K, $96K, $107K, $110K, $110K, $118K, $130K, $135K, $150K, $520K]
Location 1 2 3 4 5 6 7 8 9 10

There is no middle number on the list.
The Median is ($110K+$118K)/2 = $114K.

The Lower Half is [$75K, $96K, $107K, $110K, $110K]. The median of the Lower Half is Q1=$107K.

The Upper Half is [$118K, $130K, $135K, $150K, $520K]. The median of the Upper Half is Q3=$135K.

The 5-number summary for this example is [Min=$75K; Q1=$107K; Median=$114K; Q3=$135K, Max=$520K].

Example 4.1.12

Find the median, lower half, and upper half of the following sorted data set.

Data Set [3, 5, 5, 6, 6, 6, 8, 11]
Location 1 2 3 4 5 6 7 8

Data Set [3, 5, 5, 6, 6, 6, 8, 11]
Location 1 2 3 4 5 6 7 8
There is no middle number on the list.
The Median is (6+6)/2 = 6.

The Lower Half is [3, 5, 5, 6]. The median of the Lower Half is Q1 = (5+5)/2 = 5

The Upper Half is [6, 6, 8, 11]. The median of the Upper Half is Q3 = (6+8)/2 = 7

The 5-number summary for this example is [Min=3; Q1=5; Median=6; Q3=7; Max=11].

Example:

Data Set [20, 20, 21, 21, 21]
Location 1 2 3 4 5

Data Set [20, 20, 21, 21, 21]
Location 1 2 3 4 5

The Median is 21.

The Lower Half is [20, 20]. The median of the Lower Half is Q1 = (20+20)/2 = 20.

The Upper Half is [21, 21]. The median of the Upper Half is Q3 = (21+21)/2 = 21

The 5-number summary for this data set is [Min=20; Q1=20; Median=21; Q3=21; Max=21].

Using Big Data Sets and Cumulative Frequency Tables



Example 4.1.14

Age 22 25 26 27 28 29 30 32 35 39
Freq. 3 4 3 5 4 6 5 4 5 2



Age 22 25 26 27 28 29 30 32 35 39
Freq. 3 4 3 5 4 6 5 4 5 2
Cumul. Freq. 3 7 10 15 19 25 30 34 39 41

Age at location 10:

Age 22 25 26 27 28 29 30 32 35 39
Freq. 3 4 3 5 4 6 5 4 5 2
Cumul. Freq. 3 7 10 15 19 25 30 34 39 41
The age at location 10 is 26.

Age at location 11:

Age 22 25 26 27 28 29 30 32 35 39
Freq. 3 4 3 5 4 6 5 4 5 2
Cumul. Freq. 3 7 10 15 19 25 30 34 39 41
The age at location 11 is 27.

Age at location 31:

Age 22 25 26 27 28 29 30 32 35 39
Freq. 3 4 3 5 4 6 5 4 5 2
Cumul. Freq. 3 7 10 15 19 25 30 34 39 41
The age at location 31 is 32.

Age at location 32:

Age 22 25 26 27 28 29 30 32 35 39
Freq. 3 4 3 5 4 6 5 4 5 2
Cumul. Freq. 3 7 10 15 19 25 30 34 39 41
The age at location 32 is 32.

Median: There are 41 people in the police dept. So n=41. Since 41 is odd, the median is at location (41 + 1) / 2 = 42/2 = 21.
Age at location 21:

Age 22 25 26 27 28 29 30 32 35 39
Freq. 3 4 3 5 4 6 5 4 5 2
Cumul. Freq. 3 7 10 15 19 25 30 34 39 41
The age at location 21 is 29. The Median age is 29.

To Find Q1: There are 41 data points. The median is the age at location 21. This age is 29. We know all this already. Let's look just at the 29's. The Cumul. Frequency table shows that there are 6 29's, the first one is at location 20 and the last one is in location 25.

Part of Data Set: 29, 29, 29, 29, 29, 29,
Location 20 21 22 23 24 25

Part of Data Set 29, 29, 29, 29, 29, 29
Location 20 21 22 23 24 25
So let's make a Cumulative frequency table for the lower half: Note there is only 1 29 in the Lower Half and 4 29's in the Upper Half.
Lower Half:

Age 22 25 26 27 28 29
Freq. 3 4 3 5 4 1



Lower Half

Age 22 25 26 27 28 29
Freq. 3 4 3 5 4 1
Cumul. Freq. 3 7 10 15 19 20


There are 20 data points in the lower half. 20 is even, so we look at ages in locations (20/2)=10 and ((20/2)+1)=11 and take their average. The age at location 10 is 26. The age at location 11 is 27. So Q1 = (26+27)/2 = 26.5

To Find Q3:
Upper Half:

Age 29 30 32 35 39
Freq. 4 5 4 5 2



Upper Half

Age 29 30 32 35 39
Freq. 4 5 4 5 2
Cumul. Freq. 4 9 13 18 20


There are 20 data points in the Upper Half. Q3 is the average of the ages at the 10th and 11th locations in the Upper Half.
The age at location 10 is 32. The age at location 11 is 32.
Q3 = (32+32)/2 = 32

The 5-number summary is [Min=22; Q1=26.5; Median=29; Q3=32; Max=39].

Example:

Find the median quiz grade.

Quiz Grade 0 2 3 4 5 6 8 9 10
Freq. 3 1 2 4 1 1 3 6 3
Cumul. Freq. 3 4 6 10 11 12 15 21 24
There were 24 students who took the quiz. So n=24.
Since 24 is even, the median is the average of locations 24/2 = 12 and (24/2) + 1 = 13.

The grade at location k=12 is 6.
The grade at location k=13 is 8.

So the Median is ( 6 + 8 ) / 2 = 7.

To Find Q1 and Q3:
The median had something to do with locations 12 and 13. (Which correspond to grades of 6 and 8). Let's look at just that part of the data set with all the 6's and 8's:

Part of Data Set: 6, 8, 8, 8,
Location 12 13 14 15

Part of Data Set 6, 8, 8, 8,
Location 12 13 14 15


Lower Half

Quiz Grade 0 2 3 4 5 6
Freq. 3 1 2 4 1 1
Cumul. Freq. 3 4 6 10 11 12
There are 12 data points in the Lower Half.
The Median of a set with 12 data points is the average of the values in locations 6 and 7.
The grade at location 6 is a 3. The grade at location 7 is a 4.
Q1 = (3+4)/2 = 3.5


Upper Half

Quiz Grade 8 9 10
Freq. 3 6 3
Cumul. Freq. 3 9 12
There are 12 data points in the Upper Half, so the median is the average of the ages at locations 6 and 7. So Q3 = (9+9)/2 = 9.

The 5-number summary is [Min=0; Q1=3.5; Median=7; Q3=9; Max=10].

Remember, this table simplifies the data set:

Grade: [0, 0, 0, 2, 3, 3, 4, 4, 4, 4, 5, 6, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 10]
Location 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24

Grade: [0, 0, 0, 2, 3, 3, 4, 4, 4, 4, 5, 6, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 10]
Location 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24

Here, as before, the purple is the Lower Half.
The green is the Upper Half.
The median is the average of 6 and 8. So the median grade is (6+8)/2 = 7.

Example:

What is the median quiz grade given the following data?

Quiz Grade 2 3 4 5 6 8 9 10
Freq. 1 2 4 1 1 3 6 2
Cumul. Freq. 1 3 7 8 9 12 18 20


There are 20 quiz grades. n=20.
The median is average of ages at locations (20/2)=10 and (20/2)+1=11.
The grade at location k=10 is 8. The grade at location k=11 is 8.
The median grade is (8+8)/2.


Part of Data Set: 8, 8, 8,
Location 10 11 12

Part of Data Set 8, 8, 8,
Location 10 11 12

So we see there is 1 8 in the Lower half and 2 8's in the Upper half.

Lower Half

Quiz Grade 2 3 4 5 6 8
Freq. 1 2 4 1 1 1
Cumul. Freq. 1 3 7 8 9 10
There are 10 data points in the lower half. So its median (which is Q1) is the average of the grades in locations (10/2)=5 and (10/2)+1=6.
So Q1 = (4+4)/2 = 4

Upper Half

Quiz Grade 8 9 10
Freq. 2 6 2
Cumul. Freq. 2 8 10
There are 10 data points in the Upper Half. So its median (which is Q3) is the average of the grades in locations (10/2)=5 and (10/2)+1=6.
So Q3 = (9+9)/2 = 9


So the 5-number summary is [Min=2; Q1=4; Median=8; Q3=9; Max=10].



Remember, this table simplifies the data set:

Grade: [2, 3, 3, 4, 4, 4, 4, 5, 6, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10]
Location 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Grade: [2, 3, 3, 4, 4, 4, 4, 5, 6, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10]
Location 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20