Cartesian product
1 min read
Cartesian product
The cartesian product of two sets A and B, denoted by A×B, is the set of all possible ordered pairs (a,b) where a∈A and b∈B:
A×B:={(x,y):x∈A∧y∈B}
B×A:={(y,x):x∈A∧y∈B}=A×B
e.g.: A={1,2,3} and B={a,b}, then A×B={(1,a),(1,b),(2,a),(2,b),(3,a),(3,b)}The cartesian product is not commutative: A×B=B×A
Taking the cartesian product of mutiple sets:
A1×A2×⋯×An={(a1,a2,…an)∣∀i:ai∈Ai}