The ratio between the number of men and women in the city of Campo Verde is $\frac{2}{3}$. The average age of men is 37 years and that of women is 42 years. What is the average age of the inhabitants of Campo Verde?
If $H$ denotes the number of men and $M$ the number of women, then:

$$
\frac{H}{M}=\frac{2}{3} \quad \Rightarrow \quad M=\frac{3 H}{2}
$$

The average age of the population is:

$$
\frac{37 H+42 M}{H+M}=\frac{37 H+42 \frac{3 H}{2}}{H+\frac{3 H}{2}}=\frac{100 H}{\frac{5 H}{2}}=\frac{100 \times 2}{5}=40 \text { years. }
$$