Skip to content

Business Mathematics and Basic Statistics · Ch 9 — Sets — Operations and Functions

Set Operations — Difference, Symmetric Difference and Complement

4

Set Operations — Difference, Symmetric Difference and Complement

Three more operations round out the standard set-operation toolkit.

The difference of AA and BB, written A−BA - B, is the set of elements that belong to AA but not to BB:

A−B={x:x∈A, x∉B}.A - B = \{x : x \in A,\ x \notin B\}.

Note carefully that A−BA - B and B−AB - A are generally different sets — subtraction of sets, like subtraction of numbers, is not commutative.

The symmetric difference of AA and BB, written A△BA \triangle B, is the set of elements belonging to exactly one of AA and BB, but not both — everything in either set except what they share:

A△B=(A−B)∪(B−A).A \triangle B = (A - B) \cup (B - A).

For example, with A={1,2,3,4,5}A = \{1,2,3,4,5\} and B={4,5,6,7,8}B = \{4,5,6,7,8\}:

A−B={1,2,3},B−A={6,7,8},A△B={1,2,3,6,7,8}.A - B = \{1,2,3\}, \qquad B - A = \{6,7,8\}, \qquad A \triangle B = \{1,2,3,6,7,8\}.

Notice A△BA \triangle B is simply A−BA - B and B−AB - A combined — it deliberately leaves out the shared elements 44 and 55.

The complement of a set AA, written A′A', is defined only relative to a chosen universal set UU (the "everything under discussion" set from the previous chapter) — it is everything in UU that is not in AA:

A′=U−A={x∈U:x∉A}.A' = U - A = \{x \in U : x \notin A\}.

For instance, if U={1,2,…,10}U = \{1, 2, \dots, 10\} and A={1,2,3,4,5}A = \{1,2,3,4,5\}, then A′={6,7,8,9,10}A' = \{6,7,8,9,10\}. …

Definition 1Difference of Two Sets

A−B={x:x∈A,x∉B}A - B = \{x : x \in A, x \notin B\} — elements in AA but not in BB. Generally $A …

Definition 2Symmetric Difference

A△B=(A−B)∪(B−A)A \triangle B = (A-B) \cup (B-A) — elements belonging to exactly one of AA, BB …

Definition 3Complement of a Set

Relative to a universal set UU: A′=U−A={x∈U:x∉A}A' = U - A = \{x \in U : x \notin A\} — everything in UU outside …