In a class of 40 students, 32 offer mathematics, 24 offer Physics, and 4 offer…