Union and intersection combine sets by keeping or discarding elements. The Cartesian product does something different: it pairs up every element of the first set with every element of the second. The result is not a reshuffling of old elements; it is a brand-new set whose elements are ordered pairs. Once you see the grid, the formula |A \times B| = |A| \cdot |B| is no longer a rule to memorise — it is the obvious count of cells in a rectangle.
The definition
Every element of A \times B is an ordered pair (a, b). The first coordinate comes from A, the second from B. Two pairs (a_1, b_1) and (a_2, b_2) are equal only when a_1 = a_2 and b_1 = b_2. Order matters: (1, 2) and (2, 1) are different pairs, so in general A \times B \ne B \times A.
The grid
Let A = \{1, 2, 3\} and B = \{x, y\}. Write A down the rows and B across the columns. Each of the 3 \times 2 = 6 cells is one ordered pair of A \times B.
So
Why the cell-count formula: every element of A pairs with every element of B, which means for each of the |A| rows you get |B| pairs — one per column. Multiplying gives |A \times B| = |A| \cdot |B|.
Order really matters
Swap the roles and you get a different set.
Six pairs again, but none of them equals any pair in A \times B. (1, x) and (x, 1) are different ordered pairs, even though the components are the same two objects. This is why mathematicians say "Cartesian product is not commutative" — the operation depends on which set you put first.
In the rare case where A = B, the product A \times A (also written A^2) is the set of all ordered pairs of elements of A. For example, if A = \{1, 2\}, then
with cardinality |A|^2 = 4.
The cardinality formula
For finite sets:
This generalises to more factors:
The proof is the grid picture in n dimensions: an |A_1| \times |A_2| \times \cdots \times |A_n| array has \prod |A_i| cells.
This formula is the bread-and-butter of combinatorics. "How many three-letter passwords from a 26-letter alphabet?" is |L| \cdot |L| \cdot |L| = 26^3. "How many outcomes when you roll two dice?" is |D| \cdot |D| = 6 \cdot 6 = 36. Every time you hear "multiply the counts," the underlying object is a Cartesian product.
Where you have met Cartesian products already
You met one in primary school without anyone calling it a Cartesian product — the coordinate plane:
Every point on the plane is an ordered pair of real numbers. The plane is literally the Cartesian product of the real line with itself. (The name is not a coincidence — Descartes introduced coordinates, and the Cartesian product is the abstract structure that makes coordinates work.)
Going one dimension higher, \mathbb{R}^3 = \mathbb{R} \times \mathbb{R} \times \mathbb{R} is three-space. A triple (x, y, z) is an ordered tuple in the triple Cartesian product.
Relations live inside A \times B
A relation from A to B is simply a subset of A \times B. For example, with A = \{1, 2, 3\} and B = \{2, 3, 4, 5\}, the "less than" relation
is the subset of A \times B consisting of pairs where the first coordinate is smaller. Rolling through the grid: (1,2), (1,3), (1,4), (1,5), (2,3), (2,4), (2,5), (3,4), (3,5). Nine pairs out of the twelve cells of A \times B. Every relation you meet in Relations is specified by which cells of the A \times B grid it claims.
Count $|A \times B|$ when $A = \{a, b, c, d\}$ and $B$ is the set of even digits
Step 1. Roster B. The even digits are B = \{0, 2, 4, 6, 8\}.
Step 2. Compute sizes.
Step 3. Apply the formula.
Why: the grid has |A| = 4 rows and |B| = 5 columns, so it has 4 \times 5 = 20 cells, each one holding a unique ordered pair.
Result. |A \times B| = 20. Sample pairs: (a, 0), (a, 2), (b, 4), (d, 8) — all of the form (letter, even digit).
Subtleties to remember
- Order is fundamental. (a, b) \ne (b, a) unless a = b. Do not write \{1, 2\} when you mean (1, 2) — those are a set and an ordered pair, built from different notations and different rules.
- Empty factor zeroes the product. If A = \varnothing or B = \varnothing, then A \times B = \varnothing. Zero rows times any number of columns is zero cells.
- Not the same as union. |A \cup B| and |A \times B| measure different things. For A = \{1, 2\}, B = \{3, 4\}, |A \cup B| = 4 while |A \times B| = 4 only because |A| + |B| = |A| \cdot |B| happens in this special case. For A = \{1, 2, 3\}, B = \{4, 5\}, |A \cup B| = 5 but |A \times B| = 6. Different operations, different answers.
Related: Set Operations · Relations · Sets — Introduction · Inclusion-Exclusion Calculator · Cardinality Meter