Question: Find the median.
X f
10 12
20 4
30 8
40 5
50 2
1. **State the problem:** We are given a frequency distribution with values $X$ and their frequencies $f$. We need to find the median of this data.
2. **List the data:**
| $X$ | $f$ |
|-----|-----|
| 10 | 12 |
| 20 | 4 |
| 30 | 8 |
| 40 | 5 |
| 50 | 2 |
3. **Calculate the total frequency $n$:**
$$n = 12 + 4 + 8 + 5 + 2 = 31$$
4. **Find the median position:**
The median is the value at position $$\frac{n+1}{2} = \frac{31+1}{2} = 16$$th value.
5. **Calculate cumulative frequencies (CF):**
| $X$ | $f$ | $CF$ |
|-----|-----|------|
| 10 | 12 | 12 |
| 20 | 4 | 16 |
| 30 | 8 | 24 |
| 40 | 5 | 29 |
| 50 | 2 | 31 |
6. **Locate the median class:**
The 16th value lies in the class where cumulative frequency first reaches or exceeds 16, which is at $X=20$.
7. **Since the data is discrete and given as individual values, the median is the $X$ value corresponding to the 16th observation, which is $20$.**
**Final answer:**
$$\boxed{20}$$