KCSE 2025 Maths P1 Q23 — Statistics: Mean & Median from Grouped Data

KCSE 2025 Form 4 Statistics

Published

The Question

“The quantity of petrol in litres used by 40 boda boda riders on a particular day is recorded, and one litre of petrol costs Ksh 160. Starting with 1.5 litres and using a class size of 0.5, draw a frequency distribution table for the data. Then use the table to estimate the mean amount of money spent on petrol by the riders that day, and the median amount of money spent on fuel by the median rider.”

1

Group the data into classes

Start the first class at 1.5 litres and step up by 0.5 each time until every reading is covered. Tallying the 40 readings into these classes gives the frequencies below, which add up to 40 as a check that no rider was missed.

1.51.9: 72.02.4: 82.52.9: 111.5\text{--}1.9:\ 7 \quad 2.0\text{--}2.4:\ 8 \quad 2.5\text{--}2.9:\ 11
3.03.4: 73.53.9: 44.04.4: 33.0\text{--}3.4:\ 7 \quad 3.5\text{--}3.9:\ 4 \quad 4.0\text{--}4.4:\ 3
7+8+11+7+4+3=407 + 8 + 11 + 7 + 4 + 3 = 40
2

Find each midpoint and the product fx

For grouped data we assume every value in a class sits at the class midpoint, found by averaging the two class limits. Multiplying each midpoint by its frequency gives fx, and adding these up estimates the total litres used by all 40 riders.

midpoints x: 1.7, 2.2, 2.7, 3.2, 3.7, 4.2\text{midpoints } x: \ 1.7,\ 2.2,\ 2.7,\ 3.2,\ 3.7,\ 4.2
fx=11.9+17.6+29.7+22.4+14.8+12.6=109\sum fx = 11.9 + 17.6 + 29.7 + 22.4 + 14.8 + 12.6 = 109
3

Estimate the mean amount spent

The mean number of litres is the total litres divided by the number of riders. Because each litre costs 160 shillings, multiply the mean litres by 160 to get the mean amount of money spent.

xˉ=fxf=10940=2.725 litres\bar{x} = \frac{\sum fx}{\sum f} = \frac{109}{40} = 2.725 \text{ litres}
2.725×160=436 shillings2.725 \times 160 = 436 \text{ shillings}
4

Locate the median class

With 40 riders the median position is the 20th value. Building cumulative frequencies shows the running total reaches 15 after the second class and 26 after the third, so the 20th value falls inside the third class, whose real (continuous) boundaries are 2.45 to 2.95.

cumulative frequency: 7, 15, 26, 33, 37, 40\text{cumulative frequency: } 7,\ 15,\ 26,\ 33,\ 37,\ 40
402=20median lies in the class 2.452.95\frac{40}{2} = 20 \Rightarrow \text{median lies in the class } 2.45\text{--}2.95
5

Apply the median formula

Interpolate within the median class using its lower boundary, the frequency already counted before it, the frequency of the class itself, and the class width. Then convert the median litres into money at 160 shillings per litre.

M=L+(N2cff)×cM = L + \left(\frac{\frac{N}{2} - cf}{f}\right) \times c
M=2.45+(201511)×0.5=2.677 litresM = 2.45 + \left(\frac{20 - 15}{11}\right) \times 0.5 = 2.677 \text{ litres}
2.677×160428 shillings2.677 \times 160 \approx 428 \text{ shillings}

Final Result

The mean amount spent on petrol is about Ksh 436, and the median amount spent is about Ksh 428.

Why this method works

When data is grouped we no longer know each exact value, so we approximate every reading by its class midpoint; summing the midpoints weighted by frequency estimates the true total, and dividing by the number of riders gives a fair average. The median formula works by interpolation: it assumes the 11 values in the median class are spread evenly across its width, so the 20th value sits five-elevenths of the way into that class above the 15 already counted. Multiplying by 160 simply converts the estimated litres into shillings, since cost rises in direct proportion to fuel used.

Mean check: 109 ÷ 40 = 2.725, and 2.725 × 160 = 436. Median check: 2.45 + (5 ÷ 11) × 0.5 = 2.677, and 2.677 × 160 ≈ 428.