← 🔗 Sets, Relations & Functions
Subtopic 1 of 7

2.1Sets and counting with sets

The idea

A set is a collection of distinct elements. You combine sets with union, intersection, difference, complement and symmetric difference, and count them with inclusion–exclusion.

Think of it like this: Clubs at a college: a student may be in the chess club, the music club, both or neither, and counting members needs care about the overlap.

Why it exists

Counting the union of overlapping sets, and set identities, appear regularly and are the base for probability and counting.

How it works

  1. |A ∪ B| = |A| + |B| − |A ∩ B|: subtract the overlap counted twice.
  2. For three sets: add the singles, subtract the pairs, add back the triple.
  3. |P(A)| = 2^|A| and |A × B| = |A|·|B|.
  4. A Δ B = (A − B) ∪ (B − A): elements in exactly one.

Worked example: 60 students, 35 play cricket, 30 play chess, 10 play neither

Union = 60 − 10 = 50. Both = 35 + 30 − 50 = 15.

Now play with it

  • →Edit set A and watch |A ∪ B ∪ C| stay equal to the inclusion–exclusion total.
  • →Try disjoint sets and see the intersections become empty.
A ∪ B{1, 2, 3, 4, 5, 6, 7}
A ∩ B{4, 5}
A − B{1, 2, 3}
A Δ B (symmetric difference){1, 2, 3, 6, 7}
Complement of A in U = A ∪ B ∪ C{6, 7, 9}
|P(A)| = 2^|A|32
|A × B| = |A|·|B|20
|A ∪ B ∪ C| counted directly8
|A|+|B|+|C|−|A∩B|−|A∩C|−|B∩C|+|A∩B∩C|8

The last two boxes always agree: that is inclusion–exclusion for three sets. |A ∪ B| = |A| + |B| − |A ∩ B| is the two-set version.

IdentityCounterpart in logic
(A ∪ B)ᶜ = Aᶜ ∩ BᶜDe Morgan
A − B = A ∩ Bᶜp ∧ ¬q
A Δ B = (A ∪ B) − (A ∩ B)p ⊕ q
A ⊆ B ⇔ A ∩ B = A ⇔ A ∪ B = Bp → q
|A ∪ B| = |A| + |B| − |A ∩ B|inclusion–exclusion
|P(A)| = 2^|A|each element is in or out

Every set identity can be checked the way you check a logical equivalence: element by element.

Check yourself

If |A| = 5, how many subsets does A have?

Remember: |A∪B| = |A|+|B|−|A∩B|; |P(A)| = 2ⁿ; |A×B| = |A||B|.
Exam notes (the dense version)

Operations: ∪, ∩, difference, complement, symmetric difference A Δ B = (A−B)∪(B−A). |P(A)| = 2^|A|, |A × B| = |A|·|B|. Inclusion–exclusion: |A∪B| = |A|+|B|−|A∩B|; for three sets subtract the pairs and add back the triple. Set identities (De Morgan for sets) mirror the logic laws.

Previous year questions: Sets, Relations & Functions (20)

PYQs are grouped by topic, so this is the full set for Sets, Relations & Functions; try the ones that match this subtopic. Open all 20 on the topic page.