MatheramaMatherama
← Relations and Functions
Relations and Functions·Section 2·10 min read

Cartesian Product

Definition§

The Cartesian product of two sets AA and BB, denoted A×BA \times B, is the set of all ordered pairs (a,b)(a, b) where a∈Aa \in A and b∈Bb \in B.

Example: Let’s consider two sets:

A={1,2}andB={x,y}A = \{1, 2\} \quad \text{and} \quad B = \{x, y\}

The Cartesian product A×BA \times B is given by all possible ordered pairs where the first element comes from AA and the second element comes from BB:

A×B={(1,x),(1,y),(2,x),(2,y)}A \times B = \{ (1, x), (1, y), (2, x), (2, y) \}

Formally,

For two sets AA and BB, the Cartesian product A×BA \times B is defined as:

A×B={(a,b)∣a∈A and b∈B}A \times B = \{ (a, b) \mid a \in A \text{ and } b \in B \}

This product is a set of ordered pairs, where each element from AA is paired with each element from BB.

Note: The Cartesian product is not commutative, meaning A×B≠B×AA \times B \neq B \times A in general, as A×BA \times B and B×AB \times A differ in the order of elements in each ordered pair.

To build an intuition for the Cartesian product of two sets, let’s think of it as a way to make connections between elements of one set and elements of another. By connecting each item in one set with each item in another, we create all possible pairs that reflect the relationships between elements in these sets.

Example: Connecting Scientists' Names§

Imagine two sets related to famous scientists:

  • Set AA: First names of scientists, such as

    A={Albert,Niels,Werner}A = \{\text{Albert}, \text{Niels}, \text{Werner}\}
  • Set BB: Last names of scientists, like

    B={Einstein,Bohr,Heisenberg}B = \{\text{Einstein}, \text{Bohr}, \text{Heisenberg}\}

The Cartesian product A×BA \times B is the set of all possible combinations of first names and last names. Each element of AA is paired with each element of BB, creating a list of pairs. So, if we consider all possible combinations, we get:

A×B={(Albert, Einstein),(Albert, Bohr),(Albert, Heisenberg),(Niels, Einstein),(Niels, Bohr),(Niels, Heisenberg),(Werner, Einstein),(Werner, Bohr),(Werner, Heisenberg)}A \times B = \{(\text{Albert, Einstein}), (\text{Albert, Bohr}), (\text{Albert, Heisenberg}), (\text{Niels, Einstein}), (\text{Niels, Bohr}), (\text{Niels, Heisenberg}), (\text{Werner, Einstein}), (\text{Werner, Bohr}), (\text{Werner, Heisenberg})\}

This product includes every possible pairing of first and last names, even though only a few are "real" names of famous scientists. But that’s the purpose of the Cartesian product: it allows us to consider all possible connections between two sets, whether they have real meaning or not.

Properties of Cartesian Product§

The Cartesian product A×BA \times B of two sets AA and BB has several important properties:

  1. Non-Commutative: Generally, A×B≠B×AA \times B \neq B \times A, since the ordered pairs (a,b)(a, b) and (b,a)(b, a) have reversed positions. This means that the Cartesian product is not commutative.

  2. Associative for Multiple Sets: For three sets AA, BB, and CC, the Cartesian product is associative in grouping:

    (A×B)×C=A×(B×C)(A \times B) \times C = A \times (B \times C)

    although the elements are ordered differently in each.

  3. Cardinality: If ∣A∣=m|A| = m and ∣B∣=n|B| = n, then ∣A×B∣=m×n|A \times B| = m \times n. This tells us that the number of elements in A×BA \times B is the product of the number of elements in each set.

  4. Distributive Over Union: The Cartesian product distributes over the union of sets:

    A×(B∪C)=(A×B)∪(A×C)A \times (B \cup C) = (A \times B) \cup (A \times C)

    and similarly,

    (A∪B)×C=(A×C)∪(B×C)(A \cup B) \times C = (A \times C) \cup (B \times C)
  5. Distributive Over Intersection: The Cartesian product distributes over intersection as well:

    A×(B∩C)=(A×B)∩(A×C)A \times (B \cap C) = (A \times B) \cap (A \times C)

    and

    (A∩B)×C=(A×C)∩(B×C)(A \cap B) \times C = (A \times C) \cap (B \times C)
  6. Empty Set: If either AA or BB is the empty set ∅\emptyset, then their Cartesian product is also empty:

    A×∅=∅and∅×B=∅A \times \emptyset = \emptyset \quad \text{and} \quad \emptyset \times B = \emptyset

For more information on properties (but they are not important for us): Wikipedia

Graphical Representation of Cartesian Product§

Let the two sets be:

A={1,2,3},B={4,5,6}.A = \{1, 2, 3\}, \quad B = \{4, 5, 6\}.

The Cartesian product A×BA \times B is:

A×B={(1,4),(1,5),(1,6),(2,4),(2,5),(2,6),(3,4),(3,5),(3,6)}.A \times B = \{(1, 4), (1, 5), (1, 6), (2, 4), (2, 5), (2, 6), (3, 4), (3, 5), (3, 6)\}.

How to Represent Graphically:

  1. Place the elements of AA along one axis (horizontal).
  2. Place the elements of BB along the other axis (vertical).
  3. For each pair (a,b)∈A×B(a, b) \in A \times B, plot a point where the xx-coordinate is aa (from AA) and the yy-coordinate is bb (from BB).

For example:

  • The pair (1,4)(1, 4) corresponds to the intersection of 11 on the horizontal axis and 44 on the vertical axis.
  • The pair (3,6)(3, 6) corresponds to the intersection of 33 on the horizontal axis and 66 on the vertical axis.

Key Insight:

When you finish, the graph will show a grid of points, illustrating that each element in AA is connected to every element in BB, which is the essence of the Cartesian product.

Cartesian products involving intervals

When one of the sets in a Cartesian product is a discrete set (like {1,2,3}\{1, 2, 3\}) and the other is a continuous interval (like [2,5][2, 5]), the result is an infinite collection of points, forming a series of continuous lines.

Example:

Let:

A={1,2,3}(a discrete set of three points)A = \{1, 2, 3\} \quad \text{(a discrete set of three points)}

and:

B=[2,5](a continuous interval).B = [2, 5] \quad \text{(a continuous interval)}.

The Cartesian product A×BA \times B is defined as:

A×B={(a,b)∣a∈A and b∈B}.A \times B = \{(a, b) \mid a \in A \text{ and } b \in B\}.

Interpretation:

  • For each a∈Aa \in A (i.e., a=1,2,3a = 1, 2, 3), we pair it with all values of b∈[2,5]b \in [2, 5].
  • This results in three continuous vertical lines in the Cartesian plane:
    • The line x=1x = 1 with y∈[2,5]y \in [2, 5],
    • The line x=2x = 2 with y∈[2,5]y \in [2, 5],
    • The line x=3x = 3 with y∈[2,5]y \in [2, 5].

Representation:

Each line corresponds to one value of aa in AA, and it spans the entire interval [2,5][2, 5] on the yy-axis:

For x=1:(1,y) for all y∈[2,5],For x=2:(2,y) for all y∈[2,5],For x=3:(3,y) for all y∈[2,5].\begin{aligned} &\text{For } x = 1: \quad (1, y) \text{ for all } y \in [2, 5], \\ &\text{For } x = 2: \quad (2, y) \text{ for all } y \in [2, 5], \\ &\text{For } x = 3: \quad (3, y) \text{ for all } y \in [2, 5]. \end{aligned}

Key Insight:

The Cartesian product A×BA \times B produces three continuous vertical lines:

  • The first at x=1x = 1,
  • The second at x=2x = 2,
  • The third at x=3x = 3,

each extending from y=2y = 2 to y=5y = 5. This is an infinite set of points because each xx value is paired with all possible yy-values within the interval [2,5][2, 5].


When both sets in a Cartesian product are continuous intervals, the result is a rectangle in the Cartesian plane, representing all possible points formed by pairing one value from the first interval with one from the second.

Example:

Let:

A=[1,3](a continuous interval on the x-axis)A = [1, 3] \quad \text{(a continuous interval on the $x$-axis)} B=[2,5](a continuous interval on the y-axis).B = [2, 5] \quad \text{(a continuous interval on the $y$-axis)}.

The Cartesian product A×BA \times B is defined as:

A×B={(x,y)∣x∈[1,3], y∈[2,5]}.A \times B = \{(x, y) \mid x \in [1, 3], \, y \in [2, 5]\}.

Interpretation:

  1. For every value of xx in [1,3][1, 3], pair it with every value of yy in [2,5][2, 5].
  2. The result is a continuous region in the Cartesian plane that forms a rectangle:
    • The horizontal range is x∈[1,3]x \in [1, 3],
    • The vertical range is y∈[2,5]y \in [2, 5].

Boundaries of the Rectangle

The Cartesian product fills all points within the rectangle bounded by the corners:

(1,2), (1,5), (3,2), (3,5).(1, 2), \, (1, 5), \, (3, 2), \, (3, 5).

Thus, the rectangle spans:

  • Left side at x=1x = 1,
  • Right side at x=3x = 3,
  • Bottom at y=2y = 2,
  • Top at y=5y = 5.

Visual Representation

The Cartesian product [1,3]×[2,5][1, 3] \times [2, 5] includes every point (x,y)(x, y) within this rectangle, forming a solid filled region in the plane. Each pair (x,y)(x, y) corresponds to one specific coordinate within the rectangle.

Cartesian Product of a Set with Itself§

When we take the Cartesian product of a set with itself, we are pairing every element of the set with every other element of the same set. For a set AA, the Cartesian product A×AA \times A is defined as:

A×A={(a1,a2)∣a1∈A,a2∈A}.A \times A = \{(a_1, a_2) \mid a_1 \in A, a_2 \in A\}.

This represents all possible ordered pairs formed by taking elements from AA.


Example 1:

Let A={1,2,3}A = \{1, 2, 3\}. The Cartesian product A×AA \times A is:

A×A={(1,1),(1,2),(1,3),(2,1),(2,2),(2,3),(3,1),(3,2),(3,3)}.A \times A = \{(1, 1), (1, 2), (1, 3), (2, 1), (2, 2), (2, 3), (3, 1), (3, 2), (3, 3)\}.

Here, A×AA \times A includes:

  • Pairs where both elements are the same, like (1,1),(2,2),(3,3)(1, 1), (2, 2), (3, 3).
  • Pairs where the elements are different, like (1,2),(2,1),(2,3),(1, 2), (2, 1), (2, 3), etc.

This can be visualized as a grid of points if AA is finite.

Example 2:

If A=RA = \mathbb{R} (the set of all real numbers), the Cartesian product R×R\mathbb{R} \times \mathbb{R} represents the entire 2D Cartesian plane. Every point (x,y)(x, y) where x,y∈Rx, y \in \mathbb{R} belongs to this product.

Cartesian Product of Three Sets§

The Cartesian product of three sets AA, BB, and CC, written as A×B×CA \times B \times C, is the set of all ordered triples (a,b,c)(a, b, c), where a∈Aa \in A, b∈Bb \in B, and c∈Cc \in C. Formally:

A×B×C={(a,b,c)∣a∈A, b∈B, c∈C}.A \times B \times C = \{(a, b, c) \mid a \in A, \, b \in B, \, c \in C\}.

Example:

Let:

A={1,2},B={x,y},C={p,q}.A = \{1, 2\}, \quad B = \{x, y\}, \quad C = \{p, q\}.

Then:

A×B×C={(1,x,p),(1,x,q),(1,y,p),(1,y,q),(2,x,p),(2,x,q),(2,y,p),(2,y,q)}.A \times B \times C = \{(1, x, p), (1, x, q), (1, y, p), (1, y, q), (2, x, p), (2, x, q), (2, y, p), (2, y, q)\}.

Ternary Product of the Same Set AA

If AA is a single set and we form the ternary product A×A×A=A3A \times A \times A = A^3, it includes all ordered triples (a1,a2,a3)(a_1, a_2, a_3) where a1,a2,a3∈Aa_1, a_2, a_3 \in A.

Example: A={1,2}A = \{1, 2\}

A3={(1,1,1),(1,1,2),(1,2,1),(1,2,2),(2,1,1),(2,1,2),(2,2,1),(2,2,2)}.A^3 = \{(1, 1, 1), (1, 1, 2), (1, 2, 1), (1, 2, 2), (2, 1, 1), (2, 1, 2), (2, 2, 1), (2, 2, 2)\}.
Section 2 of 18 · Relations and Functions

Mark this section complete when you have worked through its proofs.