The ordered pair (a, b) is defined set-theoretically as {{a}, {a, b}} (Kuratowski definition), capturing both elements and their order as a pure set-theoretic construction. The Cartesian product A × B is the set of all ordered pairs (a, b) where a ∈ A and b ∈ B.
From your work with set membership and notation, you know that a set is defined entirely by its members, with no notion of order: {a, b} and {b, a} are the same set. But many mathematical structures depend critically on order — coordinates in a plane, arguments to a function, entries in a database row. The challenge is: how do you represent order using only sets? The ordered pair solves this problem.
The Kuratowski definition encodes the pair (a, b) as the set {{a}, {a, b}}. This looks strange at first, but it works because the two elements a and b play asymmetric roles: a appears alone in the singleton {a}, while b only appears together with a. Given {{a}, {a, b}}, you can always recover which element is "first" (the one in the singleton) and which is "second" (the other one). Crucially, (a, b) ≠ (b, a) whenever a ≠ b, because {{b}, {b, a}} ≠ {{a}, {a, b}} — the singletons differ. The unordered set {a, b} cannot distinguish first from second; the Kuratowski set can.
The Cartesian product A × B extends this to all possible pairings between two sets. If A = {1, 2} and B = {x, y}, then A × B = {(1, x), (1, y), (2, x), (2, y)} — every element of A paired with every element of B, in that order. The familiar coordinate plane ℝ × ℝ = ℝ² is just the Cartesian product of the real numbers with itself: every point (x, y) is an ordered pair. This construction will be the foundation for defining binary relations (subsets of A × B) and functions (special kinds of relations), so it is essential to have a solid set-theoretic footing before proceeding to those topics.
An important edge case: (a, a) is a perfectly valid ordered pair even though both components are the same element. The Kuratowski encoding gives {{a}, {a, a}} = {{a}, {a}} = {{a}}, a set containing just the singleton {a}. This correctly encodes the reflexive pair (a, a) as distinct from the general form. When you later work with relations — for example, the identity relation where every element is related to itself — reflexive pairs like (a, a) will appear constantly, so it is worth confirming now that they pose no special difficulty.
Tuples generalize ordered pairs to any finite length: an n-tuple (a₁, a₂, …, aₙ) can be defined recursively as ((a₁, a₂, …, aₙ₋₁), aₙ), reducing every tuple to a nested sequence of ordered pairs. This means the entire framework scales: 3-tuples for 3D coordinates, n-tuples for n-dimensional space or n-ary relations, and so on — all built from the same ordered-pair construction you have just learned.