The number of students that choose to take two subjects—Math and Chemistry, Math and Physics, and Physics and Chemistry, respectively—can be represented by the variables a, b, and c.
Assume that a + b = 23 - 18 = 5 and b + c = 25 - 18 = 7.
The least value for any of the three is 5, as a, b, and c are not negligible.
We have a + c + 18 = (23 + 25 − 18). - 2b
The minimum number of students who selected chemistry was 23 + 25 − 18 − 10 = 20.