Set Operations Calculator
Compute union, intersection, difference and symmetric difference of two sets.
Inputs
A ∪ B (Union)
{1, 2, 3, 4, 5, 6, 7}
A ∩ B (Intersection)
{3, 4, 5}
A − B (Difference)
{1, 2}
B − A (Difference)
{6, 7}
A △ B (Symmetric Difference)
{1, 2, 6, 7}
|A ∪ B|
7
Step by step
Values used
Set A (comma separated) = 1, 2, 3, 4, 5; Set B (comma separated) = 3, 4, 5, 6, 7
Union
A ∪ B = {x : x ∈ A or x ∈ B}
Intersection
A ∩ B = {x : x ∈ A and x ∈ B}
A ∪ B (Union)
= {1, 2, 3, 4, 5, 6, 7}
A ∩ B (Intersection)
= {3, 4, 5}
A − B (Difference)
= {1, 2}
B − A (Difference)
= {6, 7}
A △ B (Symmetric Difference)
= {1, 2, 6, 7}
|A ∪ B|
= 7
How it works
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.
Formulas
Union
A ∪ B = {x : x ∈ A or x ∈ B}
- A,B
- Input sets
Intersection
A ∩ B = {x : x ∈ A and x ∈ B}
- A,B
- Input sets
Frequently Asked Questions
What is symmetric difference?
A △ B contains elements that are in A or B but not in both. It is equivalent to (A−B) ∪ (B−A).
Does order matter in sets?
No. Sets are unordered collections of unique elements. {1,2,3} = {3,1,2}.