I need help

So 3 have no pets, so 25 - 3 = 22 students have a pet. There are 15 cats and 16 dogs so 15 + 16 = 31. And then 31 - 22 = 9. The 9 means that 9 students have both pets. So the probability is 9/25.

The probability that a student chosen at random has a cat and a dog = 9 / 25