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