TOPICS
Search

Symmetric Difference


The set of elements belonging to one but not both of two given sets. 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 can be implemented in the Wolfram Language as:

  SymmetricDifference[a_, b_] :=
    Union[Complement[a, b], Complement[b, a]]

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). All but the first notation should probably be deprecated since each of the other symbols has a common meaning in other areas of mathematics.

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.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 Web Resource. https://mathworld.wolfram.com/SymmetricDifference.html

Subject classifications