The inclusion-exclusion principle

Sharad S. Sane · Texts and readings in mathematics · 2013

The inclusion-exclusion principle, is among the most basic techniques of combinatorics. Suppose we have a set X with subsets A and B. Then the number of elements that are in A or B (or both) i.e., the cardinality of A ∪ B is given by |A| + |B| − |A ∩ B|: The elements that are in both A and B were counted twice. To get rid of the over-counting, we must subtract. If A ¯ $${\bar A}$$ and B ¯ $${\bar B}$$ denote the complements of A and B respectively, then how many elements does the set A ¯ ∪ B ¯ $$\bar A \cup \bar B$$ have? This number is |X| − |A| − |B| + |A ∩ B|. The explanation is as before. From the set of all the elements we get rid of those that are in A or B. In doing so, we subtracted the elements of A ∩ B twice. This has to be corrected by adding such elements once. Essentially, this way of over-counting (inclusion), correcting it using under-counting (exclusion) and again correcting (overcorrection) and so on is referred to as the inclusion-exclusion technique. As another example, consider the question of finding how many positive integers up to 100 are not divisible by 2, 3 or 5. We see that there are 50 integers that are multiple of 2, 33 that are multiples of 3 and 20 that are multiples of 5. This certainly amounts to over-counting as there are integers that are divisible by two of the given three numbers 2, 3 and 5. In fact, the number of integers divisible by both 2 and 3 is 16, the number of integers divisible by both 2 and 5, that is divisible by 10 is 10. The number of integers divisible by both 3 and 5 is the number of integers below 100 and divisible by 15 and that number is 6. Finally the number of integers divisible by all of 2, 3 and 5 is just 3.

Read the paper · More papers on PaperTik