The Cartesian product A×B, of sets A and B, is the set of all ordered pairs (a, b), where a ∈ A and b ∈ B. More generally, for sets A1, A2,…, An, the Cartesian product A1×A2×…×An can be defined as the set of ordered n-tuples (a1,a2,…,an) where ai ∈ Ai for each i.