In mathematics, the symmetric difference of two sets is the set of elements which are in one of either set, but not in both. It is thus the set-theoretic equivalent of the XOR operation in Boolean logic.
Notations vary. The symmetric difference of sets A and B can be written as:
The symmetic difference is equivalent to the union of both complements, that is: