Symmetric difference

The set of elements that belong to exactly one of two sets.
Symmetric difference

The symmetric difference of sets AA and BB is

AB:=(AB)(BA).A\triangle B := (A\setminus B)\cup(B\setminus A).

Equivalently, xABx\in A\triangle B iff (xA)  (xB)(x\in A)\ \oplus\ (x\in B), where \oplus denotes exclusive-or.

Symmetric difference measures how two sets differ and is useful as an operation on sets (it makes the power set of a fixed universe into an abelian group under \triangle).

Examples:

  • If A={1,2}A=\{1,2\} and B={2,3}B=\{2,3\}, then AB={1,3}A\triangle B=\{1,3\}.
  • For any set AA, AA=A\triangle A=\varnothing.
  • If ABA\subseteq B, then AB=BAA\triangle B = B\setminus A.