Concept 02 / 10Sets, Relations and Functions
Set Operations, De Morgan's Laws and the Inclusion-Exclusion Principle
Union, intersection, difference, complement and symmetric difference, the algebra of sets and element-chasing proofs, and the inclusion-exclusion formulas for two and three sets, including 'exactly one', maximum and minimum overlap problems.
Once sets exist, we combine them. Work inside a universal set that contains everything under discussion. The basic operations are defined by what they do to a single element , and this element-wise view is the key to every proof in the topic.
Union: , where 'or' is inclusive. Intersection: . If the sets are disjoint. Difference: , which equals . Complement: . Symmetric difference: , the elements in exactly one of the two sets.
The algebra of sets mirrors the algebra of logic, with as 'or', as 'and' and complement as 'not'. Commutative laws: and . Associative laws: and likewise for . Distributive laws, which go both ways (unlike ordinary arithmetic): and . Identity and domination: , , , . Complement laws: , , .
De Morgan's laws are the most tested identities: and . In words, the complement turns unions into intersections and vice versa. Proof of the first by element chasing: it is not true that ( or ) and . Every step is reversible, so the sets are equal. Relative versions hold too: and .
Counting: inclusion-exclusion. For finite sets, adding and counts every element of twice, so we subtract it once:
. The Venn diagram shows the three disjoint regions , and whose sizes add up to . For three sets the same logic gives
.
Why add the triple intersection back? An element in all three sets is counted times in the first group, subtracted times in the second group, so it has been counted times; adding restores it to exactly once. The general principle alternates signs over intersections of sets, and it underlies the formulas for derangements and onto functions later in the course.
Region formulas that follow directly: ; the number in exactly one of is ; the number in neither is , which equals by De Morgan. For three sets, the number in exactly one set is , and the number in exactly two sets is .
Bounds on overlaps. Since , we get , and trivially . Since sits inside both sets, . So
.
The minimum is reached when the two sets are spread out as much as possible, the maximum when the smaller set sits entirely inside the larger.
Key Takeaways:
- ; .
- De Morgan: and .
- Both distributive laws hold: over and over .
- ; the three-set version adds back .
- Exactly one of : .
- .
- To prove an identity, either chase an element through both sides or reduce both sides to the same expression using the laws. A Venn diagram illustrates an identity but does not prove it.
- Pitfall: in general, and , not .
Brain-Teaser 1: In a class of students, like Mathematics and like Physics. What are the least and greatest possible numbers who like both? If every student likes at least one of the two, what is the answer?
Solution: With , and , the lower bound is , reached when nobody dislikes both. The upper bound is , reached when every Physics lover also likes Mathematics. So the overlap lies between and . If every student likes at least one subject, then is forced, and exactly. The extra condition collapses the range to a single value.
Brain-Teaser 2: Prove that without drawing a diagram.
Solution: Rewrite differences as intersections with complements and apply De Morgan. . Because is associative, commutative and idempotent (), this equals . The logic behind it: to be outside ' or ', an element must be outside and outside . Converting '' into ' complement' is the single most useful move in set algebra, because it turns every difference into something the standard laws can act on.
Brain-Teaser 3: How many integers from to are divisible by at least one of , , ? How many are divisible by none?
Solution: Let be the multiples of in to , so . A number is divisible by both and exactly when it is divisible by , so the intersections are multiples of the least common multiples. Then , , , , , and . Inclusion-exclusion gives . So are divisible by at least one, and by none. As a sanity check, the density of integers coprime to is , and , which agrees.
Practice this concept
Free · no account required · instant solutions