Mathwords logoMathwords

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 {Ai}iI\{A_i\}_{i \in I}, the disjoint union is defined as iIAi=iI{(x,i):xAi}\bigsqcup_{i \in I} A_i = \bigcup_{i \in I} \{(x, i) : x \in A_i\}. Each element xx is paired with its index ii, ensuring that copies from different sets are never identified with one another.

Key Formula

iIAi=iI{(x,i):xAi}\bigsqcup_{i \in I} A_i = \bigcup_{i \in I} \{(x,\, i) : x \in A_i\}
Where:
  • AiA_i = The $i$-th set in the collection
  • II = The index set labeling each contributing set
  • (x,i)(x, i) = 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 xx appears in both A1A_1 and A2A_2, the disjoint union contains both (x,1)(x, 1) and (x,2)(x, 2) 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: Ai=Ai|\bigsqcup A_i| = \sum |A_i|.

Worked Example

Problem: Let A={1,2,3}A = \{1, 2, 3\} and B={2,3,4}B = \{2, 3, 4\}. Find the disjoint union ABA \sqcup B and its cardinality.
Tag elements of A: Pair each element of AA with index 1.
{(1,1),(2,1),(3,1)}\{(1,1),\,(2,1),\,(3,1)\}
Tag elements of B: Pair each element of BB with index 2.
{(2,2),(3,2),(4,2)}\{(2,2),\,(3,2),\,(4,2)\}
Take the union: Combine the two tagged sets. Note that (2,1)(2,2)(2,1) \neq (2,2) and (3,1)(3,2)(3,1) \neq (3,2), so nothing merges.
AB={(1,1),(2,1),(3,1),(2,2),(3,2),(4,2)}A \sqcup B = \{(1,1),\,(2,1),\,(3,1),\,(2,2),\,(3,2),\,(4,2)\}
Answer: ABA \sqcup B has 6 elements, equal to A+B=3+3=6|A| + |B| = 3 + 3 = 6. Compare this with the ordinary union AB={1,2,3,4}A \cup B = \{1,2,3,4\}, 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 AB=AB|A \sqcup B| = |A \cup B|.
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.