In an examination 31 candidate passed chemistry 29 passed physics and 3 fail both subjects if 50 candidate sat for the examination how many of them passed chemistry only

again?

If x passed both, then
31+29-x = 50-3
find x, and then 31-x passed chem only