A class of 40 sports students includes 23 who play the tennis, 26 who play the baseball and 15 who play both the tennis and baseball. How many students in the class play neither sport?
If A and B are sets, then
$\displaystyle
|A \cup B|=|A|+|B|-|A \cap B|
$
So if we let A be the set of students who play tennis and B the set of students who play baseball, then:
$\displaystyle
|A \cup B|=23+26-15=34
$
So the number of students that play tennis or baseball is 34, thus the number of students who play neither is 40-34=6.