Cartesian product
The Cartesian product of two sets is the set of all possible ordered pairs made up of one element from each set. In set-builder notation, the Cartesian product \(A \times B\) of two sets \(A\) and \(B\) is defined as:
Intuitively, the Cartesian product here can be viewed as the set of all combinations of \(a\) and \(b\) where \(a\) is an element of \(A\) and \(b\) is an element of \(B.\)
For finite sets, the cardinality of their Cartesian product is the product of their individual cardinalities. This is expressed through the following equation: \(|A \times B| = |A| * |B|\), which is really just the rule of product.
Cartesian products of several sets
When dealing with more than \(2\) sets at once, the definition of the Cartesian product can be generalized for \(n\) sets.
This can be read as "the set of all \(n\)-tuples whose \(i\)th element is an element of the \(i\)th set." Therefore, the Cartesian product of \(n\) sets is the set of all ordered \(n\)-tuples made up of one element from each set.
Cartesian product of a set with itself
The Cartesian product of a set \(A\) with itself is typically abbreviated as \(A^n\), defined as:
If \(A\) consists of only characters, you can instead write the elements of \(A^n\) as strings rather than as ordered \(n\)-tuples, which means you can forgo the use of parentheses and commas. Take \(\set{0, 1}^3\) for example, the set of all \(3\)-bit binary strings: