Textbook
The Cartesian product $C\times D$ is the set of ordered pairs $(c,d)$ with $c\in C$ and $d\in D$. Ordered means that $(c,d)=(c',d')$ exactly when $c=c'$ and $d=d'$. The two positions play different roles.
For $C=\{1,2\}$ and $D=\{3\}$, the product is $\{(1,3),(2,3)\}$. For finite sets, $|C\times D|=|C||D|$: each first element can be paired with every second element. If either factor is empty, there are no pairs. The notation $\mathbb R^d$ generalizes this construction to ordered tuples of $d$ real coordinates.
Membership of a pair requires two conditions simultaneously: the first coordinate belongs to $C$ and the second to $D$. One qualifying coordinate is insufficient. Reversing the factors changes the roles of the positions; the pair counts can agree while the resulting sets differ. The cardinality formula requires both factors to be finite and counts pairs, rather than the separate objects used to build them.
Definitions and further reading: Mathematics for Computer Science.
In plain language
A Cartesian product resembles every combination of T-shirt sizes and colors. Each pair records size first and color second; exchanging the fields changes its meaning. The full product includes every combination, although a real warehouse may stock only some of them. An order form can be more optimistic than a shelf, but the mathematical construction promises no inventory.
Example
The original illustrative sets are $C=\{1,2\}$ and $D=\{3\}$. Each element of the first set is paired with every element of the second.
Cartesian Products: All Ordered Pairs
Input sets
The first position comes from C and the second from D.
Step 1 of 3: Input sets
Read all steps
Input sets
The first position comes from C and the second from D.
- State
- C: 1, 2currentD: 3current
First pair
The first element of C pairs with the only element of D.
- State
- (1,3)current
Complete result
The second element of C creates one more pair.
- State
- (1,3)current(2,3)current
In the first step, 3 is allowed only in the second position. Pair (3,1) therefore does not belong to this product even though both numbers occur in the original sets. The resulting pairs (1,3) and (2,3) differ in their first coordinate and count separately. Their number, $2\cdot1=2$, agrees with enumeration. Counting helps detect omissions but does not replace checking each pair’s coordinate roles.
Related concepts: Coordinate vectors.