given:
total students: 27
basketball: 7
baseball: 18
neither: 7
students who play either basketball or baseball: 27-7=20
18+7=25
25-20=5 <- number of students who play both basketball or baseball
number of students who play both/total
5/27 is your answer