The second example is called the principle of inclusion-exclusion. Basically, it says that if you have a family of sets $F$ and you want to count the elements of $\cup F$, you can look at all subsets of $F$ and count the total number of elements in the intersection of each subset ... but with subsets with an odd number of things counting positively and subsets with an even number of things counting negatively. This is easy to see in the case where $F$ has two sets in it.
$$ | A \cup B | = -0 + |A| + |B| - |A \cap B|$$
In this case $F = \{A, B\}$, the singleton subsets have an odd number of elements, $F$ itself and the empty set each count negatively.
It can be succinctly written as:
$$ \left|\cup F \right| = \sum_{x \in P(F)} (-1)^{(|x|+1)} \cdot | \cap x | $$
With $P(F)$ being the powerset of $F$ (i.e. the set of all subsets).
The first example does not have a name, but is given by the following formula:
$$ \left| A \setminus (\cup F) \right| = \sum_{x \in P(F)} (-1)^{\left|x\right|} \cdot \left|A \cap (\cap x)\right| $$
Here's the derivation for this formula, assuming we believe the principle of inclusion-exclusion given above
start with expression we want.
$$ | A \setminus (\cup F) | $$
cardinality of relative complement.
$$ | A | - \left|A \cap \left(\bigcup_{B \in F} B \right)\right| $$
distributive property
$$ | A | - \left|\left(\bigcup_{B \in F} A \cap B \right)\right| $$
let $G$ be defined as $ \{ A \cap x \;\text{where}\; x \in F \} $.
$$ |A| - |\cup G| $$
apply principle of inclusion-exclusion
$$ |A| - \sum_{x \in P(G)} (-1)^{(|x| + 1)} \cdot |\cap x| $$
Here's where we remember that $\cap x$ refers to the intersection of a subset of $G$. The elements of $G$ are the elements of $F$, except that I intersected each element with the set $A$. I can perform this intersection last instead of first, as below.
$$ |A| - \sum_{x \in P(F)} (-1)^{(|x|+1)} \cdot |A \cap (\cap x)| $$
combining into a single sum:
$$ \left| A \setminus (\cup F) \right| = \sum_{x \in P(F)} (-1)^{\left|x\right|} \cdot \left|A \cap (\cap x)\right| $$
Best Answer
The first set consists of all the elements that are in at least $k$ of the $A_i$
The second set consists of all the elements that are in every union of $k$ $A_i$. So an element is not in the set if we can find $k$ $A_i$ that do not contain it, that is, the second set consists of all the elements that are in at least $n-k+1$ $A_i$