About the set operations calculator
Enter the members of each set separated by commas. Braces are optional, whitespace around a member is ignored, and repeated members collapse, because a set contains an element or it does not: {1, 1, 2} and {1, 2} are the same set.
The union A union B holds every element in either set. The intersection A intersect B holds only the elements in both. The difference A minus B holds the elements of A that are not in B, and is not symmetric: A minus B and B minus A are usually different. The symmetric difference holds the elements in exactly one of the two sets, which is the union minus the intersection.
The calculator also reports cardinalities, so you can check inclusion-exclusion by hand: the size of the union equals the size of A plus the size of B minus the size of the intersection. Elements are compared as text, so 01 and 1 are two different members.
Worked example
Worked example
InputA = {1, 2, 3, 4} B = {3, 4, 5}
ResultUnion {1, 2, 3, 4, 5}, intersection {3, 4}, A minus B {1, 2}, symmetric difference {1, 2, 5}
Inclusion-exclusion checks out: 4 + 3 - 2 = 5, the size of the union.