What Is The Cartesian Product?
The Cartesian product of two sets $A$ and $B$, written $A \times B$, is the set of all ordered pairs $(a, b)$ where the first element $a$ comes from $A$ and the second element $b$ comes from $B$.
An ordered pair is two objects written in a fixed order, so $(a, b)$ and $(b, a)$ are different objects unless $a$ and $b$ happen to be equal. Because the arrangement carries meaning, ordered pairs behave differently from a plain two-element set, where ${a, b}$ and ${b, a}$ are the same thing.
In set-builder form, the definition reads:
$$A \times B = {, (a, b) : a \in A \text{ and } b \in B ,}$$
Throughout this article, two small sets do the work:
$$A = {1, 2, 3}, \qquad B = {a, b}$$
Here $A$ has three elements and $B$ has two. Every member of $A \times B$ is a pair whose first slot holds a number from $A$ and whose second slot holds a letter from $B$. Three things are worth fixing before any computation:
The pair is ordered. $(1, a)$ and $(a, 1)$ are not the same element, and $(a, 1)$ is not even in $A \times B$.
The two sets can differ. They need not share elements, or even hold the same kind of object; numbers pair with letters here.
Elements repeat across pairs. The number $1$ shows up in every pair that starts with $1$, once for each element of $B$.
How Do You Find The Cartesian Product Of Two Sets?
To find $A \times B$, pair every element of $A$ with every element of $B$, keeping $A$'s element first. Work through $A$ in order, and for each of its elements sweep through all of $B$.
Start with the first element of $A$. Take $1$, then pair it with each element of $B$ in turn: $(1, a)$ and $(1, b)$.
Move to the next element of $A$. Take $2$, and pair again across all of $B$: $(2, a)$ and $(2, b)$.
Finish the last element of $A$. Take $3$, and pair across $B$ once more: $(3, a)$ and $(3, b)$.
Collecting every pair gives the full product:
$$A \times B = {(1, a),\ (1, b),\ (2, a),\ (2, b),\ (3, a),\ (3, b)}$$
A grid makes the same result easy to check. Put the elements of $A$ down the side, the elements of $B$ across the top, and read each cell as the pair (row, column).
Table: The Cartesian product $A \times B$ laid out as a grid, one ordered pair per cell.
$\times$ | $a$ | $b$ |
|---|---|---|
1 | (1, a) | (1, b) |
2 | (2, a) | (2, b) |
3 | (3, a) | (3, b) |
Six cells, six pairs. The grid also shows why nothing is ever left out or counted twice: each row uses one element of $A$, each column uses one element of $B$, and every crossing is filled exactly once.
What Is The Cardinality Of A Cartesian Product?
The cardinality of a Cartesian product, meaning the number of elements it holds, is the product of the two set sizes:
$$n(A \times B) = n(A) \times n(B)$$
The reason is the grid above. Each element of $A$ starts a batch of pairs, and each batch has exactly $n(B)$ members, one for every element of $B$. With $n(A)$ batches of $n(B)$ pairs each, the total is $n(A) \times n(B)$.
For the running sets, $n(A) = 3$ and $n(B) = 2$, so $n(A \times B) = 3 \times 2 = 6$, which matches the six pairs listed above. The rule scales without effort: a set of $5$ shirts paired with a set of $4$ trousers gives $5 \times 4 = 20$ possible outfits, one for each pair. This is also why the product grows fast, a point that returns in the common-mistakes section.
Is A×B The Same As B×A?
No. In general $A \times B \neq B \times A$, because swapping the sets swaps the order inside every pair, and ordered pairs depend on their order. The Cartesian product is not commutative.
Reversing the running sets gives:
$$B \times A = {(a, 1),\ (a, 2),\ (a, 3),\ (b, 1),\ (b, 2),\ (b, 3)}$$
Set this beside $A \times B$ and the difference is plain. The pair $(1, a)$ lives in $A \times B$; the pair $(a, 1)$ lives in $B \times A$; they are not the same element, so the two products are different sets. They do share one number: both hold six elements, since $n(A) \times n(B) = n(B) \times n(A)$. Equal size, different contents.
There is exactly one case where the two agree. When $A = B$, the product is written $A \times A$ or $A^{2}$, and reversing it changes nothing because both slots draw from the same set. The plane of coordinates is the most famous example: $\mathbb{R} \times \mathbb{R}$, every pair of real numbers, is the same set whichever way you read it.
How Do You Extend The Cartesian Product To Three Sets?
The Cartesian product of three sets $A$, $B$, and $C$ is the set of all ordered triples $(a, b, c)$, where $a \in A$, $b \in B$, and $c \in C$. The same idea stretches to any number of sets, giving ordered lists called n-tuples.
$$A \times B \times C = {, (a, b, c) : a \in A,\ b \in B,\ c \in C ,}$$
The counting rule extends the same way, multiplying one factor per set:
$$n(A \times B \times C) = n(A) \times n(B) \times n(C)$$
Take $A = {1, 2}$, $B = {x, y}$, and $C = {p, q}$. Each triple picks one entry from each set, so there are $2 \times 2 \times 2 = 8$ of them:
$$A \times B \times C = {(1,x,p),(1,x,q),(1,y,p),(1,y,q),(2,x,p),(2,x,q),(2,y,p),(2,y,q)}$$
A three-part product like this is how a spreadsheet cell in a 3D workbook, or a point in 3D space $\mathbb{R} \times \mathbb{R} \times \mathbb{R}$, gets its address: one coordinate drawn from each of three lists.
What Are The Properties Of The Cartesian Product?
The Cartesian product follows a small set of reliable rules. The two that trip students up most are the first and the last: it is not commutative, and it interacts cleanly with union and intersection.
Table: Key properties of the Cartesian product, with a short reading of each.
Property | What it says |
|---|---|
Not commutative | $A \times B \neq B \times A$ unless $A = B$ or one set is empty |
Cardinality | $n(A \times B) = n(A) \cdot n(B)$ |
Distributive over union | $A \times (B \cup C) = (A \times B) \cup (A \times C)$ |
Distributive over intersection | $A \times (B \cap C) = (A \times B) \cap (A \times C)$ |
The empty set absorbs | $A \times \varnothing = \varnothing \times A = \varnothing$ |
The empty-set rule is worth a sentence. If either set has no elements, there is nothing to pull for one of the two slots, so no pair can be built, and the product is the empty set. The distributive rules connect the product to the standard operations on sets, which is one reason the Cartesian product feels at home inside the wider algebra of sets.
Why Does The Cartesian Product Matter?
The Cartesian product was not defined to make set theory longer. It is the one construction that turns two separate collections into a single collection of pairs, and almost every relationship in mathematics is a set of pairs.
Ordered pairs need a birthplace. Before you can talk about the pair $(3, 7)$ meaning something, you need a set that all such pairs live in. That set is $A \times B$.
Relations and functions are built from it. A relation from $A$ to $B$ is any subset of $A \times B$, and a function is a relation that pairs each input with exactly one output. Everything in relations and functions starts by carving a piece out of a Cartesian product.
The coordinate plane is a Cartesian product. The set of all points $(x, y)$ is $\mathbb{R} \times \mathbb{R}$, so every graph you have ever drawn lives inside a Cartesian product. The link to the coordinate plane is not an analogy; the plane simply is the product of the number line with itself.
So the operation earns its place by being upstream of so much else. Learn the pairing rule once, and relations, functions, graphs, and tables of data all read as the same idea wearing different clothes.
Who Invented The Cartesian Product?
The word "Cartesian" points straight to one person: the French mathematician and philosopher René Descartes, whose idea of naming a point by a pair of numbers is the reason the operation carries his name.
Two more names shaped the idea into the general set operation used today:
René Descartes (1596–1650, France) published the coordinate method in La Géométrie (1637), an appendix to his Discourse on the Method. The adjective "Cartesian" comes from Cartesius, the Latin form of his surname.
Georg Cantor (1845–1918, born in Russia, working in Germany) founded set theory in the 1870s, which let the pairing idea grow from points on a plane into an operation on any two sets, finite or infinite.
The precise modern definition of an ordered pair as itself a set, $(a, b) = {{a}, {a, b}}$, came later still, from the Polish mathematician Kazimierz Kuratowski in 1921. It looks like a technicality, yet it is what lets the whole coordinate plane be built out of nothing but sets.
Where Is The Cartesian Product Used In The Real World?
The pairing rule runs quietly under a wide range of everyday technology.
Databases: joining two tables pairs every row of one with every row of the other, which is literally a Cartesian product; a well-written query then keeps only the pairs that match.
Spreadsheets and coordinates: a cell reference like C7 is an ordered pair of a column and a row, and a map grid reference works the same way.
Games and boards: a chessboard is the product of files (a to h) with ranks (1 to 8), and any tile-based game names its squares by pairing two lists.
Machine learning and testing: trying every combination of settings, three learning rates against four batch sizes, sweeps the Cartesian product of the option lists, giving $3 \times 4 = 12$ experiments.
Product choices: sizes paired with colours, or mains paired with drinks on a menu, count the full set of combinations by the same $n(A) \times n(B)$ rule.
One pairing rule sizes a menu, addresses a spreadsheet, joins a database, and lays out a chessboard. The same short definition keeps showing up because pairing choices from two lists is one of the most common things there is to do.
What Are The Most Common Cartesian Product Mistakes?
These three errors account for most lost marks on the Cartesian product, verified against Cuemath's properties notes, the Mathematics LibreTexts chapter on Cartesian products, and university set-theory guides on relations.
Treating an ordered pair like an unordered set
Where it slips in:
A student writes the pair $(a, 1)$ as though it were the same as $(1, a)$, or lists the members of $A \times B$ using curly braces for each pair, blurring the order.
Don't do this:
Do not swap the two entries of a pair or treat $(1, a)$ and $(a, 1)$ as equal. The order is part of the object.
The correct way:
Keep the first slot for the element of the first set and the second slot for the element of the second set. For $A \times B$, every pair reads (element of $A$, element of $B$), so $(1, a)$ belongs and $(a, 1)$ does not.
Assuming $A \times B = B \times A$
Where it slips in:
A student computes $A \times B$, then writes $B \times A$ as if it were the same set, usually to save time.
Don't do this:
Do not reuse one product for the other. Reversing the sets reverses the order inside every pair, which changes every element.
The correct way:
Build each product from its own definition. For the running sets, $A \times B$ holds $(1, a)$ while $B \times A$ holds $(a, 1)$; they share a size but not a single element, unless $A$ and $B$ are equal.
Miscounting the cardinality
Where it slips in:
A student adds the set sizes, writing $n(A \times B) = n(A) + n(B)$, or loses track and lists too few pairs by hand.
Don't do this:
Do not add the sizes, and do not stop pairing before every element of the first set has met every element of the second.
The correct way:
Multiply: $n(A \times B) = n(A) \times n(B)$. Check by grid, one row per element of the first set, each row holding $n(B)$ pairs.
Practice Problems On Cartesian Product
Use $X = {2, 4}$ and $Y = {5, 6, 7}$ unless a problem says otherwise. Answers follow each line.
List $X \times Y$.
(Answer: ${(2,5),(2,6),(2,7),(4,5),(4,6),(4,7)}$.)Find $n(X \times Y)$. (Answer: $2 \times 3 = 6$.)
List $Y \times X$ and state whether it equals $X \times Y$.
(Answer: ${(5,2),(5,4),(6,2),(6,4),(7,2),(7,4)}$; not equal, since $(2,5) \neq (5,2)$.)If $n(A) = 5$ and $n(A \times B) = 20$, find $n(B)$.
(Answer: $n(B) = 20 \div 5 = 4$.)List $X \times X$ and give its cardinality.
(Answer: ${(2,2),(2,4),(4,2),(4,4)}$; cardinality $4$.)For $A = {1}$, $B = {a, b}$, $C = {x}$, find $n(A \times B \times C)$ and list the triples.
(Answer: $1 \times 2 \times 1 = 2$; the triples are $(1,a,x)$ and $(1,b,x)$.)
Where Should You Go Next After Cartesian Product?
The Cartesian product is the doorway into how mathematics records relationships, and a few natural next steps open from here.
Relations and functions. A relation is a subset of $A \times B$, and a function is a special relation; this is where the pairs start carrying rules.
The coordinate plane. See the product $\mathbb{R} \times \mathbb{R}$ drawn out as points, axes, and graphs.
Types of relations. Reflexive, symmetric, and transitive relations are all specific families of subsets of a Cartesian product.
If your child is building these foundations, a live Bhanzu trainer teaches the Cartesian product starting from the pairs a child already makes, cinema seats, chessboard squares, menu combinations, in the Bhanzu algebra program.
Was this article helpful?
Your feedback helps us write better content
