• Foundation
  • About 16 min
  • 5 practice questions

Ordered pairs and the Cartesian product of sets

Use equality of ordered pairs, form the Cartesian product A × B, count its elements with n(A × B) = pq, and recover A and B from a product.

If something looks wrong, please tell us.

By the end of this lesson you can

  • Explain why the order inside an ordered pair matters, and solve equations using equality of ordered pairs.
  • Form A × B, B × A and A × A × A for small sets.
  • Use n(A × B) = n(A) × n(B) and know that A × φ = φ.
  • Recover the sets A and B from a given product A × B.

Relations and functions link the elements of one set to the elements of another. Before we can describe such links, we need a way to put two objects together in a definite order. That tool is the ordered pair, and the set of all ordered pairs from two sets is the Cartesian product, named after René Descartes, who used pairs of numbers to locate points in a plane.

Ordered pairs

An ordered pair (a, b) is a pair of objects written in round brackets in a particular order: a is the first element and b is the second. Order matters. The point (2, 5) on a graph is not the point (5, 2), and a train ticket from Pune to Nagpur is not a ticket from Nagpur to Pune.

(a, b) = (x, y) if and only if a = x and b = y.

— Equality of ordered pairs

Worked example 1: equal ordered pairs

If (2x − 1, y + 4) = (7, −2), find x and y. Working: corresponding elements must be equal, so 2x − 1 = 7 and y + 4 = −2. The first gives 2x = 8, so x = 4; the second gives y = −6. Check: (2 × 4 − 1, −6 + 4) = (7, −2).

The Cartesian product

Let A and B be non-empty sets. The Cartesian product A × B is the set of all ordered pairs whose first element is from A and whose second element is from B: A × B = {(a, b) : a ∈ A, b ∈ B}. If either set is empty, the product is empty: A × φ = φ.

Suppose a shop sells T-shirts in sizes S = {M, L} and colours C = {red, white, black}. Every possible T-shirt is a pair (size, colour), so the range on offer is S × C = {(M, red), (M, white), (M, black), (L, red), (L, white), (L, black)}. There are 2 × 3 = 6 pairs.

Building A × B in an orderly way

  1. Fix the first element of A Take the first element a₁.
  2. Pair it with every element of B (a₁, b₁), (a₁, b₂), ...
  3. Move to the next element of A Repeat with a₂, a₃, ...
  4. Count You should get n(A) × n(B) pairs.

Facts about Cartesian products

  • If n(A) = p and n(B) = q, then n(A × B) = pq.
  • In general A × B ≠ B × A, because (a, b) ≠ (b, a) when a ≠ b. But n(A × B) = n(B × A).
  • If A and B are non-empty and at least one of them is infinite, then A × B is infinite.
  • A × A × A = {(a, b, c) : a, b, c ∈ A}; its elements are ordered triplets.
  • R × R = {(x, y) : x, y ∈ R} is the set of all points of the coordinate plane, and R × R × R is the set of all points of three-dimensional space.

Worked example 2: A × B and B × A

Let A = {1, 2} and B = {x, y, z}. Working: A × B = {(1, x), (1, y), (1, z), (2, x), (2, y), (2, z)} and B × A = {(x, 1), (x, 2), (y, 1), (y, 2), (z, 1), (z, 2)}. Each has 2 × 3 = 6 elements, but (1, x) ∈ A × B while (1, x) ∉ B × A, so A × B ≠ B × A.

Worked example 3: products with ∩ and ∪

Let A = {1, 2}, B = {2, 3} and C = {3, 4}. Find A × (B ∩ C) and (A × B) ∩ (A × C). Working: B ∩ C = {3}, so A × (B ∩ C) = {(1, 3), (2, 3)}. Next, A × B = {(1, 2), (1, 3), (2, 2), (2, 3)} and A × C = {(1, 3), (1, 4), (2, 3), (2, 4)}. Their common pairs are (1, 3) and (2, 3). So both sets equal {(1, 3), (2, 3)}.

Worked example 4: ordered triplets

Let P = {0, 1}. Then P × P × P has 2 × 2 × 2 = 8 triplets: (0, 0, 0), (0, 0, 1), (0, 1, 0), (0, 1, 1), (1, 0, 0), (1, 0, 1), (1, 1, 0), (1, 1, 1).

Worked example 5: recovering A and B

If A × B = {(p, 4), (p, 7), (q, 4), (q, 7)}, find A and B. Working: A is the set of first elements and B the set of second elements, so A = {p, q} and B = {4, 7}. Check: 2 × 2 = 4 pairs, as given.

Worked example 6: using the count

A × A has 9 elements, two of which are (3, 1) and (5, 3). Find A. Working: n(A)² = 9, so n(A) = 3. Every coordinate of a pair in A × A belongs to A, so 1, 3 and 5 are in A. That is already 3 elements, so A = {1, 3, 5}.

Key takeaways: in an ordered pair the order matters, and two pairs are equal only when their first elements match and their second elements match. A × B collects every pair (a, b) with a ∈ A and b ∈ B, has pq elements, and is generally different from B × A. A × φ = φ.

Check your understanding

  1. 1. If (x + 3, 2y − 1) = (5, 9), what are x and y?

    1. x = 8, y = 4
    2. x = 2, y = 4
    3. x = 2, y = 5
    4. x = 8, y = 5
    Show answer

    Answer: C. Equal ordered pairs have equal first elements and equal second elements: x + 3 = 5 gives x = 2, and 2y − 1 = 9 gives 2y = 10, so y = 5.

  2. 2. If n(A) = 4 and n(B) = 3, how many elements does A × B have?

    1. 7
    2. 12
    3. 64
    4. 81
    Show answer

    Answer: B. n(A × B) = n(A) × n(B) = 4 × 3 = 12. Adding (7) or taking powers (4³ = 64, 3⁴ = 81) does not count ordered pairs.

  3. 3. If A × B = {(a, 1), (a, 3), (b, 1), (b, 3), (c, 1), (c, 3)}, what is B?

    1. {a, b, c}
    2. {1, 3}
    3. {1, 2, 3}
    4. {(a, 1), (b, 3)}
    Show answer

    Answer: B. B is the set of second elements of the pairs. The second elements that appear are 1 and 3, so B = {1, 3}. The first elements give A = {a, b, c}.

  4. 4. Assertion (A): For A = {1} and B = {2}, A × B ≠ B × A. Reason (R): The ordered pair (1, 2) is not equal to (2, 1).

    1. Both A and R are true, and R is the correct explanation of A.
    2. Both A and R are true, but R is not the correct explanation of A.
    3. A is true, but R is false.
    4. A is false, but R is true.
    Show answer

    Answer: A. A × B = {(1, 2)} and B × A = {(2, 1)}. These differ precisely because (1, 2) ≠ (2, 1): equal pairs need equal first elements, and 1 ≠ 2. So both are true and R explains A.

  5. 5. Let A = {a} and B = {1, 2, 3}. How many subsets does A × B have?

    1. 3
    2. 6
    3. 8
    4. 9
    Show answer

    Answer: C. A × B = {(a, 1), (a, 2), (a, 3)} has 1 × 3 = 3 elements. A set with 3 elements has 2³ = 8 subsets, since each element can be in or out of a subset.

Sign in to keep track of the lessons you finish.

Next lesson → Relations: domain, codomain and range

Privacy · Terms · Refunds · Delivery