Show 

Cartesian Product

The cartesian product of two sets is the set of all possible pairs of elements, where the first element of each pair is taken from the first set, and the second element is taken from the second set.  For example, the cartesian product of {low, medium, high} with {true, false} is {(low, true), (low, false), (medium, true), (medium, false), (high, true), (high, false)}

The cartesian product is denoted using ‘x’.  It may be extended to more than two sets, as shown in this second example:

{s1, s2} x {s, h} x {wtg, mhc} =
{(s1, s, wtg), (s1, s, mhc), (s1, h, wtg),
(s1, h, mhc),
(s2, s, wtg), (s2, s, mhc),
(s2, h, wtg), (s2, h, mhc)}

The number of elements in the cartesian product is the multiplicative product of the sizes of the sets involved.  In the first example it is 3 * 2 = 6, and in the second example it is 2 * 2 * 2 = 8.

Some people spell it with a capital C (“Cartesian product”), since it is named after Descartes.

Home > Reference > Encyclopedia > Cartesian Product