Work out set union and intersection instantly with clear inputs, formula shown and shareable results.
The union collects every element in either set, counting duplicates once. The intersection keeps only the elements common to both. Their sizes obey |A ∪ B| = |A| + |B| − |A ∩ B|.
Inclusion-exclusion
|A ∪ B| = |A| + |B| − |A ∩ B|
The union has 7 elements and the intersection is {4, 5}, and 5 + 4 − 2 = 7 confirms it.
No. {1, 2} and {2, 1} are the same set, though the results here are sorted for readability.