Skip to main content
Logo image

Section 9.5 Cartesian Product

Subsection 9.5.1 Definition and examples

Cartesian product
the set of all possible ordered pairs of elements from two given sets \(A\) and \(B\text{,}\) where the first element in a pair is from \(A\) and the second is from \(B\)
\(A \cartprod B\)
the Cartesian product of \(A\) and \(B\text{:}\) \(A \cartprod B = \setdef{(a,b)}{a\in A,\; b\in B} \)
For “small” sets, we can list the elements of the Cartesian product by listing all ways of combining an element from the first with an element from the second.

Example 9.5.1. A Cartesian product of “small” sets.

Suppose \(A = \{ 1, 2 \}\) and \(B = \{ a, b, c \}\text{.}\) Then
\begin{equation*} A \cartprod B = \{ (1,a), (1,b), (1,c), (2,a), (2,b), (2,c) \} \text{.} \end{equation*}

Example 9.5.2. A special subset of a certain Cartesian product.

Let \(\N^+\) represent the positive natural numbers: \(\N^+ = \N \relcmplmnt \{0\}\text{.}\) Then we can describe the Cartesian product \(\Z \cartprod \N^+\) as
\begin{equation*} \Z \cartprod \N^+ = \setdef{(m,n)}{m,n \in \Z, \; n>0} \subseteq \Z \cartprod \Z \text{.} \end{equation*}
Consider the subset
\begin{equation*} A = \setdef{(m,n) \in \Z \cartprod \N^+}{n \text{ has no divisors in common with } \abs{m}} \subseteq \Z \cartprod \N^+\text{.} \end{equation*}
Does \(A\) resemble some more familiar set …?

Extend.

Define \(A \cartprod B \cartprod C = \setdef{(a,b,c)}{a \in A\text{, } b\in B\text{, } c\in C}\text{.}\)
Example 9.5.3.
Suppose \(A = \{ 1, 2 \}\text{,}\) \(B = \{ a, b, c \}\text{,}\) \(C = \{ \alpha, \beta \}\text{.}\) Then,
\begin{align*} A \cartprod B \cartprod C = \{ \;\; \amp (1,a,\alpha), \, (1,a,\beta), \, (1,b,\alpha), \, (1,b,\beta), \, (1,c,\alpha), \, (1,c,\beta), \,\\ \amp (2,a,\alpha), \, (2,a,\beta), \, (2,b,\alpha), \, (2,b,\beta), \, (2,c,\alpha), \, (2,c,\beta) \;\; \} \end{align*}
Remark 9.5.4.
Technically, there is a difference between the elements of each of the sets
\begin{align*} (A \cartprod B) \cartprod C \amp = \setdef{\bbrac{(a,b),c}}{a \in A\text{, } b\in B\text{, } c\in C} \text{,} \\ A \cartprod (B \cartprod C) \amp = \setdef{\bbrac{a,(b,c)}}{a \in A\text{, } b\in B\text{, } c\in C} \text{,} \\ A \cartprod B \cartprod C \amp = \setdef{(a,b,c)}{a \in A\text{, } b\in B\text{, } c\in C} \text{,} \end{align*}
but it is rare that anyone actually observes this technicality. Usually, we consider these three sets to be the same set.
We use special notation for Cartesian products of a set with itself.
\(A^2\)
notation to mean \(A \cartprod A\)
\(A^3\)
notation to mean \(A \cartprod A \cartprod A\)
\(A^n\)
notation to mean \(A \cartprod A \cartprod \dotsb \cartprod A\) involving \(n\) “factors” of \(A\)
And so on.
Example 9.5.5. Cartesian products in linear algebra.
You have probably already encountered the notation
\begin{align*} \R^2 \amp = \setdef{(x,y)}{x,y \in \R} \text{,}\\ \R^3 \amp = \setdef{(x,y,z)}{x,y,z \in \R} \text{,}\\ \amp \vdots \\ \R^n \amp = \setdef{(x_1,x_2,\dotsc,x_n)}{x_j \in \R} \text{,}\\ \amp \vdots \end{align*}
used to represent \(2\)-, \(3\)-, and higher-dimensional (real) vector spaces.

Subsection 9.5.2 Visualizing Cartesian products

Cartesian products do not really lend themselves to visualization with Venn diagrams. So how should we visualize them?
The example we are probably most familiar with is that of the Cartesian plane, \(\R^2 = \R \cartprod \R\text{,}\) where each element \((x,y)\) is visualized as a point in a two-dimensional diagram, plotted according to the \(x\)- and \(y\)-coordinates of the element relative to a central set of \(xy\)-axes.
A point in the Cartesian plane as a set of \(xy\)-coordinates.
Figure 9.5.6. Visualizing elements of \(\R \cartprod \R\) as points in a plane relative to a set of perpendicular axes.
To produce this visualization, we imagine the elements of the “first” \(\R\) arrayed along the \(x\)-axis, and the elements of the “second” \(\R\) as arrayed along the \(y\)-axis, and then imagine each element of the Cartesian product \(\R \cartprod \R\) as a point located at a position that “lines up” with the corresponding positions on the \(x\)- and \(y\)-axes of the element’s coordinates. This is possible because the concepts of “less than” and “greater than” allow us to think of elements of \(\R\) as “progressing” from left to right along the \(x\)-axis and from bottom to top along the \(y\)-axis.
Even though other types of sets may not have readily available notions of “less than” and “greater than”, we may still visualize a Cartesian product \(A \cartprod B\) as “points” in a “plane” plotted relative to a central set of \(AB\)-axes. In the particular case that \(A\) and \(B\) are finite, it doesn’t really matter in what “order” we place the elements of \(A\) along the \(A\)-axis or the elements of \(B\) along the \(B\)-axis.

Example 9.5.7. Visualizing a Cartesian product between finite sets.

Consider the sets \(A = \{a, \alpha, \phi, z\}\) and \(B = \{1,2,3\}\text{.}\) Instead of listing the elements of \(A \cartprod B\text{,}\) we will place them in a grid. In Figure 9.5.8, you might imagine that the elements of \(A\) listed along the bottom row make up a horizontal axis and the elements of \(B\) along the leftmost column make up a vertical axis. But take care that these “axes” are not a continuum of values — there are no other “values” between these “coordinate values” along the “axes”. For example, there is no \(1.5\) along the “horizontal axis.” Similarly, there are no other “points” between the elements of \(A \cartprod B\text{.}\)
\(B\)
\(3\) \((a,3)\) \((\alpha,3)\) \((\phi,3)\) \((z,3)\)
\(2\) \((a,2)\) \((\alpha,2)\) \((\phi,2)\) \((z,2)\)
\(1\) \((a,1)\) \((\alpha,1)\) \((\phi,1)\) \((z,1)\)
\(a\) \(\alpha\) \(\phi\) \(z\) \(A\)
Figure 9.5.8. Visualizing elements of \(A \cartprod B\) as “points” in a grid relative to a set of perpendicular “axes.”