📐 Union and Intersection Calculator
Calculate union, intersection, and set differences
|A ∪ B| and |A ∩ B|
How to Use This Calculator
Enter Set Sizes
Type the number of elements in set A and set B.
Enter Intersection
Type the number of elements in both sets (intersection).
Click Calculate
See union size, intersection, and elements only in each set.
Formulas
Union:
|A ∪ B| = |A| + |B| - |A ∩ B|
Only in A:
|A| - |A ∩ B|
Only in B:
|B| - |A ∩ B|
Example 1: A = {1, 2, 3}, B = {2, 3, 4}
|A| = 3, |B| = 3, |A ∩ B| = 2 (elements 2 and 3)
|A ∪ B| = 3 + 3 - 2 = 4
Union: {1, 2, 3, 4}
Example 2: |A| = 10, |B| = 15, |A ∩ B| = 5
|A ∪ B| = 10 + 15 - 5 = 20
Only in A: 10 - 5 = 5
Only in B: 15 - 5 = 10
About Union and Intersection Calculator
The Union and Intersection Calculator uses the inclusion-exclusion principle to calculate set relationships. The union (A ∪ B) contains all elements in either set, while the intersection (A ∩ B) contains only elements in both sets. This is fundamental in set theory and probability.
When to Use This Calculator
- Set Theory: Calculate union and intersection sizes
- Probability: Solve Venn diagram problems
- Statistics: Count overlapping groups
- Logic: Work with OR and AND operations
Why Use Our Calculator?
- ✅ Complete Results: Union, intersection, and differences
- ✅ Inclusion-Exclusion: Uses correct formula
- ✅ Visual Breakdown: Shows where elements are
- ✅ Free Tool: No registration
Key Concepts
- Union (A ∪ B): All elements in A or B or both
- Intersection (A ∩ B): Only elements in both sets
- Inclusion-exclusion: |A ∪ B| = |A| + |B| - |A ∩ B|
- Elements are subtracted once to avoid double-counting
Tips
- Intersection cannot exceed the smaller set size
- Union is at least as large as the larger set
- Use Venn diagrams to visualize
Frequently Asked Questions
What is the union of two sets?
The union A ∪ B contains all elements that are in set A, in set B, or in both. It's like combining both sets and removing duplicates.
What is the intersection of two sets?
The intersection A ∩ B contains only elements that are in both sets A and B. If there are no common elements, the intersection is empty.
Why subtract the intersection?
When we add |A| + |B|, we count elements in the intersection twice. Subtracting |A ∩ B| corrects for this double-counting.