TITLE: Can the principle of inclusion/exclusion be used to count elements in the intersection of a sequence of sets?
QUESTION [8 upvotes]: The principle of inclusion-exclusion (PIE) is often used to count the number of elements in a union of $n$ sets in terms of an alternating sum of their various intersections:
$$
\left |\bigcup_{i \in [n]} A_i \right|  =\sum_{J \subseteq [n]}(-1)^{\left|J\right|-1}\left|\bigcap_{j \in J}A_j\right|
$$
where $[n] = \{1,...n\}$. I'm running a psychology experiment that requires subjects to count the number of elements in various sets and in various unions of these sets. I would like to be able to calculate from the behavioral data the $implied$ number of elements in any arbitrary intersection of these sets. It seems this can be performed by writing the PIE in the following recursive form:
$$
\left|\bigcap_{j \in J \subseteq [n]}A_j\right| = \left[\left|\bigcup_{i \in J}A_i\right| - \sum_{S \subsetneq J}(-1)^{\left|S\right|-1}\left|\bigcap_{s \in S}A_s\right|\right](-1)^{\left|J\right|-1}
$$
Two questions: (1) is this alternate (recursive) statement of the PIE correct? (2) If so, has anyone seen (or can they provide) a non-recursive solution that expresses the intersection of the $A_j's$ in terms of explicit unions only?

REPLY [5 votes]: You need to exclude the empty set in your sum.
Due to the duality between union and intersection, the inclusion–exclusion principle can be stated alternatively in terms of unions or intersections. Substituting the complements $\overline{A_i}$ for the $A_i$ in your first equation yields
$$
\left |\bigcup_{i \in [n]} \overline{A_i} \right|  =\sum_{\emptyset\ne J \subseteq [n]}(-1)^{\left|J\right|-1}\left|\bigcap_{j \in J}\overline{A_j}\right|
$$
and thus
$$
\left |\overline{\bigcap_{i \in [n]} A_i} \right|  =\sum_{\emptyset\ne J \subseteq [n]}(-1)^{\left|J\right|-1}\left|\overline{\bigcup_{j \in J}A_j}\right|\;.
$$
Since $|\overline{S}|=N-|S|$, with $N$ the total number of elements, this yields
$$
N-\left |\bigcap_{i \in [n]} A_i \right|  =\sum_{\emptyset\ne J \subseteq [n]}(-1)^{\left|J\right|-1}\left(N-\left|\bigcup_{j \in J}A_j\right|\right)\;.
$$
The sum over $N$ on the right would be $0$ if $J=\emptyset$ were included, so it cancels the $N$ on the left. Thus
$$
\left |\bigcap_{i \in [n]} A_i \right|  =\sum_{\emptyset\ne J \subseteq [n]}(-1)^{\left|J\right|-1}\left|\bigcup_{j \in J}A_j\right|\;,
$$
the dual form of the principle that you need.