Mathematics.

set operations

Cartesian Products

Set Theory20 minDifficulty2 out of 10

You should know: set basics

Overview

The Cartesian product of two sets A and B, written A × B, is the set of all ordered pairs (a, b) with a ∈ A and b ∈ B. Order matters — (a,b) is generally different from (b,a) — which distinguishes it from an unordered pairing. For finite sets, |A × B| = |A| · |B|, and the construction extends to any finite (or infinite) list of sets, producing ordered n-tuples. The Cartesian product is the basic building block for coordinates, relations, and functions: the plane ℝ² is R × R, and any binary relation or function is simply a specially chosen subset of a Cartesian product.

Intuition

Picture a grid: rows labeled by elements of A, columns labeled by elements of B. Every cell of the grid is exactly one ordered pair (a, b), and the whole grid is A × B. This is literally how the Cartesian coordinate plane works — ℝ × ℝ is the set of all (x, y) pairs, one per point in the plane — which is why the construction is named after Descartes. Swapping A and B swaps rows and columns, giving a different (though same-size) grid, which is why order matters.

Formal Definition

Definition

For sets A and B, the Cartesian product is:

A×B={(a,b):aA and bB}A \times B = \{(a,b) : a \in A \text{ and } b \in B\}
Definition of the Cartesian product
A×B=AB|A \times B| = |A| \cdot |B|
Cardinality (finite sets)
A×BB×Ain generalA \times B \neq B \times A \quad \text{in general}
Non-commutativity
A1×A2××An={(a1,a2,,an):aiAi}A_1 \times A_2 \times \cdots \times A_n = \{(a_1, a_2, \ldots, a_n) : a_i \in A_i\}
n-fold Cartesian product (ordered n-tuples)

Worked Examples

  1. Pair each element of A with each element of B, in that order.

    A×B={(1,x),(1,y),(1,z),(2,x),(2,y),(2,z)}A \times B = \{(1,x),(1,y),(1,z),(2,x),(2,y),(2,z)\}
  2. There are |A|·|B| = 2·3 = 6 ordered pairs.

    A×B=23=6|A \times B| = 2 \cdot 3 = 6

Answer: A × B has 6 ordered pairs, as listed above.

Practice Problems

Difficulty 2/10

If |A| = 4 and |B| = 5, what is |A × B|?

Difficulty 2/10

Which of the following best describes a binary relation R from set X to set Y?

Difficulty 5/10

A restaurant menu has 3 appetizers, 5 entrées, and 4 desserts. How many distinct 3-course meals (one from each category) are possible?

Quiz

A × B is defined as:
If |A| = 3 and |B| = 7, then |A × B| equals:
A binary relation from X to Y is formally defined as:

Summary

  • A × B is the set of ordered pairs (a,b) with a ∈ A and b ∈ B; for finite sets |A×B| = |A|·|B|.
  • Order matters: A × B ≠ B × A in general, even though they have the same cardinality.
  • Relations and functions are defined as special subsets of a Cartesian product, making it foundational across mathematics.

References