Compute union, intersection, difference and symmetric difference of two sets.
Set operations are fundamental in discrete mathematics. Union combines all elements from both sets. Intersection finds common elements. Difference A−B gives elements in A not in B. Symmetric difference includes elements in either set but not both.
Union
A ∪ B = {x : x ∈ A or x ∈ B}
Intersection
A ∩ B = {x : x ∈ A and x ∈ B}
A △ B contains elements that are in A or B but not in both. It is equivalent to (A−B) ∪ (B−A).
No. Sets are unordered collections of unique elements. {1,2,3} = {3,1,2}.