Disjoint Union — Definition, Formula & Examples
A disjoint union is a modified union of sets where every element is tagged with which set it came from, so even elements shared by multiple sets are treated as distinct in the result.
Given a collection of sets , the disjoint union is defined as . Each element is paired with its index , ensuring that copies from different sets are never identified with one another.
Key Formula
Where:
- = The $i$-th set in the collection
- = The index set labeling each contributing set
- = An ordered pair tagging element $x$ with its source index $i$
How It Works
To build a disjoint union, you label every element with the index of the set it belongs to. If appears in both and , the disjoint union contains both and as separate elements. This guarantees the contributing sets never overlap inside the result, even if the original sets shared elements. Because of this tagging, the cardinality of a disjoint union always equals the sum of the individual cardinalities: .
Worked Example
Problem: Let and . Find the disjoint union and its cardinality.
Tag elements of A: Pair each element of with index 1.
Tag elements of B: Pair each element of with index 2.
Take the union: Combine the two tagged sets. Note that and , so nothing merges.
Answer: has 6 elements, equal to . Compare this with the ordinary union , which has only 4 elements.
Why It Matters
Disjoint unions appear whenever you need to combine sets without losing track of duplicates. In probability, modeling mutually exclusive sample spaces relies on this idea. In computer science, tagged unions (also called variant types) directly implement the same concept in programming languages like Haskell and Rust.
Common Mistakes
Mistake: Confusing disjoint union with ordinary union and expecting .
Correction: Ordinary union merges shared elements; disjoint union tags them separately. The cardinality of a disjoint union equals the sum of individual cardinalities, not the size of the ordinary union.
