Average age of the class The average age of girls in a class of 42 students is 13 years. The average age of all the boys as well as the average age of 23 of the boys of the same class is 16 years. Which of the following could be the average age of the total students in the class? (in years)
a. 13.5
b. 14
c. 14.5
d. 15
I am looking for the trick of how to solve the above question.
 A: Let $b$ be the number of boys and $g$ be the number of girls, so $b + g = 42$, i.e., $g = 42 - b$ and the average age of all of them is
$$A = \frac{16b + 13(42 - b)}{42} = \frac{3b + 546}{42} \tag{1}\label{eq1}$$
As you've stated in a comment, the minimum # of boys is $23$ and the maximum # of girls is $19$, with \eqref{eq1} showing this gives an average value of
$$\frac{3 \times 23 + 546}{42} \approx 14.6 \tag{2}\label{eq2}$$
However, the number of boys could be larger, with the # of girls then being correspondingly smaller, so the average age would increase since the boy's average age is greater than that of girls. This is shown on the RHS of \eqref{eq1} as this value increases as $b$ increases. Thus, among the $4$ choices, only the last one, i.e., (d) of 15, could be the correct one.
As for determining what the # of boys would be to get, at least approximately, this answer, from \eqref{eq1} we have
$$15 = \frac{3b + 546}{42} \implies 630 = 3b + 546 \implies b = 28 \tag{3}\label{eq3}$$
Thus, the number of boys would be $28$ and the number of girls would be $42 - 28 = 14$.
