2009 Grade 8 CEMC Gauss Problems/Problem 18

Problem

In a class of $40$ students, $18$ said they liked apple pie, $15$ said they liked chocolate cake and $12$ said they did not like either. How many students in the class liked both?

$\text{ (A) }\ 15 \qquad\text{ (B) }\ 10 \qquad\text{ (C) }\ 3 \qquad\text{ (D) }\ 7 \qquad\text{ (E) }\ 5$

Solution

Let $x$ be the number of students in the class that liked both apple pie and chocolate cake. This means that $18 - x$ students liked apple pie but not chocolate cake, and $15 - x$ students liked chocolate cake but not apple pie.

We can now add up the individual amounts for people that liked one, both, or neither, and set it equal to the number of students in the class, which is $40$:

$18 - x + 15 - x + x + 12 = 40$

Adding numbers and like-terms together, we get:

$45 - x = 40$

Adding $x$ to both sides, we get:

$x + 40 = 45$

Subtracting $40$ from both sides, we get:

$x = \boxed {\textbf{(E) } 5}$

~anabel.disher