# Symmetric Difference

The symmetric difference (disjunctive union/disunion) of sets A and B (A ^ B) is the set of all elements that are in set A or in set B but not both. Symmetric difference is also commutative, meaning A ^ B == B ^ A.

The difference (subtraction) of sets A and B (A – B) is the set of all elements that are in set A and not in set B. Subtraction is not commutative meaning A – B != B – A.

The intersection of sets A and B (A ∩ B) is the set of all elements that are contained in both A and B. Note again that the result is still a set (no duplicates). Intersection is also commutative, meaning A ∩ B == B ∩ A.