Inclusion–Exclusion Principle
The inclusion–exclusion principle counts elements in a union by adding the sizes of the sets and subtracting the overlaps. For three sets it continues with after subtracting all pairwise intersections.
LaTeX
|A\cup B|=|A|+|B|-|A\cap B|Variables
- number of elements of A
- elements in both sets
Example
How many integers from 1 to 100 are divisible by 2 or 3?
- (multiples of 6).
- .
Answer: .