|
In mathematics, the symmetric difference of two sets is the set of elements which are in one of either set, but not in both. This operation is the set-theoretic equivalent of the exclusive disjunction (XOR operation) in Boolean logic. The symmetric difference of the sets A and B is commonly denoted by Euclid, detail from The School of Athens by Raphael. ...
In mathematics, a set can be thought of as any collection of distinct things considered as a whole. ...
Exclusive disjunction (usual symbol XOR occasionally EOR) is a logical operator that results in true if one of the operands, but not both of them, is true. ...
Boolean logic is a system of syllogistic logic invented by 19th-century British mathematician George Boole, which attempts to incorporate the empty set, that is, a class of non-existent entities, such as round squares, without resorting to uncertain truth values. ...

Venn diagram of A Δ B. The symmetric difference is in solid green. For example, the symmetric difference of the sets {1,2,3} and {3,4} is {1,2,4}. The symmetric difference of the set of all students and the set of all females consists of all male students together with all female non-students. Image File history File links symmetric complement File history Legend: (cur) = this is the current file, (del) = delete this old version, (rev) = revert to this old version. ...
Image File history File links symmetric complement File history Legend: (cur) = this is the current file, (del) = delete this old version, (rev) = revert to this old version. ...
Venn diagrams are illustrations used in the branch of mathematics known as set theory. ...
The symmetric difference is equivalent to the union of both relative complements, that is: In set theory and other branches of mathematics, the union of a collection of sets is the set that contains everything that belongs to any of the sets, but nothing else. ...
In set theory and other branches of mathematics, two kinds of complements are defined, the relative complement and the absolute complement. ...
 and it can also be expressed as the union of the two sets, minus their intersection: In mathematics, the intersection of two sets A and B is the set that contains all elements of A that also belong to B (or equivalently, all elements of B that also belong to A), but no other elements. ...
 or with the XOR operation:  The symmetric difference is commutative and associative: In mathematics, especially abstract algebra, a binary operation * on a set S is commutative if x * y = y * x for all x and y in S. Otherwise * is noncommutative. ...
In mathematics, associativity is a property that a binary operation can have. ...
  Thus, the repeated symmetric difference is an operation on a multiset of sets giving the set of elements which are in an odd number of sets. In mathematics, a multiset (sometimes also called a bag) differs from a set in that each member has a multiplicity, which is a natural number indicating (loosely speaking) how many times it is a member, or perhaps how many memberships it has in the multiset. ...
The symmetric difference of two repeated symmetric differences is the repeated symmetric difference of the join of the two multisets, where for each double set both can be removed. In particular: In mathematics, a multiset (sometimes also called a bag) differs from a set in that each member has a multiplicity, which is a natural number indicating (loosely speaking) how many times it is a member, or perhaps how many memberships it has in the multiset. ...
 This implies a kind of triangle inequality: the symmetric difference of A and C is contained in the union of the symmetric difference of A and B and that of B and C. (But note that for the diameter of the symmetric difference the triangle inequality does not hold.) In mathematics, triangle inequality is the theorem stating that for any triangle, the measure of a given side must be less than the sum of the other two sides but greater than the difference between the two sides. ...
For the geometric term, see diameter. ...
The empty set is neutral, and every set is its own inverse: In mathematics and more specifically set theory, the empty set is the unique set which contains no elements. ...
In mathematics, an identity element (or neutral element) is a special type of element of a set with respect to a binary operation on that set. ...
  Taken together, we see that the power set of any set X becomes an abelian group if we use the symmetric difference as operation. Because every element in this group is its own inverse, this is in fact a vector space over the field with 2 elements Z2. If X is finite, then the singletons form a basis of this vector space, and its dimension is therefore equal to the number of elements of X. This construction is used in graph theory, to define the cycle space of a graph. In mathematics, given a set S, the power set (or powerset) of S, written or 2S, is the set of all subsets of S. In axiomatic set theory (as developed e. ...
In mathematics, an abelian group, also called a commutative group, is a group such that for all a and b in G. In other words, the order of elements in a product doesnt matter. ...
Vector spaces (or linear spaces) are spaces whose elements, known as vectors, can be scaled and added; all linear combinations can be formed. ...
In abstract algebra, a finite field or Galois field (so named in honor of Ãvariste Galois) is a field that contains only finitely many elements. ...
In mathematics, a singleton is a set with exactly one element. ...
In linear algebra, a basis is a minimum set of vectors that, when combined, can address every vector in a given space. ...
In mathematics, the dimension of a vector space V is the cardinality (i. ...
A labeled graph with 6 vertices and 7 edges. ...
// The binary cycle space In graph theory, certain vector spaces over the two-element field Z2 are associated with an undirected graph; this allows one to use the tools of linear algebra to study graphs. ...
Intersection distributes over symmetric difference: In mathematics, and in particular in abstract algebra, distributivity is a property of binary operations that generalises the distributive law from elementary algebra. ...
 and this shows that the power set of X becomes a ring with symmetric difference as addition and intersection as multiplication. This is the prototypical example of a Boolean ring. In mathematics, a ring is an algebraic structure in which addition and multiplication are defined and have properties listed below. ...
In mathematics, a Boolean ring R is a ring for which x2 = x for all x in R; that is, R consists of idempotent elements. ...
The symmetric difference can be defined in any Boolean algebra, by writing Wikibooks has more about Boolean logic, under the somewhat misleading title Boolean Algebra For a basic intro to sets, Boolean operations, Venn diagrams, truth tables, and Boolean applications, see Boolean logic. ...
 This operation has the same properties as the symmetric difference of sets.
See also
|