Skip to content

Mathematics · Ch 14 — Sets and Relations

Difference and Symmetric Difference of Sets

14.1.5.4

Difference and Symmetric Difference of Sets

The DIFFERENCE of set A and set B is the set of elements that are in A but NOT in B, denoted A−BA-B (also written A∩B′A\cap B'). Formally, A−B={x/x∈A,x∉B}A-B = \{x/x\in A, x\notin B\} (shaded in Fig. 5.6). Similarly, B−A={y/y∈B,y∉A}B-A = \{y/y\in B, y\notin A\}. For example, if A={x/x∈N,x is a factor of 6}={1,2,3,6}A=\{x/x\in N, x \text{ is a factor of } 6\}=\{1,2,3,6\} and B={x/x∈N,x is a factor of 8}={1,2,4,8}B=\{x/x\in N, x \text{ is a factor of } 8\}=\{1,2,4,8\}, then A−B={3,6}A-B=\{3,6\} and B−A={4,8}B-A=\{4,8\}.

Notes on difference: (i) A−B⊆AA-B\subseteq A and B−A⊆BB-A\subseteq B; (ii) the three sets A−BA-B, A∩BA\cap B, and B−AB-A are mutually disjoint — no two of them share any element; (iii) A−B=A∩B′A-B=A\cap B' and B−A=A′∩BB-A=A'\cap B; (iv) A∪B=(A−B)∪(A∩B)∪(B−A)A\cup B = (A-B)\cup(A\cap B)\cup(B-A) — the union splits cleanly into these three disjoint pieces (Fig. 5.7).

SYMMETRIC DIFFERENCE: (A−B)∪(B−A)(A-B)\cup(B-A) is called the symmetric difference of A and B, denoted AΔBA \Delta B — it collects everything that is in exactly one of A, B, but not in both. For example, if A={4,5,6,7,8}A=\{4,5,6,7,8\} and B={3,5,6,8,9}B=\{3,5,6,8,9\}, then A−B={4,7}A-B=\{4,7\}, B−A={3,9}B-A=\{3,9\}, so AΔB={4,7}∪{3,9}={3,4,7,9}A\Delta B = \{4,7\}\cup\{3,9\} = \{3,4,7,9\}. …

Figure 1Fig. 5.6 — difference of two sets

What this figure shows. A Venn diagram of two overlapping circles A and B inside a rectangle, shading only the crescent-shaped part of circle A that does NOT overlap with B, illustrating A−B as 'everything in A except what's shared with B …

Figure 2Fig. 5.7 — the three-part decomposition of A∪B

What this figure shows. A Venn diagram of two overlapping circles A and B, with all three distinct regions marked/shaded together — the A-only crescent, the shared middle lens, and the B-only crescent — visually showing that these three mutually disjoint pieces, placed together, make up the whole of A∪B …