Discrete Math • Sets, Relations, and Functions

Cartesian products and power sets

Two fundamental constructions that generate new sets from existing ones, underpinning relations, functions, and combinatorics.

A connected graph with binary values and set braces for discrete mathematics
Inside this lesson 10 sections 5 questions 9 figures

SECTION 1

Historical Context & Motivation

The idea of pairing elements from two collections and systematically enumerating all subsets of a given collection arose long before the formal language of set theory existed. Ancient combinatorial thinking in Indian and Chinese mathematics considered arrangements and selections of objects, but it was the development of coordinate geometry and later the axiomatization of sets that gave these ideas their modern, rigorous form. The Cartesian product takes its name from René Descartes, whose coordinate system relies on pairing real numbers to identify points in the plane, while the power set emerged from Georg Cantor's groundbreaking investigations into infinite cardinalities. Together, these two constructions form the backbone of how modern mathematics builds relations, functions, probability spaces, and topological structures from elementary sets.

1637 • Descartes' La Géométrie

René Descartes publishes his method of representing geometric points as ordered pairs of numbers, implicitly defining the concept of a Cartesian product of the real line with itself.

1874 • Cantor Founds Set Theory

Georg Cantor introduces the notion of sets as foundational mathematical objects and begins studying their cardinalities, leading to the formal concept of subsets and power sets.

1891 • Cantor's Diagonal Argument

Cantor proves that the power set of any set has strictly greater cardinality than the set itself, establishing the power set as a tool for constructing larger infinities.

1908 • Zermelo's Axiomatization

Ernst Zermelo introduces the Axiom of Power Set in his axioms for set theory, guaranteeing that the collection of all subsets of any set is itself a set.

1930s • Modern Formalization

The Zermelo–Fraenkel axioms (ZF) solidify the Cartesian product and power set as standard constructions, and Kuratowski's definition of ordered pairs provides a purely set-theoretic foundation for products.

The central question these constructions address is deceptively simple: given one or more sets, how can we systematically generate every possible pairing of their elements and every possible sub-collection? Answering this question rigorously unlocks the formal definitions of relations, functions, and probability measures, and reveals deep truths about the nature of infinity itself.

SECTION 2

Core Definitions & Principles

Before diving into computations and proofs, it is essential to lay down the precise definitions that govern Cartesian products and power sets. Both constructions start from one or more existing sets and produce a new set whose elements are structured in a well-defined way. The Cartesian product pairs elements together, preserving order, while the power set collects all possible subsets, treating each subset as a single element of the resulting set. These definitions are not arbitrary; they encode the combinatorial structure that makes relations, functions, and cardinality arguments possible.

1

Ordered Pair

An ordered pair (a, b) is a pair of elements in which the first component a and the second component b are distinguished. Crucially, (a, b) ≠ (b, a) unless a = b, unlike unordered sets where {a, b} = {b, a}.
2

Cartesian Product

The Cartesian product A × B is the set of all ordered pairs (a, b) where a ∈ A and b ∈ B. It captures every possible pairing of an element from A with an element from B.
3

Power Set

The power set 𝒫(A) is the set of all subsets of A, including the empty set ∅ and A itself. Every element of 𝒫(A) is a set.
4

Cardinality Connection

If |A| = m and |B| = n, then |A × B| = m × n. If |A| = n, then |𝒫(A)| = 2ⁿ. These formulas reflect the multiplicative and exponential nature of the two constructions.
5

Empty Set Behavior

A × ∅ = ∅ for any set A, because no ordered pairs can be formed. Meanwhile, 𝒫(∅) = {∅}, a set containing exactly one element — the empty set itself.
✦

KEY TAKEAWAY

Think of the Cartesian product like a restaurant menu: if you can choose one appetizer from set A and one entrée from set B, then A × B is the set of all possible meal combinations. The power set, on the other hand, is like a buffet where for each dish you make a binary choice — take it or leave it. With n dishes, you have 2ⁿ possible plate configurations, including the empty plate.

SECTION 3

Visual Explanation

Visualizing the Cartesian product as a grid and the power set as a lattice of subsets makes the combinatorial structure of each construction immediately apparent. The following diagram illustrates the Cartesian product A × B where A = {1, 2, 3} and B = {x, y}. Each dot in the grid represents one ordered pair, and the total number of dots equals |A| × |B| = 6.

Cartesian Product: A × B where A = {1, 2, 3}, B = {x, y}Set BSet A123yx(1, x)(2, x)(3, x)(1, y)(2, y)(3, y)|A × B| = |A| × |B| = 3 × 2 = 6Each dot = one ordered pair
The grid layout shows every ordered pair in A × B. Each row corresponds to an element of B and each column to an element of A. The six colored dots represent the six elements of the Cartesian product.

Notice how the grid structure makes the multiplication principle visually self-evident: for each of the three choices along the horizontal axis (elements of A), there are exactly two choices along the vertical axis (elements of B), yielding 3 × 2 = 6 ordered pairs in total. This grid interpretation extends naturally to higher dimensions — A × B × C would be a three-dimensional lattice of ordered triples — though such constructions are harder to draw on a flat page. The key insight is that order matters in each tuple: the pair (1, x) occupies a different cell than (x, 1) would if we reversed the factors.

SECTION 4

Mathematical Framework

The formal definitions of the Cartesian product and power set rely on set-builder notation and, at a foundational level, on the axioms of Zermelo–Fraenkel set theory. Understanding these definitions precisely is essential for proving properties about relations, functions, and cardinalities.

CARTESIAN PRODUCT

A×B=(a,b)∣a∈A∧b∈BA × B = { (a, b) | a ∈ A ∧ b ∈ B }

A and B are sets. Each element of A × B is an ordered pair (a, b). The Kuratowski definition encodes (a, b) as {{a}, {a, b}}, ensuring (a, b) = (c, d) if and only if a = c and b = d.

CARDINALITY OF CARTESIAN PRODUCT

∣A×B∣=∣A∣×∣B∣|A × B| = |A| × |B|

For finite sets, the cardinality of the product equals the arithmetic product of the individual cardinalities. This follows directly from the multiplication principle in combinatorics.

POWER SET

𝒫(A)=S∣S⊆A𝒫(A) = { S | S ⊆ A }

The power set 𝒫(A) contains every subset S of A, including the empty set ∅ and A itself. Each element of 𝒫(A) is a set, not an element of A.

CARDINALITY OF POWER SET

∣𝒫(A)∣=2∣A∣|𝒫(A)| = 2^|A|

Each element of A is either included or excluded from a given subset, yielding 2 independent binary choices. By the multiplication principle, the total number of subsets is 2ⁿ where n = |A|. This result holds for finite A and generalizes via Cantor's theorem to show that 𝒫(A) always has strictly greater cardinality than A, even for infinite sets.

Several algebraic properties connect the Cartesian product to other set operations. The product distributes over union: A × (B ∪ C) = (A × B) ∪ (A × C), and similarly over intersection: A × (B ∩ C) = (A × B) ∩ (A × C). However, the Cartesian product is not commutative in general — A × B ≠ B × A unless A = B or one of them is empty — because the ordered pairs (a, b) and (b, a) are distinct objects. Likewise, it is not associative in the strict sense: (A × B) × C ≠ A × (B × C) because ((a, b), c) and (a, (b, c)) are different ordered pairs, though there is a natural bijection between them, so we often abuse notation and write A × B × C for the set of ordered triples.

ℹ

Connection to Functions

A function f: A → B is formally a subset of A × B satisfying the property that for each a ∈ A there exists exactly one b ∈ B such that (a, b) ∈ f. Equivalently, the set of all functions from A to B can be identified with the set Bᴬ, which has cardinality |B|^|A|. When B = {0, 1}, the set of all functions from A to {0, 1} is in bijection with 𝒫(A) — each function encodes a characteristic function of a subset — which gives another proof that |𝒫(A)| = 2^|A|.

SECTION 5

Power Set Lattice & Detailed Breakdown

The power set of a finite set has a rich internal structure best visualized as a Hasse diagram, which is a type of lattice diagram where subsets are arranged by inclusion. The empty set sits at the bottom, the full set at the top, and an edge connects two subsets whenever one is obtained from the other by adding exactly one element. This lattice is isomorphic to the Boolean lattice Bₙ, and it appears throughout combinatorics, logic, and computer science. The following diagram shows 𝒫({a, b, c}), which contains 2³ = 8 subsets.

Hasse Diagram of 𝒫({a, b, c}){a,b,c}{a,b}{a,c}{b,c}{a}{b}{c}∅Levels by sizeSize 3: C(3,3) = 1Size 2: C(3,2) = 3Size 1: C(3,1) = 3Size 0: C(3,0) = 1
The Hasse diagram of 𝒫({a, b, c}) shows 8 subsets arranged in four levels by cardinality. Edges connect each subset to its immediate supersets (those formed by adding one element). The number of subsets at each level follows the binomial coefficients C(3, k).

The lattice structure reveals a beautiful symmetry: the number of subsets of size k in an n-element set is the binomial coefficient C(n, k), and these coefficients sum to 2ⁿ by the binomial theorem: 2ⁿ = Σ C(n, k) for k = 0 to n. This connection between the power set cardinality and the binomial theorem is one of the most elegant bridges between set theory and algebra. Furthermore, the lattice (𝒫(A), ⊆) is a Boolean algebra under the operations of union, intersection, and complement, making it a cornerstone example in both order theory and logic.

Set A|A||𝒫(A)|Subsets Listed
∅01{ ∅ }
{a}12{ ∅, {a} }
{a, b}24{ ∅, {a}, {b}, {a, b} }
{a, b, c}38{ ∅, {a}, {b}, {c}, {a,b}, {a,c}, {b,c}, {a,b,c} }
{a, b, c, d}41616 subsets (too many to list compactly)

Growth of the power set: each additional element doubles the number of subsets.

SECTION 6

Worked Example

Let us work through a comprehensive example that exercises both the Cartesian product and the power set. Let A = {1, 2} and B = {a, b, c}. We will compute A × B, B × A, 𝒫(A), and 𝒫(A × B) step by step.

Computing Cartesian Products and Power Sets

  1. 1

    Step 1 — Compute A × B

    For each element of A, pair it with every element of B. From a = 1: (1, a), (1, b), (1, c). From a = 2: (2, a), (2, b), (2, c). We expect |A| × |B| = 2 × 3 = 6 ordered pairs.
    A × B = { (1, a), (1, b), (1, c), (2, a), (2, b), (2, c) }
  2. 2

    Step 2 — Compute B × A

    Now reverse the factors. For each element of B, pair it with every element of A. This yields pairs like (a, 1) and (a, 2), which are distinct from (1, a) and (2, a) because order matters. We still get |B| × |A| = 3 × 2 = 6 pairs, but they are different pairs.
    B × A = { (a, 1), (a, 2), (b, 1), (b, 2), (c, 1), (c, 2) } ≠ A × B
  3. 3

    Step 3 — Compute 𝒫(A)

    Enumerate all subsets of A = {1, 2}. For each element, decide independently whether to include or exclude it. With 2 elements we expect 2² = 4 subsets: the empty set, two singletons, and the full set.
    𝒫(A) = { ∅, {1}, {2}, {1, 2} }
  4. 4

    Step 4 — Determine |𝒫(A × B)|

    The set A × B has 6 elements (computed in Step 1). The power set of a 6-element set has 2⁶ = 64 elements. Listing all 64 subsets is impractical, but the cardinality follows directly from the formula. Each of the 6 ordered pairs is independently included or excluded.
    |𝒫(A × B)| = 2⁶ = 64
  5. 5

    Step 5 — Verify a Key Property

    Check the distributive property: A × (B ∩ C) = (A × B) ∩ (A × C). Let C = {b, c, d}. Then B ∩ C = {b, c}. The left side gives A × {b, c} = {(1,b), (1,c), (2,b), (2,c)}. For the right side, A × C = {(1,b), (1,c), (1,d), (2,b), (2,c), (2,d)}, and (A × B) ∩ (A × C) picks out only pairs present in both: {(1,b), (1,c), (2,b), (2,c)}, confirming equality.
    A × (B ∩ C) = (A × B) ∩ (A × C) = { (1,b), (1,c), (2,b), (2,c) } ✓

SECTION 7

Properties, Pitfalls, and Comparisons

Students often confuse the Cartesian product with set intersection or union, and confuse elements of a power set with elements of the original set. Understanding the precise algebraic properties of each construction — and where the common mistakes arise — is essential for working confidently with these objects.

PropertyCartesian Product (A × B)Power Set (𝒫(A))
Elements areOrdered pairs (a, b)Sets (subsets of A)
Cardinality|A| × |B| (multiplicative)2^|A| (exponential)
Commutative?No. A × B ≠ B × A in generalN/A (unary operation)
Associative?Not strictly, but naturally isomorphicN/A (unary operation)
Distributes over ∪?Yes: A × (B ∪ C) = (A × B) ∪ (A × C)𝒫(A ∪ B) ≠ 𝒫(A) ∪ 𝒫(B) in general
Empty set behaviorA × ∅ = ∅𝒫(∅) = {∅}, with |𝒫(∅)| = 1

Comparison of key properties of Cartesian products and power sets.

⚠

Common Mistake

Students frequently write statements like "2 ∈ 𝒫({1, 2, 3})" — but this is false. The elements of the power set are sets, not individual elements. The correct statement is {2} ∈ 𝒫({1, 2, 3}), and also 2 ∈ {1, 2, 3}. Confusing the membership relation (∈) with the subset relation (⊆) is the single most common error in power set problems.
✦

KEY TAKEAWAY

The Cartesian product and the power set represent two fundamentally different ways of generating combinatorial complexity. The product grows multiplicatively, combining elements across sets, while the power set grows exponentially, enumerating all possible selections within a single set. In database theory, the Cartesian product corresponds to the cross-join of two tables, while the power set corresponds to enumerating all possible query filters on a table's rows.

SECTION 8

Connections to Advanced Theory

The Cartesian product and power set are not merely computational tools for finite sets; they are gateways to some of the deepest ideas in mathematics. Cantor's theorem — that there is no surjection from A onto 𝒫(A) — implies that the hierarchy of infinite cardinalities never terminates. The Cartesian product, meanwhile, generalizes to infinite products that underpin topology (the product topology), measure theory (product σ-algebras), and functional analysis (sequence spaces as ℝℕ). Understanding these finite constructions thoroughly prepares you for these powerful generalizations.

Concept in This LessonAdvanced GeneralizationWhere It Appears
A × B (binary product)∏ᵢ Aᵢ (arbitrary indexed product)Topology, measure theory, Tychonoff's theorem
𝒫(A) with |𝒫(A)| = 2^|A|Cantor's theorem: |A| < |𝒫(A)| for all ACardinal arithmetic, continuum hypothesis
Subsets as characteristic functionsMeasurable sets, indicator functionsProbability theory, Lebesgue integration
Functions as subsets of A × BMorphisms in category theoryAbstract algebra, homological algebra
Power set lattice (𝒫(A), ⊆)Boolean algebras, σ-algebrasLogic, automata theory, formal verification

How the finite constructions in this lesson generalize to advanced mathematics.

In your upcoming study of relations and functions, you will see the Cartesian product repeatedly: a binary relation on A and B is simply a subset R ⊆ A × B, and a function is a relation satisfying an additional uniqueness condition. The power set appears whenever you study event spaces in probability (the set of all possible events is 𝒫(Ω) for the sample space Ω) or when you define topologies (a topology on X is a particular subcollection of 𝒫(X) closed under unions and finite intersections). Mastering these basic constructions now will make these advanced structures feel natural rather than mysterious.

SECTION 9

Practice Problems

Question 1: CONCEPTUAL

Explain why A × B ≠ B × A in general, even though |A × B| = |B × A|. Under what conditions does A × B = B × A?
Show answer
A × B and B × A contain ordered pairs with components in different positions: (a, b) ∈ A × B while (b, a) ∈ B × A, and these are distinct unless a = b. However, both sets have the same cardinality because |A × B| = |A| × |B| = |B| × |A| = |B × A| by commutativity of multiplication. The two sets are equal precisely when A = B, or when at least one of A or B is the empty set (since both products would then be ∅). In particular, A × A is well-defined and commonly written A², and trivially A² = A × A.

Question 2: BASIC CALCULATION

Let C = {x, y, z} and D = {1, 2}. List all elements of C × D and compute |𝒫(D)|. Then list the elements of 𝒫(D).
Show answer
C × D = { (x,1), (x,2), (y,1), (y,2), (z,1), (z,2) }, which has |C| × |D| = 3 × 2 = 6 elements. For the power set, |𝒫(D)| = 2^|D| = 2² = 4. The elements of 𝒫(D) are: ∅, {1}, {2}, {1, 2}. Note that every element of 𝒫(D) is itself a set, not an element of D.

Question 3: INTERMEDIATE

Let A = {1, 2, 3} and B = {2, 3, 4}. Compute (A ∩ B) × (A ∪ B). Then verify that (A ∩ B) × (A ∪ B) = (A × (A ∪ B)) ∩ (B × (A ∪ B)).
Show answer
First, A ∩ B = {2, 3} and A ∪ B = {1, 2, 3, 4}. So (A ∩ B) × (A ∪ B) = {(2,1), (2,2), (2,3), (2,4), (3,1), (3,2), (3,3), (3,4)}, which has 2 × 4 = 8 elements. For verification, A × (A ∪ B) has 3 × 4 = 12 elements (all pairs with first component in {1,2,3}), and B × (A ∪ B) has 3 × 4 = 12 elements (first component in {2,3,4}). Their intersection keeps only those pairs whose first component lies in both A and B, i.e., in {2,3}, and whose second component lies in A ∪ B. This gives exactly the 8 pairs computed above, confirming the identity (A ∩ B) × C = (A × C) ∩ (B × C).

Question 4: APPLIED

A database has a table Students with 500 rows and a table Courses with 80 rows. A cross-join computes the Cartesian product of the two tables. If the system then filters this cross-join to keep only valid enrollments, and there are 2,400 actual enrollment records, what percentage of the full Cartesian product represents actual enrollments? Also, if an administrator wants to define a set of possible course bundles (subsets of Courses), how many possible bundles exist?
Show answer
The full Cartesian product has |Students × Courses| = 500 × 80 = 40,000 rows. The 2,400 actual enrollments represent 2,400 / 40,000 = 0.06, or 6% of the full product. This illustrates that a relation (enrollment) is a subset of the Cartesian product, typically much smaller than the full product. For course bundles, the number of possible subsets of a set of 80 courses is |𝒫(Courses)| = 2⁸⁰ ≈ 1.21 × 10²⁴. This astronomically large number demonstrates the explosive growth of the power set and explains why exhaustive search over all subsets is computationally infeasible for even moderately sized sets.

Question 5: CRITICAL THINKING

Prove that for any finite set A with |A| = n, the number of elements in 𝒫(𝒫(A)) is 22n2^{2ⁿ}. Then compute |𝒫(𝒫({a, b}))| and explain why iterating the power set operator grows so rapidly.
Show answer
By definition, |𝒫(S)| = 2^|S| for any finite set S. Applying this with S = 𝒫(A): |𝒫(𝒫(A))| = 2^|𝒫(A)| = 22n2^{2ⁿ}. For A = {a, b}, we have n = 2, so |𝒫(A)| = 4 and |𝒫(𝒫(A))| = 2⁴ = 16. The rapid growth arises because each application of the power set operator raises 2 to the power of the previous cardinality, creating a tower of exponentials (tetration). Even starting from |A| = 4, we get |𝒫(A)| = 16, |𝒫(𝒫(A))| = 2¹⁶ = 65,536, and |𝒫(𝒫(𝒫(A)))| = 2⁶⁵⁵³⁶, a number with nearly 20,000 digits. This super-exponential growth is the engine behind Cantor's proof that there are infinitely many distinct infinite cardinalities: ℵ₀ < 2^ℵ₀ < 2^(2^ℵ₀) < ···, with no upper bound.

SUMMARY

Summary & Review

Summary

The Cartesian product A × B constructs the set of all ordered pairs (a, b) with a ∈ A and b ∈ B, yielding a set of cardinality |A| × |B|. This construction is not commutative — A × B ≠ B × A in general — and it distributes over union and intersection. The Cartesian product provides the formal foundation for relations and functions, both of which are defined as subsets of a Cartesian product.

The power set 𝒫(A) collects every subset of A into a single set, always including ∅ and A itself. Its cardinality is 2ⁿ, reflecting the binary include-or-exclude choice for each of the n elements. The Hasse diagram reveals that the power set forms a Boolean lattice under subset inclusion, and Cantor's theorem guarantees that the power set of any set — finite or infinite — has strictly greater cardinality than the original set. Together, these two constructions are indispensable building blocks for discrete mathematics, combinatorics, and the foundations of analysis.

Varsity Tutors • Discrete Math • Cartesian products and power sets