combinatorics

Definition

Inclusion-Exclusion Principle

The Inclusion-Exclusion Principle states that the number of elements in the union of finite sets is given by:

using an index set and sum over all non-empty index subsets .

Example

3 Intersecting Sets

When creating the union over all sets , the number of unique elements in that set can be computed by:

However, there might be intersections between two of those sets, meaning that some elements are counted multiple times. Therefore, the intersections need to be subtracted:

Another problem arises: The intersection is subtracted more than once. Therefore, we need to add it back to the equation: