Two sets
You add both sets, then subtract the overlap once, since it was counted twice.
Three sets
The pattern continues for more sets: alternately add all single sets, subtract all pairwise intersections, add all triple intersections, subtract all quadruple intersections, and so on.
Common trap: “at least” vs. “exactly”
Inclusion-exclusion directly computes “in at least one of the sets.” If a problem asks for “exactly one” or “exactly two,” you need a modified formula (or careful casework) — don't reach for the standard inclusion-exclusion sum without checking which phrasing you actually have.
Worked example
Problem: How many integers from 1 to 100 are divisible by 2 or by 5?
Solution: Let = multiples of 2, = multiples of 5., , and = multiples of 10 = .
Practice problems
1.Of 50 students, 30 take French and 25 take Spanish, with 12 taking both. How many take at least one of the two languages?
2.How many integers from 1 to 60 are divisible by 3 or 4?
3.In a class of 40, 18 like math, 15 like science, 10 like both. How many like neither?
4.How many integers from 1 to 100 are divisible by 2, 3, or 5?