Step 1: Form equations using total frequency = 90
| Class | Frequency | Cumulative Frequency (cf) |
|-------|-----------|--------------------------|
| 20–30 | p | p |
| 30–40 | 15 | p + 15 |
| 40–50 | 25 | p + 40 |
| 50–60 | 20 | p + 60 |
| 60–70 | q | p + 60 + q |
| 70–80 | 8 | p + 68 + q |
| 80–90 | 10 | p + 78 + q |
Sum of frequencies: $p + 15 + 25 + 20 + q + 8 + 10 = 90$
$$p + q + 78 = 90 \implies p + q = 12 \quad \cdots (1)$$
Step 2: Identify median class
$\dfrac{n}{2} = \dfrac{90}{2} = 45$
Median = 50, so the median class is 40–50 (cf just before it is $p + 15$, and cf after it is $p + 40$, which must be ≥ 45).
Here: $l = 40,\ f = 25,\ cf = p + 15,\ h = 10$
Step 3: Apply median formula
$$50 = 40 + \left(\frac{45 - (p+15)}{25}\right) \times 10$$
$$10 = \frac{(30 - p)}{25} \times 10$$
$$25 = 30 - p \implies p = 5$$
Step 4: Find q
From (1): $5 + q = 12 \implies q = 7$
$$\boxed{p = 5, \quad q = 7}$$
Source: Statistics, Section 13.4 Median of Grouped Data, Chapter 13
---