Set Union

Calculator for computing set unions with comprehensive formulas and examples

Set Union Calculator

What is calculated?

The union A ∪ B contains all elements that are in at least one of the two sets A or B. It forms the "total" of both sets without duplicates.

Enter the Sets

Values separated by spaces or semicolons

Values separated by spaces or semicolons
Result (A ∪ B)
Union:
All elements from both sets (without duplicates)

Set Union Info

Properties

Set Union A ∪ B:

  • Commutative: A ∪ B = B ∪ A
  • Associative: (A ∪ B) ∪ C = A ∪ (B ∪ C)
  • Idempotent: A ∪ A = A
  • A ⊆ (A ∪ B) and B ⊆ (A ∪ B)
Set Union Venn Diagram

Venn diagram of set union

Memory aid: "All elements that are in at least one of the two sets."

Inclusion-Exclusion Principle
|A ∪ B| = |A| + |B| - |A ∩ B|

Number of elements in the union

Examples
Standard:
{1,2,3} ∪ {2,3,4} = {1,2,3,4}
Disjoint:
{1,2} ∪ {3,4} = {1,2,3,4}
Subset:
{1,2} ∪ {1,2,3} = {1,2,3}


Set Union Formulas

Basic Definition
\[A \cup B = \{x : x \in A \lor x \in B\}\] Set notation
Commutative Law
\[A \cup B = B \cup A\] Order doesn't matter
Associative Law
\[(A \cup B) \cup C = A \cup (B \cup C)\] Grouping doesn't matter
Distributive Laws
\[A \cup (B \cap C) = (A \cup B) \cap (A \cup C)\] Distribution over intersection
Idempotence
\[A \cup A = A\] Self union
Neutral/Absorbing Elements
\[A \cup \emptyset = A\] \[A \cup U = U\] With empty set and universal set

Detailed Calculation Example

Example: A = {1,2,3,4,5,6}, B = {4,5,6,7,8,9}

Given:

  • A = {1, 2, 3, 4, 5, 6}
  • B = {4, 5, 6, 7, 8, 9}

Step 1 - Collect all elements:

From A: 1, 2, 3, 4, 5, 6
From B: 4, 5, 6, 7, 8, 9
Total: 1, 2, 3, 4, 5, 6, 7, 8, 9

Step 2 - Remove duplicates:

A ∪ B = {1,2,3,4,5,6,7,8,9}

Verification with cardinality:

|A| = 6, |B| = 6
|A ∩ B| = |{4,5,6}| = 3
|A ∪ B| = 6 + 6 - 3 = 9 ✓

Interpretation: The union contains all distinct elements from both sets, with common elements counted only once.

Inclusion-Exclusion Principle

The fundamental principle for calculating cardinalities

For two sets:

|A ∪ B| = |A| + |B| - |A ∩ B|

Reason: Common elements would otherwise be counted twice

For three sets:

|A ∪ B ∪ C| = |A| + |B| + |C|
- |A ∩ B| - |A ∩ C| - |B ∩ C|
+ |A ∩ B ∩ C|
Practical Example

Survey in a class of 30 students:

Sports:
Soccer: 18 students
Basketball: 12 students
Both sports: 8 students
Calculation:
At least one sport:
|S ∪ B| = 18 + 12 - 8 = 22 students

Result: 22 out of 30 students play at least one of the two sports.

Set Union Laws

Fundamental laws of set theory
Absorption Law
\[A \cup (A \cap B) = A\]

Absorption of intersection

De Morgan 1
\[\overline{A \cup B} = \overline{A} \cap \overline{B}\]

Complement of union

Distributive Law
\[A \cup (B \cap C) = (A \cup B) \cap (A \cup C)\]

Distribution over intersection

Monotonicity
\[\text{If } A \subseteq B, \text{ then } A \cup C \subseteq B \cup C\]

Monotonicity property

Example for Absorption Law

Given: A = {1,2,3}, B = {2,3,4}

A ∩ B = {2,3}
A ∪ (A ∩ B) = {1,2,3} ∪ {2,3} = {1,2,3} = A ✓

Mathematical Properties

Basic Properties
  • Upper bound: A ⊆ (A ∪ B) and B ⊆ (A ∪ B)
  • Commutativity: A ∪ B = B ∪ A
  • Associativity: (A ∪ B) ∪ C = A ∪ (B ∪ C)
  • Idempotence: A ∪ A = A
Special Properties
  • Neutral element: A ∪ ∅ = A
  • Absorbing element: A ∪ U = U
  • Complement: A ∪ Ac = U
  • Least upper bound: A ∪ B is the smallest set containing A and B
Important Notes

Size relationship: |A ∪ B| ≥ max(|A|, |B|)

Supremum: A ∪ B is the supremum (least upper bound) of A and B

Practical Applications

Databases
  • SQL UNION operations
  • Merging datasets
  • Aggregated queries
  • Master data management
Social Networks
  • Combining friend lists
  • Interest groups
  • Recommendation systems
  • Community building
Data Analysis
  • Creating total populations
  • Combining categories
  • Survey evaluations
  • Market research




Set theory functions

Complement  •  Difference  •  Intersection  •  Symmetric Difference  •  Union  •