Cartesian Product of Two Sets
Imagine you have two trays of ingredients. One tray has bread options: white and brown. The other has fillings: cheese and jam. If you want to make a sandwich, you pick one bread and one filling. Every possible sandwich is a pair: (white, cheese), (white, jam), (brown, cheese), (brown, jam). That list of all possible ordered pairs — one from the first set, one from the second — is exactly the Cartesian product.
The idea is simple: take every element from the first set and pair it with every element from the second set. Order matters — (white, cheese) is not the same as (cheese, white), because the first slot always comes from the first set.
The precise definition
Let A and B be two sets. The Cartesian product of A and B, written A×B, is the set of all ordered pairs (a,b) where a∈A and b∈B.
A×B={(a,b)∣a∈A and b∈B}
∣A×B∣=∣A∣⋅∣B∣
If A has m elements and B has n elements, then A×B has m×n elements. That's why it's called a product — the sizes multiply.
A concrete example
Let A={1,2} and B={x,y,z}.
Then A×B is:
A×B={(1,x),(1,y),(1,z),(2,x),(2,y),(2,z)}
Notice: 2 elements in A, 3 in B, and 2×3=6 ordered pairs in the product.
A×B is not the same as B×A unless A=B. For the sets above, B×A would be {(x,1),(x,2),(y,1),(y,2),(z,1),(z,2)} — a different set of pairs.
Why "Cartesian"?
The name comes from René Descartes, who invented the coordinate plane. The xy-plane you know is actually R×R — every point (x,y) is an ordered pair where x and y are real numbers. That's the most famous Cartesian product of all.
Key points to remember
- Each element of A×B is an ordered pair — the first component comes from A, the second from B.
- If either A or B is empty, then A×B=∅. You can't form a pair if one set has nothing to contribute.
- The product can be extended to more than two sets: A×B×C is the set of ordered triples (a,b,c).
The Cartesian product is the foundation for relations and functions. A relation from A to B is simply a subset of A×B. A function is a special kind of relation. So mastering this concept now will pay off immediately in the next chapters.