Cartesian Product
Ordered Pair
An ordered pair is a list \((x,y)\) of two elements \(x\) and \(y\), enclosed in parentheses and separated by a comma.
\[ (1,2) \] \[ (2,1) \]
However:
\[ (1,2) \neq (2,1) \]
Suppose \(A\) and \(B\) are sets.
Cartesian Product
A cartesian product is simply the multiplication of sets denoted as \(A\) x \(B\) and defined as \(A\) x \(B\) = \(\{(a,b): a \in A, \ b \in B \}\)
\[ A = \{a, b, c\}, \ B = \{1, 2, 3\} \]
\[ A \ \text{x} \ B = \{ (a,1), (a,2), (a,3), (b,1), (b,2), (b,3), (c,1), (c,2), (c,3) \} \]
Ordered tripples such as \((x,y,z)\) are also possible.
\[ A = \{a, b\}, \ B = \{1, 2\}, \ C = \{I, II\} \]
\[ A \ \text{x} \ B \ \text{x} \ C = \{ (a,1,I), (a,1,II), (a,2,I), (a,2,II), (b,1,I), (b,1,II), (b,2,I), (b,2,II) \} \]
Cartesian Power
A cartesian power is also possible for any integer \(n\) as \(A^n = A \ \text{x} \ A \ \text{x} \ ... \ \text{x} \ A = \{ (x_1, x_2, ..., x_n):x_1,x_2,...,x_n \in A\}\)
One famous cartesian power is \(\mathbb{R}^2\), also known as the cartesian plane or a two-dimensional plane.
\[ \mathbb{R} \ \text{x} \ \mathbb{R} = \mathbb{R}^2 \]
\(\mathbb{R}^3\) three-dimensional planes are also possible.
\[ \mathbb{R} \ \text{x} \ \mathbb{R} \ \text{x} \ \mathbb{R} = \mathbb{R}^3 \]
And we can generalize up to \(n\) dimensions.
\[ \mathbb{R} \ \text{x} \ \mathbb{R} \ \text{x} \ ... \ \text{x} \ \mathbb{R} = \mathbb{R}^n \]
In Data Science, we often work in high-dimensional spaces—sometimes with thousands or even millions of dimensions. GPT-4, for example, is rumored to have over a trillion \(\mathbb{R}^{1,000,000,000,000,000}\).
Exercise
For the following sets list the elements of their corresponding cartesian product:
\(A = \{1,2,3\}\) \(B = \{1, (2,3) \}\) \(C = \{\mathbb{Z}, \mathbb{R}\}\)
- \(A\) x \(B\)
- \(A\) x \(C\)
- \(A \ \text{x} \ B = \{ (1,1), (1,(2,3)), (2,1), (2, (2,3)), (3,1), (3,(2,3)) \}\)
- \(A \ \text{x} \ C = \{ (1,\mathbb{Z}), (1,\mathbb{R}), (2,\mathbb{Z}), (2,\mathbb{R}), (3,\mathbb{Z}), (3,\mathbb{R}) \}\)