• Practice
  • About 18 min
  • 5 practice questions

Set operations: complement, union, intersection, difference

Find A′, A ∪ B, A ∩ B, A − B and the symmetric difference A Δ B, read them from Venn diagrams, and check the commutative, associative and distributive properties.

If something looks wrong, please tell us.

By the end of this lesson you can

  • Find the complement, union, intersection, difference and symmetric difference of sets.
  • Shade and read these operations on a Venn diagram.
  • Verify the commutative, associative and distributive properties for given sets.

Just as numbers can be added and multiplied, sets can be combined to make new sets. The English mathematician John Venn made popular the idea of drawing sets as circles inside a rectangle; these Venn diagrams let you see each operation at a glance. The rectangle stands for the universal set U.

The five operations

Set operations with one example
OperationSymbolMeaning (in symbols)With U = {1, ..., 8}, A = {1, 2, 3, 4}, B = {3, 4, 5, 6}
Complement of AA′{x : x ∈ U, x ∉ A}{5, 6, 7, 8}
UnionA ∪ B{x : x ∈ A or x ∈ B}{1, 2, 3, 4, 5, 6}
IntersectionA ∩ B{x : x ∈ A and x ∈ B}{3, 4}
DifferenceA − B{x : x ∈ A and x ∉ B}{1, 2}
Symmetric differenceA Δ B(A − B) ∪ (B − A){1, 2, 5, 6}

In a Venn diagram: A′ is everything in the rectangle outside circle A; A ∪ B is both circles together; A ∩ B is the overlapping part; A − B is the part of A outside B; A Δ B is both circles with the overlap removed. Two sets are disjoint exactly when A ∩ B = ∅.

  • (A′)′ = A, U′ = ∅ and ∅′ = U.
  • A ∪ A = A and A ∩ A = A; A ∪ ∅ = A and A ∩ ∅ = ∅.
  • A − B = A ∩ B′, and A − B ≠ B − A in general (difference is not commutative).
  • A Δ B = (A ∪ B) − (A ∩ B).

Where each operation sits in a two-circle Venn diagram

  • Only in A
    • This region is A − B
  • In both A and B
    • This region is A ∩ B
  • Only in B
    • This region is B − A
  • Outside both circles
    • This region is (A ∪ B)′
A ∪ B is the first three regions together; A Δ B is 'only in A' plus 'only in B'.

Properties of union and intersection

Laws for any sets A, B and C
PropertyUnionIntersection
CommutativeA ∪ B = B ∪ AA ∩ B = B ∩ A
AssociativeA ∪ (B ∪ C) = (A ∪ B) ∪ CA ∩ (B ∩ C) = (A ∩ B) ∩ C
DistributiveA ∪ (B ∩ C) = (A ∪ B) ∩ (A ∪ C)A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C)

Union is distributive over intersection, and intersection is distributive over union: A ∪ (B ∩ C) = (A ∪ B) ∩ (A ∪ C) and A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C).

— Distributive laws

Worked example 1: all the operations

Let U = {a, b, c, d, e, f, g}, P = {a, c, e, g} and Q = {b, c, d, e}. Working: P′ = {b, d, f}; P ∪ Q = {a, b, c, d, e, g}; P ∩ Q = {c, e}; P − Q = {a, g}; Q − P = {b, d}; so P Δ Q = {a, g} ∪ {b, d} = {a, b, d, g}. Check with the other formula: (P ∪ Q) − (P ∩ Q) = {a, b, c, d, e, g} − {c, e} = {a, b, d, g}. Both agree.

Worked example 2: verifying a distributive law

Verify A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C) for A = {1, 2, 3, 4, 5}, B = {2, 4, 6} and C = {3, 6, 9}. Left side: B ∪ C = {2, 3, 4, 6, 9}, so A ∩ (B ∪ C) = {2, 3, 4}. Right side: A ∩ B = {2, 4} and A ∩ C = {3}, so (A ∩ B) ∪ (A ∩ C) = {2, 3, 4}. Both sides are {2, 3, 4}, so the law is verified for these sets.

Worked example 3: difference is not commutative

With A = {2, 3, 5, 7} and B = {1, 3, 5, 9}: A − B = {2, 7} but B − A = {1, 9}. Since {2, 7} ≠ {1, 9}, A − B ≠ B − A. Union and intersection, however, give the same answer in either order.

Key takeaways: A′ is what is in U but not in A; ∪ collects everything, ∩ keeps only the common part; A − B keeps A's elements that are not in B; A Δ B keeps what belongs to exactly one of the sets; union and intersection are commutative and associative and each distributes over the other, but set difference is not commutative.

Check your understanding

  1. 1. If U = {1, 2, 3, 4, 5, 6} and A = {2, 4, 6}, what is A′?

    1. {1, 3, 5}
    2. {2, 4, 6}
    3. {1, 2, 3, 4, 5, 6}
    4. ∅
    Show answer

    Answer: A. A′ holds the elements of U that are not in A. Removing 2, 4 and 6 from U leaves {1, 3, 5}.

  2. 2. If A = {3, 6, 9, 12} and B = {4, 8, 12}, what is A ∩ B?

    1. {3, 4, 6, 8, 9, 12}
    2. {3, 6, 9}
    3. {4, 8}
    4. {12}
    Show answer

    Answer: D. The intersection keeps only the elements common to both sets. 12 is the only number in both, so A ∩ B = {12}.

  3. 3. For A = {p, q, r, s} and B = {r, s, t}, what is A − B?

    1. {t}
    2. {p, q}
    3. {r, s}
    4. {p, q, t}
    Show answer

    Answer: B. A − B keeps the elements of A that are not in B. r and s are in B, so they are removed, leaving {p, q}.

  4. 4. For A = {1, 2, 3} and B = {3, 4}, what is A Δ B?

    1. {3}
    2. {1, 2, 3, 4}
    3. {1, 2, 4}
    4. {1, 2}
    Show answer

    Answer: C. A − B = {1, 2} and B − A = {4}, so A Δ B = {1, 2} ∪ {4} = {1, 2, 4}. The common element 3 is left out.

  5. 5. Which statement is NOT true for all sets A and B?

    1. A ∪ B = B ∪ A
    2. A − B = B − A
    3. A ∩ B = B ∩ A
    4. A ∩ B ⊆ A
    Show answer

    Answer: B. Set difference is not commutative: for A = {1, 2} and B = {2, 3}, A − B = {1} but B − A = {3}. The other three statements hold for every pair of sets.

Privacy · Terms · Refunds · Delivery