Inclusion-Exclusion Principle See: Rosen, p.239 (Section 4.1) Brualdi, Chapter 6 (p.153) any decent reference Possesses Property "A" Possesses Property "B" Very often it is easier to count “sub-categories” of some sort, then add up these answers to find the total. The ‘Addition Principle’ specifies that as long as the sub-categories don’t overlap and our subcategories are extensive enough to include all the items we need to count, the total count = the sum of the sub-counts. For two subcategories, it is relatively easy to compensate for overlap between the subcategories: πππ‘ππ πΆππ’ππ‘ = (# πππ π ππ π πππ "π΄") + (# πππ π ππ π πππ "π΅") − (# πππ π ππ π πππ π΄ πππ π΅) (Using set notation: |π΄ ∪ π΅| = |π΄| + |π΅| − |π΄ ∩ π΅|.) Direct Example: How many numbers between 1 and 30 are divisible by 3 or 5? A list to let us check: 3, 5, 6, 9, 10, 12, 15, 18, 20, 21, 24, 25, 27, 30 Example related to the concept: There are twelve dogs romping in a park. Seven of the dogs have some white spots on them. Six of the dogs have some black spots on them. If three dogs don’t have any spots at all, then how many dogs have both black spots and white spots? For more than two categories, the situation is a bit more complex: "A" "B" "C" πππ‘ππ = ("A") + ("π΅") + ("πΆ") − (π΄&π΅) − (π΅&πΆ) − (π΄&πΆ) + (π΄&π΅&πΆ) Using set notation: |π΄ ∪ π΅ ∪ πΆ| = |π΄| + |π΅| + |πΆ| − |π΄ ∩ π΅| − |π΄ ∩ πΆ| − |π΅ ∩ πΆ| + |π΄ ∩ π΅ ∩ πΆ|