Canonical: https://knowlpedia.com/shared-foundations/symmetric-difference/

# Symmetric difference

The elements that lie in exactly one of two sets.

A **symmetric difference** of sets \(A\) and \(B\) is the set of elements that belong to exactly one of them:
\[
A\triangle B=(A\setminus B)\cup(B\setminus A).
\]

## Remarks

This operation is built from [set difference](https://knowlpedia.com/shared-foundations/set-difference/) and [union](https://knowlpedia.com/shared-foundations/union/). It is symmetric in \(A\) and \(B\) and measures “disagreement” between sets: \(A\triangle B=\varnothing\) exactly when \(A=B\).

## Examples

- \(\{1,2,3\}\triangle\{2,3,4\}=\{1,4\}\).
- If \(A\) and \(B\) are disjoint, then \(A\triangle B=A\cup B\).
