Let the number of people that offer both Mathematics and Physics = y
Then, (32−y)+y+(24−y)+4=40
60−y=40impliesy=20
∴ 20 students offer both Mathematics and Physics.