Step 1: The median of a grouped data is given by the formula:
\[
\text{Median} = \ell + \left( \frac{\frac{N}{2} - F}{f} \right) \times h
\]
where:
- \( \ell \) is the lower boundary of the median class,
- \( N \) is the total number of observations,
- \( F \) is the cumulative frequency before the median class,
- \( f \) is the frequency of the median class,
- \( h \) is the class width.
From the problem, we are given:
- Median class interval: 12-18,
- Median class frequency \( f = 12 \),
- \( \ell = 12 \),
- Median = 14,
- Number of students with marks less than 12 is 18.
Step 2: Using the formula:
\[
14 = 12 + \left( \frac{\frac{N}{2} - 18}{12} \right) \times 6
\]
Simplifying the equation:
\[
14 - 12 = \left( \frac{\frac{N}{2} - 18}{12} \right) \times 6
\]
\[
2 = \left( \frac{\frac{N}{2} - 18}{12} \right) \times 6
\]
\[
2 = \frac{\frac{N}{2} - 18}{2}
\]
\[
4 = \frac{N}{2} - 18
\]
\[
\frac{N}{2} = 22 \quad \Rightarrow \quad N = 44
\]