Symmetric difference

| Main Article
| Discussion
| Related Articles  [?]
| Bibliography  [?]
| External Links  [?]
| Citable Version  [?]

|
|
|
|
|
|
|
|

This editable Main Article is under development and subject to a disclaimer.

[edit intro]

In set theory, the symmetric difference of two sets is the set of elements that belong to exactly one (that is either one or the other but not both) of the sets.

Formally, we define

A △ B = { x ∈ A ∪ B : ( x ∈ A ∧ x ∉ B ) ∨ ( x ∉ A ∧ x ∈ B ) } . {\displaystyle A\bigtriangleup B=\\{x\in A\cup B:(x\in A\wedge x\not \in B)\vee (x\not \in A\wedge x\in B)\\}.\,}

It can also be expressed as the union of the relative complements

A △ B = ( A ∖ B ) ∪ ( B ∖ A ) . {\displaystyle A\bigtriangleup B=(A\setminus B)\cup (B\setminus A).\,}

The notations  A + B {\displaystyle A+B\,} and  A ⊕ B {\displaystyle A\oplus B} are also seen.

In terms of the characteristic function we have

χ A △ B = χ A + χ B ( mod 2 ) . {\displaystyle \chi _{A\bigtriangleup B}=\chi _{A}+\chi _{B}{\pmod {2}}.}