Sets and the Principle of Inclusion-Exclusion
Core Titles
Key headlines and terms for quick recall- Set — well-defined collection of distinct objects
- Subset, Proper Subset, Power Set ()
- Union ∪, Intersection ∩, Complement, Difference, Symmetric Difference
- Cartesian Product
- Cardinality
- Principle of Inclusion–Exclusion (PIE)
- De Morgan's Laws
Basic Idea
What it is, why it matters, how it worksWhat is a set?
A set is a well-defined collection of distinct objects called elements. We write if is in . Sets are described by roster (listing: ) or set-builder form ().
Key operations
- Union:
- Intersection:
- Difference:
- Complement: (relative to universal set )
- Cartesian product: , so
- Power set: has elements.
Principle of Inclusion–Exclusion (PIE)
Why it matters: When sets overlap, simple addition double-counts. PIE corrects this.
For two sets:
For three sets:
General form for sets — alternately add and subtract intersections of every size.
De Morgan's Laws
Why this matters in Data Science
Sets underpin database queries (SQL UNION/INTERSECT), feature engineering, and probability (events are sets of outcomes).
Mind Map
Visual structure of the conceptSETS
├── Definition (well-defined, distinct elements)
├── Representations
│ ├── Roster {1,2,3}
│ └── Set-builder {x : P(x)}
├── Operations
│ ├── Union ∪
│ ├── Intersection ∩
│ ├── Complement Aᶜ
│ ├── Difference A − B
│ └── Cartesian product A × B
├── Special sets
│ ├── Empty ∅
│ ├── Universal U
│ └── Power set 𝒫(A), size 2^|A|
└── Counting (PIE)
├── 2 sets: |A∪B| = |A|+|B| − |A∩B|
├── 3 sets: + |A∩B∩C|
└── n sets: alternating sum
Exam Q&A
Part A (2 marks) and Part B (20 marks) style questionsPart A (2 marks each)
Q1. Define a set with an example. A set is a well-defined collection of distinct objects called elements. Example: — the set of even numbers less than 10.
Q2. State the Principle of Inclusion–Exclusion for two sets. .
Q3. If , what is ? .
Q4. State De Morgan's laws. and .
Part B (20 marks)
Q. State and prove the Principle of Inclusion–Exclusion for three sets. Hence find how many integers from 1 to 100 are divisible by 2, 3 or 5.
Statement. For finite sets :
Proof sketch. Take any element . Suppose lies in exactly of the sets (). On the LHS it is counted once. On the RHS:
- It is counted times in the singletons,
- times in the pair-intersections (subtracted),
- times in the triple intersection (added back).
Total = for (by binomial identity). So every element is counted exactly once on both sides. ∎
Application — multiples of 2, 3, 5 in : Let , , be the sets of multiples of 2, 3, 5 respectively.
- , ,
By PIE: .