Cartesian product

Let \(A\) and \(B\) be some set. The set of all ordered pairs \((a, b)\) such that \(a\in A\) and \(b \in B\) is called the cartesian product. $$ A\times B = {(a, b)| a\in A, b\in B} $$ Example: Let \(A = \{m, p\}\), \(B = \{5, 7, 9\}\). Then, $$ A\times B = {(m, 5), (m, 7), (m, 9), (p, 5), (p, 7), (p, 9)} $$