Symmetric Difference of Sets

The symmetric difference of two sets A and B is the set of all elements that belong to exactly one of the two sets. In other words, it contains the elements that are in A or in B, but not in both. $$ A \Delta B = (A \setminus B) \cup (B \setminus A) $$

The symmetric difference is a useful operation for identifying the elements that are unique to each set while excluding those the sets have in common.

It is formally defined as:

$$ A \Delta B = (A \setminus B) \cup (B \setminus A) $$

where:

  • \(A \setminus B\) is the set of elements that belong to A but not to B.
  • \(B \setminus A\) is the set of elements that belong to B but not to A.

Equivalently, the symmetric difference is the union of the two relative complements \(A \setminus B\) and \(B \setminus A\).

In a Venn diagram, the symmetric difference is represented by the two non-overlapping regions of the circles representing the sets.
symmetric difference

A Practical Example

Consider the following sets:

$$ A = \{1, 2, 3\} $$

$$ B = \{2, 3, 4\} $$

First, find the elements that belong only to A and only to B:

$$ A \setminus B = \{1\} $$

$$ B \setminus A = \{4\} $$

Next, combine these two sets:

$$ A \Delta B = \{1\} \cup \{4\} = \{1, 4\} $$

Therefore, the symmetric difference of A and B is:

$$ A \Delta B = \{1, 4\} $$

The Venn diagram below highlights the elements that belong to exactly one of the two sets.

graphical representation of the symmetric difference

Example 2

Now consider another pair of sets:

$$ A = \{a, b, c\} $$

$$ B = \{c, d, e\} $$

Again, start by finding the elements that are unique to each set:

$$ A \setminus B = \{a, b\} $$

$$ B \setminus A = \{d, e\} $$

Then take their union:

$$ A \Delta B = \{a, b\} \cup \{d, e\} = \{a, b, d, e\} $$

So, the symmetric difference of A and B is:

$$ A \Delta B = \{a, b, d, e\} $$

The following Venn diagram illustrates the result.

symmetric difference example

Properties of the Symmetric Difference

The symmetric difference satisfies several important algebraic properties:

  • Commutativity
    Changing the order of the sets does not change the result. \[ A \Delta B = B \Delta A \]
  • Associativity
    The sets can be grouped in different ways without affecting the result. \[ A \Delta (B \Delta C) = (A \Delta B) \Delta C \]
  • Identity Element
    The empty set acts as the identity element for the symmetric difference. \[ A \Delta \emptyset = A \]
  • Self-Inverse Property
    The symmetric difference of a set with itself is the empty set. \[ A \Delta A = \emptyset \]

These properties make the symmetric difference a fundamental operation in set theory, Boolean algebra, computer science, and many other areas of mathematics.

 
 

Please feel free to point out any errors or typos, or share suggestions to improve these notes. English isn't my first language, so if you notice any mistakes, let me know, and I'll be sure to fix them.

FacebookTwitterLinkedinLinkedin
knowledge base

Set