🌐 US-Proxy
id="topics">
TOPICS
Search

Symmetric Difference


The symmetric difference of two sets is the set of elements belonging to one but not both of them. It is therefore the union of the complement of A with respect to B and B with respect to A, and corresponds to the XOR operation in Boolean logic. The symmetric difference is implemented in the Wolfram Language as SymmetricDifference[list1, list2] and can also be computed using Union[Complement[list1, list2], Complement[list2, list1]].

The symmetric difference of sets A and B is variously written as A circleminus B, Adel B, A+B (Borowski and Borwein 1991) or ADeltaB (Harris and Stocker 1998, p. 3). The notation A direct sum B is also used (Brandt).

For example, for A={1,2,3,4} and B={1,4,5}, A circleminus B={2,3,5}, since 2, 3, and 5 are each in one, but not both, sets.


See also

Complement Set, Difference, Set Difference, Union, XOR

Explore with Wolfram|Alpha

References

Borowski, E. J. and Borwein, J. M. (Eds.). The HarperCollins Dictionary of Mathematics. New York: HarperCollins, 1991.Brandt, A. "Sets and Set Theory." In Discrete Structures for Computing. https://www.csd.uwo.ca/~abrandt5/teaching/DiscreteStructures/Chapter2/set-theory.html.Harris, J. W. and Stocker, H. Handbook of Mathematics and Computational Science. New York: Springer-Verlag, 1998.

Referenced on Wolfram|Alpha

Symmetric Difference

Cite this as:

Weisstein, Eric W. "Symmetric Difference." From MathWorld--A Wolfram Resource. https://mathworld.wolfram.com/SymmetricDifference.html

Subject classifications