In a class of 40 students, 18 said they liked apple pie, 12 said they liked chocolate cake, and 15 said they did not like either. How many students in the class liked both?
25 liked one or the other - or both
N ( A or C) = N(A) + N (C) - N (A and C)
25 = 18 + 12 - N(A and C)
25 = 30 - N(A and C)
N(A and C) = 30 -25
N(A and C) = 5