Union and Intersection Calculator – Guide & Formulas
Compute union, intersection, difference, and symmetric difference of two sets. Visualize results with Venn diagrams and step-by-step solutions.
Perform set theory operations instantly. Enter two sets of numbers to compute their union, intersection, difference, and symmetric difference with clear step-by-step explanations.
Key Takeaway
Use the free Union and Intersection Calculator to compute union, intersection, difference, and symmetric difference of two sets. visualize results with venn diagrams and step-by-step solutions. Get instant results with step-by-step explanations.
How to Use the Union and Intersection Calculator
- Enter Set A as comma-separated numbers (e.g., 1, 2, 3, 4, 5).
- Enter Set B as comma-separated numbers (e.g., 3, 4, 5, 6, 7).
- Select the operation: Union, Intersection, Difference (A−B), or Symmetric Difference.
- Review the result set and the step-by-step breakdown of which elements are included.
The Formula
Variable Definitions
- A ∪ B: Union — every element that appears in A, in B, or in both
- A ∩ B: Intersection — elements common to both A and B
- A − B: Difference — elements in A that are not in B
- A △ B: Symmetric Difference — elements in exactly one of the two sets
- A': Complement — all elements NOT in A (within a universal set)
- |A|: Cardinality — the number of elements in set A
Computing Union and Intersection of Two Sets
Find A ∪ B and A ∩ B for A = {1, 2, 3, 4} and B = {3, 4, 5, 6}.
- Step 1: List Set A = {1, 2, 3, 4} and Set B = {3, 4, 5, 6}.
- Step 2: Union A ∪ B: combine all unique elements from both sets → {1, 2, 3, 4, 5, 6}.
- Step 3: Intersection A ∩ B: find elements appearing in both sets → {3, 4}.
- Step 4: Difference A − B: elements in A but not in B → {1, 2}.
- Step 5: Symmetric Difference A △ B: elements in exactly one set → {1, 2, 5, 6}.
Frequently Asked Questions
What is the union of two sets?
The union of two sets A and B (written A ∪ B) is the set containing all elements that are in A, in B, or in both. For example, {1,2} ∪ {2,3} = {1,2,3}.
What is the intersection of two sets?
The intersection of two sets A and B (written A ∩ B) is the set of elements that appear in both A and B. For example, {1,2,3} ∩ {2,3,4} = {2,3}.
What is the difference between union and intersection?
Union combines all elements from both sets (OR logic), while intersection keeps only shared elements (AND logic). Union is always ≥ intersection in size.
What is symmetric difference?
Symmetric difference (A △ B) contains elements that are in either A or B but NOT in both. It is equivalent to (A ∪ B) − (A ∩ B) or (A − B) ∪ (B − A).
Can sets contain duplicate elements?
In standard set theory, sets contain unique elements only. Duplicates are automatically removed. Our calculator treats each input as a mathematical set.
What is the complement of a set?
The complement of set A (written A') contains all elements in the universal set that are NOT in A. For example, if U = {1,2,3,4,5} and A = {1,2}, then A' = {3,4,5}.
How do I handle empty sets?
An empty set ∅ has no elements. The union of any set with ∅ is the original set. The intersection of any set with ∅ is ∅. These are fundamental properties in set theory.
Are sets ordered?
No. Sets are unordered collections. {1,2,3} and {3,1,2} are the same set. The order of input elements does not affect the result of any set operation.