SEM 6 › Discrete Mathematics › Week 02
Discrete Mathematics · Week 02

Sets & Set Operations

Set terminology and notation, the number systems, equality, subsets and proper subsets, disjoint sets, Venn diagrams, union, intersection, complement and difference, set laws, De Morgan's laws, and inclusion–exclusion.

ITE38222 videos · 61 min📄 Lesson 2.pdf

1Set terminology & notation

Definition Meaning Example
Set (2.1.1) An unordered collection of objects All students taking discrete maths at any school
Element / member (2.1.2) An object in a set. a ∈ A: a is an element of A. a ∉ A: a is not 3 ∈ {1, 3, 5}; 4 ∉ {1, 3, 5}
Universal set U (2.1.3) The set of all elements under consideration All living things on Earth
Empty (null) set The set with no elements: ∅ or { } The set of dogs with six legs

Two ways to specify a set

1. Tabular (roster) form

List all the elements.

O = {1, 3, 5, 7, 9}

2. Set-builder notation

Give the property members must have.

O = {x | x is an odd positive integer less than 10}

Number sets you must know

Symbol Set Definition
ℝ Real numbers {x : −∞ < x < ∞}
ℤ Integers {…, −3, −2, −1, 0, 1, 2, 3, …}
ℤ⁺ Positive integers {1, 2, 3, …}
ℤ⁻ Negative integers {−1, −2, −3, …}
ℕ₀ Natural numbers with zero = whole numbers {0, 1, 2, 3, …}
ℕ Natural numbers {1, 2, 3, …}
ℚ Rational numbers {x : x = p/q, p ∈ ℤ, q ∈ ℤ, q ≠ 0}
The real number system (Figure 2.1), from inside out

Natural {1, 2, 3, …} ⊂ Whole (adds 0) ⊂ Integers (adds …, −2, −1) ⊂ Rational (adds 1/2, −5/9, 3/8, …) ⊂ Real

2Equality, subsets & disjoint sets

Equal sets (2.1.4)

A = B if and only if they have the same elements: ∀x (x ∈ A ⇔ x ∈ B).

  • {1, 3, 5} = {3, 5, 1}. Order doesn't matter.
  • {1, 3, 3, 3, 5, 5, 5, 5} = {1, 3, 5}. Repeats don't matter.

Subset (2.1.5) and proper subset (2.1.6)

Concept Notation Meaning
Subset A ⊆ B Every element of A is also in B
Equality via subsets A = B ⇔ A ⊆ B and B ⊆ A The standard way to prove two sets are equal
Proper subset A ⊂ B A ⊆ B but A ≠ B (B has at least one extra element)
Not a subset D ⊄ A Some element of D isn't in A
Example 2.1.6.1

A = {1, 3, 5}

  • B = {1, 5} → B ⊂ A (a proper subset)
  • C = {3, 1, 5} → C ⊆ A, but not proper, since C = A
  • D = {1, 4} → D ⊄ A, since 4 ∉ A
Example 2.1.6.2 — all subsets of A = {a, b, c}
  • 0 elements: ∅
  • 1 element: {a}, {b}, {c}
  • 2 elements: {a, b}, {a, c}, {b, c}
  • 3 elements: {a, b, c}

That's 8 = 2³ subsets. In general, a set with n elements has 2ⁿ subsets (this collection is the power set).

Classic traps
  • ∅ ⊆ A for every set A. But ∅ ∈ A only if ∅ is literally listed as an element.
  • 0 ≠ ∅. 0 is a number; ∅ is a set.
  • A ⊆ A is always true. A ⊂ A is always false.
  • {a, b} ∈ {a, b, c} is false: {a, b} is a subset, not an element.

Disjoint sets (2.1.7)

A and B are disjoint if they have no elements in common: A ∩ B = ∅.

Example 2.1.7.1: A = {1, 2}, B = {4, 5, 6}, C = {5, 6, 7, 8}. A and B are disjoint and A and C are disjoint, but B and C are not (they share 5 and 6).

3Venn diagrams

Venn diagrams show sets visually:

  • The universal set U is a rectangle.
  • Subsets of U are regions inside it (usually circles).
Picture Relationship
One circle labelled "A, B" A = B
Two separate circles A and B are disjoint
Circle A inside circle B A ⊂ B

4Set operations

Operation Notation Set-builder definition Venn region
Union A ∪ B {x | x ∈ A or x ∈ B (or both)} Both circles entirely
Intersection A ∩ B {x | x ∈ A and x ∈ B} The overlap only
Complement Aᶜ {x | x ∈ U and x ∉ A} Everything outside A
Difference A \ B (or A − B) {x | x ∈ A, x ∉ B} A minus the overlap
Example 2.3.1 — A = {a, b, c}, B = {a, c, d}, U = {a, b, c, d}
  • A ∪ B = {a, b, c, d}
  • A ∩ B = {a, c}
  • Aᶜ = {d}
  • A \ B = {b}
Example 2.3.2

A = {1, 3, 5, 7, 9}, B = {2, 4, 6, 8, 10}. Then A ∩ B = ∅, so A and B are disjoint.

🧪 Try it — Venn diagram shader (3 sets)

5Set laws

Complementation rules

a. Uᶜ = ∅ b. ∅ᶜ = U c. (Aᶜ)ᶜ = A d. A ∪ Aᶜ = U e. A ∩ Aᶜ = ∅

Properties of set operations

Law Union Intersection
Commutative A ∪ B = B ∪ A A ∩ B = B ∩ A
Associative A ∪ (B ∪ C) = (A ∪ B) ∪ C A ∩ (B ∩ C) = (A ∩ B) ∩ C
Distributive A ∪ (B ∩ C) = (A ∪ B) ∩ (A ∪ C) A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C)

De Morgan's laws

(A ∪ B)ᶜ = Aᶜ ∩ Bᶜ
(A ∩ B)ᶜ = Aᶜ ∪ Bᶜ
Tip

Complementing a union or intersection flips ∪ ↔ ∩ and complements each set. It's the same pattern as ¬(p ∨ q) ≡ ¬p ∧ ¬q in logic. Check both sides in the shader: type (A ∪ B)' and then A' ∩ B'.

Example 2.3.3 — verify (A ∪ B)ᶜ = Aᶜ ∩ Bᶜ

U = {1, …, 10}, A = {1, 2, 4, 8, 9}, B = {3, 4, 5, 6, 8}

Left side - A ∪ B = {1, 2, 3, 4, 5, 6, 8, 9} - (A ∪ B)ᶜ = {7, 10}

Right side - Aᶜ = {3, 5, 6, 7, 10} - Bᶜ = {1, 2, 7, 9, 10} - Aᶜ ∩ Bᶜ = {7, 10}

Both sides are equal. ✓

Example 2.3.4 — cars in a dealer's lot

A = automatic transmission, B = air conditioning, C = side air bags.

Description Expression
(a) At least one option A ∪ B ∪ C
(b) Exactly one option (A ∩ Bᶜ ∩ Cᶜ) ∪ (B ∩ Cᶜ ∩ Aᶜ) ∪ (C ∩ Aᶜ ∩ Bᶜ)
(c) Automatic and side air bags but no air conditioning A ∩ C ∩ Bᶜ

The shader has buttons for (b) and (c).

🧪 Try it — Set operations calculator

6Number of elements — inclusion–exclusion

  • If a set S has exactly n distinct elements (n a non-negative integer), S is finite and n is its cardinality, written |S| or n(S).
  • Example: A = odd positive integers less than 10, so |A| = 5. Also |∅| = 0.
n(A ∪ B) = n(A) + n(B) − n(A ∩ B) (principle of inclusion–exclusion)
If A and B are disjoint: n(A ∪ B) = n(A) + n(B)

Why subtract? Elements in both A and B are counted twice when you add n(A) + n(B).

Example 2.4.1 — 100 coffee drinkers

70 take sugar (A), 60 take cream (B), 50 take both.

Question Working Answer
(a) Only sugar n(A) − n(A ∩ B) = 70 − 50 20
(b) Only cream n(B) − n(A ∩ B) = 60 − 50 10
(c) Sugar or cream 70 + 60 − 50 80
(d) Exactly one item 20 + 10 30

(And 100 − 80 = 20 take neither.)

Three sets: n(A ∪ B ∪ C) = n(A) + n(B) + n(C) − n(A ∩ B) − n(A ∩ C) − n(B ∩ C) + n(A ∩ B ∩ C)
🧪 Try it — Inclusion–exclusion calculator
Exam focus

Expect:

  • Writing sets in builder/tabular form
  • True/false on ∈ vs ⊆ and ∅
  • Listing all subsets
  • Computing ∪ ∩ ᶜ \
  • Verifying De Morgan by direct computation
  • Writing set expressions for word problems (cars, students, hospital staff)
  • Inclusion–exclusion survey problems: draw the Venn diagram and fill in the intersection first

7Quick revision sheet

Concept Remember it as
Set Unordered collection; repeats and order ignored
∈ / ⊆ / ⊂ Element of / subset / proper subset (≠)
A = B A ⊆ B and B ⊆ A
∅ Subset of every set; n(∅) = 0; ∅ ≠ 0
Number of subsets 2ⁿ
Number systems ℕ ⊂ ℕ₀ ⊂ ℤ ⊂ ℚ ⊂ ℝ
A ∪ B / A ∩ B or / and
Aᶜ / A \ B Not in A / in A but not B
Disjoint A ∩ B = ∅
De Morgan (A∪B)ᶜ = Aᶜ∩Bᶜ; (A∩B)ᶜ = Aᶜ∪Bᶜ
Laws Commutative, associative, distributive
Inclusion–exclusion n(A∪B) = n(A) + n(B) − n(A∩B) (+ 3-set version)

?Self-check quiz

11 questions on this week. Answer them all, then press Check my answers. Your best and latest scores are saved and shown on the subject page.