The number of elements in the union of 3 sets is given by
where |X| denotes the cardinality of the set X. This may be written
where α1 = |A| + |B| + |C|, α2 = |A ∩ B| + |A ∩ C| + |B ∩ C| and α3 = |A ∩ B ∩ C|. Now suppose that there are n sets instead of 3. Then the following, known as the inclusion–exclusion principle, holds:
where αi is the sum of the cardinalities of the intersections of the sets taken i at a time.