Sets

Types of sets, operations, and the two- and three-set formulas, with a worked example.

A set is a well-defined collection of objects, called its elements. x ∈ A means x is an element of A; x ∉ A means it is not. n(A) is the number of elements in A (its cardinality).

Types of sets

  • Empty (null) set: no elements, written ∅ or { }. n(∅) = 0
  • Singleton set: exactly one element.
  • Finite / infinite set: a countable number of elements / no end to them.
  • Equal sets: exactly the same elements (A = B).
  • Equivalent sets: the same number of elements, n(A) = n(B).
  • Subset: A ⊆ B if every element of A is in B. Proper subset: A ⊂ B if also A ≠ B.
  • Universal set (U): the set of all elements under discussion.
  • Disjoint sets: no common element, A ∩ B = ∅. Overlapping sets: at least one common element.

Number of subsets

A set with n elements hasFormula
Subsets2ⁿ
Proper subsets2ⁿ − 1

Set operations

OperationMeaning
Union A ∪ Belements in A or B (or both)
Intersection A ∩ Belements in both A and B
Difference A − Belements in A but not in B
Complement A̅ (or Aᶜ)U − A: elements of U not in A

De Morgan's laws: (A ∪ B)ᶜ = Aᶜ ∩ Bᶜ and (A ∩ B)ᶜ = Aᶜ ∪ Bᶜ

Two sets

  • n(A ∪ B) = n(A) + n(B) − n(A ∩ B)
  • If A and B are disjoint: n(A ∪ B) = n(A) + n(B)
  • Only A: n₀(A) = n(A) − n(A ∩ B)  ·  Only B: n₀(B) = n(B) − n(A ∩ B)
  • n(A ∪ B) = n₀(A) + n₀(B) + n(A ∩ B)
  • Neither A nor B: n(A ∪ B)ᶜ = n(U) − n(A ∪ B)

Three sets

  • n(A ∪ B ∪ C) = n(A) + n(B) + n(C) − n(A ∩ B) − n(B ∩ C) − n(C ∩ A) + n(A ∩ B ∩ C)
  • Exactly two: n(A ∩ B) + n(B ∩ C) + n(C ∩ A) − 3 n(A ∩ B ∩ C)
  • Exactly one: n(A) + n(B) + n(C) − 2[n(A ∩ B) + n(B ∩ C) + n(C ∩ A)] + 3 n(A ∩ B ∩ C)
  • None of the three: n(U) − n(A ∪ B ∪ C)

Worked example

In a class of 100 students, 60 like Mathematics (M), 50 like Science (S) and 20 like both.

  • At least one subject: n(M ∪ S) = 60 + 50 − 20 = 90
  • Neither subject: 100 − 90 = 10
  • Mathematics only: 60 − 20 = 40 · Science only: 50 − 20 = 30