Math Fundamentals18 sections · 814 units
Open in Course

Symmetric Difference

Either set not both

The symmetric difference ABA \triangle B is the set of elements in AA or BB but not both.

You can compute it as AB=(AB)(BA)A \triangle B = (A \setminus B) \cup (B \setminus A) or as (AB)(AB)(A \cup B) \setminus (A \cap B).

For example, if A={1,2,3}A = \{1, 2, 3\} and B={2,3,4}B = \{2, 3, 4\}, then AB={1,4}A \triangle B = \{1, 4\}. You exclude 22 and 33 because they appear in both.