Symmetric difference
Encyclopedia : S : SY : SYM : Symmetric difference
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
- [ A \Delta B\,]
For example, the symmetric difference of the sets and is . 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.
The symmetric difference is equivalent to the union of both relative complements, that is:
- [A \Delta B = (A - B) \cup (B - A),\,]
- [A \Delta B = (A \cup B) - (A \cap B),]
- [A \Delta B = \ (x \in B)\}.]
- [A \Delta B = B \Delta A,\,]
- [(A \Delta B) \Delta C = A \Delta (B \Delta C).\,]
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:
- [(A \Delta B) \Delta (B \Delta C) = A \Delta C.\,]
The empty set is neutral, and every set is its own inverse:
- [A \Delta \varnothing = A,\,]
- [A \Delta A = \varnothing.\,]
Intersection distributes over symmetric difference:
- [A \cap (B \Delta C) = (A \cap B) \Delta (A \cap C),]
The symmetric difference can be defined in any Boolean algebra, by writing
- [ x \Delta y = (x \lor y) \land \lnot(x \land y) = (x \land \lnot y) \lor (y \land \lnot x).]
