# Counting problem involving sets

Let $S$ be a set of size $37$, and let $x$,$y$, and $z$ be three distinct elements of $S$.

1. How many subsets of $S$ are there that contain x and $y$, but do not contain $z$?
2. How many subsets of $S$ are there that contain x or $y$, but do not contain $z$?

I got these questions during a midterm exam and I felt like I didn't have enough information to solve them. Is there like a formula to these kind of questions? Can you please provide explanations to the answers?

Thanks

For the first case, you have 37 elements in all, but are excluding $z$, leaving 36.
1. If both $x$ and $y$ are included, you get to choose only the other 34 elements, giving $2^{34}$ possible sets.
2. If you decide to include $x$, by the same reasoning above you get $2^{35}$ subsets, if you include $y$ again $2^{35}$; but that counts the sets containing $x$ and $y$ twice (once in each collection) and you have to discount them, so the result is $2 \cdot 2^{35} - 2^{34}$.