PYQ Vault

SPI Mathematics · Statistics

Median and Mode of Grouped Data

For a frequency table, the median is found inside the class where the cumulative frequency first reaches half the total, and the mode inside the class with the highest frequency.

Why this matters

Ten questions in the bank, six of them EASY. Four only ask you to recognise the median or mode formula or one of its letters, three work out a median from a table, and the rest find the median class or the mode. The one HARD question has classes with gaps between them.

Concept 1 of 3: Cumulative frequency and the median class

The median is the value with half the data below it. Keep a running total of the frequencies down the table, and the class where that running total first reaches half the total is where the median lives.

Definition

  • Cumulative frequency (cf) of a class == its frequency plus all the frequencies before it.
  • The last cumulative frequency equals the total, N.
  • The median class is the first class whose cumulative frequency reaches N2\frac{N}{2}.
  • This is why a cumulative frequency table is needed to find the median.
  • The median class is not the class with the highest frequency. That one is the modal class.

Median class

median class: first class with cf≥N2\text{median class: first class with } cf \ge \frac{N}{2}

Worked example

The classes 0-10, 10-20, 20-30, 30-40 and 40-50 have frequencies 5, 8, 12, 9 and 6. Find the median class.
Practice this conceptself-check · 3 quick reps

The same idea in a practice question:

Practice questionModerate

Example 1 · Statistics · Median and Mode of Grouped Data

The class mark of the median class of the following data is:
Class Interval10−2510-2525−4025-4040−5540-5555−7055-7070−8570-8585−10085-100
Frequency237666

Picking the tallest class as the median class

The class with the largest frequency is the modal class. The median class is found from the cumulative frequencies and is often a different class.

Concept 2 of 3: The median formula

Inside the median class you still need to walk a little way. You arrive with cf values already counted, need N2\frac{N}{2}, and the class holds f values spread over a width h, so you go that share of the way across.

Definition

  • Median =l+N2−cff×h= l + \dfrac{\frac{N}{2} - cf}{f} \times h.
  • l is the lower limit of the median class, f its frequency and h its width.
  • cf is the cumulative frequency of the class BEFORE the median class, not of the median class itself.
  • If only mid-values are given, rebuild the classes first: mid-values 5, 15, 25 mean classes 0-10, 10-20, 20-30.
  • If a cumulative frequency equals N2\frac{N}{2} exactly, the median is the upper limit of that class.

Median of grouped data

Median=l+N2−cff×h\text{Median} = l + \frac{\frac{N}{2} - cf}{f} \times h
  • llower limit of the median class
  • Ntotal frequency
  • cfcumulative frequency of the class before the median class
  • ffrequency of the median class
  • hclass size

Worked example

The classes 0-20, 20-40, 40-60, 60-80 and 80-100 have frequencies 6, 10, 16, 5 and 3. Find the median.
Practice this conceptself-check · 3 quick reps

The same idea in a practice question:

Practice questionModerate

Example 2 · Statistics · Median and Mode of Grouped Data

The median of the following data is
Midvalue152535455565
Frequency42815201716

Using the median class's own cumulative frequency

cf in the median formula is the running total up to the class before the median class. Using the median class's own cumulative frequency makes N2−cf\frac{N}{2} - cf negative or too small.

Plugging mid-values in as limits

When a table lists mid-values, the lower limit l is the mid-value minus half the class size. A median class with mid-value 45 and size 10 has l = 40, not 45.

Concept 3 of 3: The mode formula

The mode sits in the tallest class, but it leans towards whichever neighbour is taller. The formula measures that lean by comparing the modal class with the class before it and the class after it.

Definition

  • The modal class is the class with the highest frequency.
  • Mode =l+f1−f02f1−f0−f2×h= l + \dfrac{f_1 - f_0}{2f_1 - f_0 - f_2} \times h.
  • f1f_1 is the frequency of the modal class, f0f_0 of the class before it, f2f_2 of the class after it.
  • Classes with gaps (1-5, 6-10, ...) must be made continuous first: subtract 0.5 from each lower limit and add 0.5 to each upper limit, so 6-10 becomes 5.5-10.5.

Mode of grouped data

Mode=l+f1−f02f1−f0−f2×h\text{Mode} = l + \frac{f_1 - f_0}{2f_1 - f_0 - f_2} \times h
  • llower limit of the modal class
  • f1f_1frequency of the modal class
  • f0f_0frequency of the class before it
  • f2f_2frequency of the class after it
  • hclass size

Worked example

The classes 0-10, 10-20, 20-30, 30-40 and 40-50 have frequencies 4, 10, 16, 12 and 6. Find the mode.
Practice this conceptself-check · 4 quick reps

The same idea in a practice question:

Practice questionHard

Example 3 · Statistics · Median and Mode of Grouped Data

For the following grouped frequency distribution, state the modal class and the mode
Weight in kg60-6263-6566-6869-7172-74
Number of workers51842278

Swapping f0 and f1 in the top line

The top of the mode fraction is f1−f0f_1 - f_0, the modal class minus the class before it. Writing f0−f1f_0 - f_1 makes it negative and puts the mode below the modal class.

Using classes with gaps as they are

For classes like 41-45 and 46-50, the true limits are 40.5-45.5 and 45.5-50.5. Using 46 as l without the 0.5 shift gives the wrong mode.

Summary — formulas & gotchas at a glance

A revision cheat-sheet for the formulas and gotchas above. Click any concept name to jump back to its full explanation.

Formulas (3)

  • Cumulative frequency and the median class

    Median class

    median class: first class with cf≥N2\text{median class: first class with } cf \ge \frac{N}{2}
  • The median formula

    Median of grouped data

    Median=l+N2−cff×h\text{Median} = l + \frac{\frac{N}{2} - cf}{f} \times h
  • The mode formula

    Mode of grouped data

    Mode=l+f1−f02f1−f0−f2×h\text{Mode} = l + \frac{f_1 - f_0}{2f_1 - f_0 - f_2} \times h

Watch out for (5)

Test yourself on a real paper

Sit a past SPI paper, timed and marked the way the exam marks it. You see your score and every answer the moment you finish. Free to start.