Power Sets and Cartesian Products

Power sets and Cartesian products build new sets from old ones. The power set \mathcal{P}(A) is the set of all subsets of A, including ∅ and A itself, and a set with n elements has 2n subsets. The Cartesian product A × B is the set of all ordered pairs (a, b) with a in A and b in B.

Before this lesson: Sets and Subsets and Set Operations

What is a power set?

The power set of a set A is the set whose elements are all the subsets of A. It is written \mathcal{P}(A), and some books write 2A. The elements of a power set are themselves sets.

\mathcal{P}(A) = \{S : S \subseteq A\}

For example, the subsets of {a, b} are ∅, {a}, {b} and {a, b}, so \mathcal{P}(\{a, b\}) = \{\varnothing, \{a\}, \{b\}, \{a, b\}\}. The empty set is always in the power set, because ∅ is a subset of every set, and A is always in its own power set.

Why a set with n elements has 2n subsets

To build a subset of A, go through the elements one at a time and decide whether each one is in or out. Each element gives 2 choices, and the choices are independent, so n elements give 2 · 2 · … · 2 = 2n subsets. This is the multiplication principle from permutations and combinations.

\vert \mathcal{P}(A)\vert = 2^n \quad \text{when } \vert A\vert = n

You can also count the subsets by size. There are \binom{n}{k} subsets with exactly k elements, so adding the counts for every size from 0 to n also gives 2n. For {a, b, c}, the counts by size are 1, 3, 3 and 1.

A diagram of the 8 subsets of {a, b, c} in four rows by size. Row 0 holds the empty set; row 1 holds {a}, {b} and {c}; row 2 holds {a, b}, {a, c} and {b, c}; row 3 holds {a, b, c}. Lines join each subset to the one-element-larger subsets that contain it.
The power set of {a, b, c} has 1 + 3 + 3 + 1 = 8 = 2³ subsets.

What is a Cartesian product?

An ordered pair (a, b) lists two objects in a fixed order, so (1, 2) ≠ (2, 1). Two ordered pairs are equal only when their first entries match and their second entries match. The Cartesian product of A and B is the set of every ordered pair whose first entry comes from A and whose second entry comes from B.

A \times B = \{(a, b) : a \in A \land b \in B\}

Each element of A pairs with each element of B, so \vert A \times B\vert = \vert A\vert \cdot \vert B\vert. Order matters: A × B and B × A have the same size but usually different elements. If either set is empty, A × B = ∅, because there is nothing to pair.

The same idea works for more sets. A × B × C is the set of ordered triples (a, b, c), and Ak means A × A × … × A with k factors. The plane ℝ × ℝ = ℝ2 is the coordinate plane, and ℝ3 is three-dimensional space.

Power set and Cartesian product formulas

QuantityFormulaExample
Subsets of an n-element set\vert \mathcal{P}(A)\vert = 2^n{1, 2, 3} has 2³ = 8 subsets
Subsets with exactly k elements\binom{n}{k}{1, 2, 3} has C(3, 2) = 3 two-element subsets
Size of a Cartesian product\vert A \times B\vert = \vert A\vert \cdot \vert B\verta 2-element set times a 3-element set has 6 pairs
Size of a k-fold product\vert A^k\vert = \vert A\vert^k{0, 1}³ has 2³ = 8 ordered triples

Power sets and Cartesian products examples

Example 1: Listing a power set

Let A = {1, 2, 3}. List every element of \mathcal{P}(A).

\text{Size 0: } \varnothing

The empty set is a subset of every set.

\text{Size 1: } \{1\},\ \{2\},\ \{3\}

Take the elements one at a time.

\text{Size 2: } \{1, 2\},\ \{1, 3\},\ \{2, 3\}

Take the elements two at a time.

\text{Size 3: } \{1, 2, 3\}

A is a subset of itself.

1 + 3 + 3 + 1 = 8

Count the subsets in each row and add.

2^3 = 8

Check with the formula for n = 3 (see exponents).

Answer: \mathcal{P}(A) = \{\varnothing, \{1\}, \{2\}, \{3\}, \{1, 2\}, \{1, 3\}, \{2, 3\}, \{1, 2, 3\}\}. Listing by size makes it easy to see that no subset is missing.

Example 2: Finding A × B and B × A

Let A = {x, y} and B = {1, 2, 3}. Find A × B and B × A, and compare them.

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

Pair each element of A with each element of B, with the element of A first. The table above lists every pair.

\vert A \times B\vert = 2 \cdot 3 = 6

Multiply the sizes: |A| = 2 and |B| = 3.

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

Now the element of B comes first.

(x, 1) \in A \times B,\ (x, 1) \notin B \times A

The first entry of a pair in B × A must be a number, so the products differ.

Answer: A × B and B × A each have 6 ordered pairs, but A × B ≠ B × A. The Cartesian product is not commutative.

Example 3: Counting pizzas (word problem)

A pizza shop offers 3 crusts and 6 toppings. A pizza is one crust plus any set of toppings, including no toppings. How many different pizzas are possible? How many have at least one topping?

\vert \mathcal{P}(T)\vert = 2^6

Let T be the set of 6 toppings. Each possible set of toppings is a subset of T.

2^6 = 64

Evaluate the power: 2 · 2 · 2 · 2 · 2 · 2 = 64.

\vert C \times \mathcal{P}(T)\vert = \vert C\vert \cdot \vert \mathcal{P}(T)\vert

Let C be the set of 3 crusts. A pizza is an ordered pair (crust, set of toppings), so use the product formula.

= 3 \cdot 64

Substitute |C| = 3 and |𝒫(T)| = 64.

= 192

Multiply.

64 - 1 = 63

At least one topping: remove the empty set from the topping choices.

3 \cdot 63 = 189

Pair each nonempty topping set with each crust.

Answer: 192 different pizzas are possible, and 189 of them have at least one topping.

Example 4: Elements versus subsets of a power set

Let A = {1, 2}. (a) Find \mathcal{P}(\varnothing) and \mathcal{P}(\{\varnothing\}). (b) Decide whether {1} ∈ 𝒫(A), whether 1 ∈ 𝒫(A), and whether {{1}} ⊆ 𝒫(A). (c) How many elements does \mathcal{P}(\mathcal{P}(A)) have?

\mathcal{P}(\varnothing) = \{\varnothing\}

(a) The only subset of ∅ is ∅ itself, so 𝒫(∅) has 2⁰ = 1 element. It is not empty.

\mathcal{P}(\{\varnothing\}) = \{\varnothing, \{\varnothing\}\}

The set {∅} has one element, ∅, so its subsets are ∅ and {∅}.

\{1\} \in \mathcal{P}(A)

(b) True: {1} ⊆ A, and the elements of 𝒫(A) are the subsets of A.

1 \notin \mathcal{P}(A)

1 is a number, not a set, so it is not a subset of A.

\{\{1\}\} \subseteq \mathcal{P}(A)

True: the only element of {{1}} is {1}, and {1} ∈ 𝒫(A).

\vert \mathcal{P}(A)\vert = 2^2 = 4

(c) A has 2 elements.

\vert \mathcal{P}(\mathcal{P}(A))\vert = 2^4 = 16

𝒫(A) has 4 elements, so apply the formula again.

Answer: (a) 𝒫(∅) = {∅} and 𝒫({∅}) = {∅, {∅}}. (b) {1} ∈ 𝒫(A) is true, 1 ∈ 𝒫(A) is false, and {{1}} ⊆ 𝒫(A) is true. (c) 𝒫(𝒫(A)) has 16 elements.

Example 5: Proving a distributive law for Cartesian products

Prove that A × (B ∪ C) = (A × B) ∪ (A × C).

(x, y) \in A \times (B \cup C)

Start with an arbitrary ordered pair (x, y).

\iff x \in A \land y \in B \cup C

Definition of Cartesian product.

\iff x \in A \land (y \in B \lor y \in C)

Definition of union.

\iff (x \in A \land y \in B) \lor (x \in A \land y \in C)

Distributive law of logic (see logical equivalence).

\iff (x, y) \in A \times B \lor (x, y) \in A \times C

Definition of Cartesian product, twice.

\iff (x, y) \in (A \times B) \cup (A \times C)

Definition of union.

Answer: every step is an “if and only if,” and every element of either side is an ordered pair, so the two sets are equal. Check with A = {1}, B = {2} and C = {3}: both sides equal {(1, 2), (1, 3)}.

Common mistakes

MistakeExample of the errorFix
Leaving out ∅ or A itselfListing only 6 subsets of {1, 2, 3}Every power set contains ∅ and A. {1, 2, 3} has 2³ = 8 subsets.
Mixing up ∈ and ⊆ with power setsWriting 1 ∈ 𝒫({1, 2})The elements of 𝒫(A) are sets: {1} ∈ 𝒫({1, 2}), but 1 is not.
Saying the power set of ∅ is empty𝒫(∅) = ∅𝒫(∅) = {∅}, which has 2⁰ = 1 element.
Treating ordered pairs like sets(1, 2) = (2, 1)Order matters in a pair. {1, 2} = {2, 1}, but (1, 2) ≠ (2, 1).
Assuming A × B = B × A{x} × {1} = {1} × {x}{(x, 1)} ≠ {(1, x)}. Only the sizes are always equal.
Adding sizes for a product|A × B| = 2 + 3 = 5 in Example 2Multiply: |A × B| = 2 · 3 = 6.

Related ideas

For infinite sets, Cantor’s theorem says the power set of a set is always larger than the set itself; see countable and uncountable sets.

A subset of an n-element set matches an n-bit string: write 1 when an element is in and 0 when it is out. That is why a truth table with n variables has 2n rows. Counting subsets by size gives the row sums of Pascal’s triangle from the binomial theorem, and a proof by induction also shows that adding one element doubles the number of subsets.

Any subset of A × B is called a relation from A to B, and a function is a relation that pairs each input with exactly one output (see relations and functions). The next lesson, Injective, Surjective and Bijective Functions, sorts functions by how they pair inputs and outputs.

Practice problems

  1. List every element of 𝒫({p, q}).
  2. How many subsets does a set with 7 elements have? How many of them are proper subsets?
  3. Let A = {0, 1} and B = {a, b, c}. Find A × B.
  4. With A and B from Problem 3, find |B × A| and |A × A × A|.
  5. Let A = {1, 2, 3}. Decide whether each statement is true or false: (a) {2} ∈ 𝒫(A), (b) 2 ∈ 𝒫(A), (c) ∅ ⊆ 𝒫(A), (d) {{1}} ⊆ 𝒫(A).
  6. How many subsets of {1, 2, 3, 4, 5, 6} have exactly 2 elements?
  7. Find 𝒫(∅) and 𝒫(𝒫(∅)).
  8. A locker code is one letter from {A, B, C, D} followed by one digit from 0 to 9. How many codes are possible? How many are possible if the letter is followed by two digits?
  9. A salad bar has 5 toppings and 4 dressings. A salad is any set of toppings (possibly none) plus exactly one dressing. How many different salads are possible?
  10. Prove that if A ⊆ B, then 𝒫(A) ⊆ 𝒫(B).
Show answers

1.

\mathcal{P}(\{p, q\}) = \{\varnothing, \{p\}, \{q\}, \{p, q\}\}

List the subsets by size: 0, 1 and 2 elements.

2^2 = 4

Check the count with the formula.

Answer: {∅, {p}, {q}, {p, q}}

2.

2^7 = 128

A set with 7 elements has 2⁷ subsets.

128 - 1 = 127

Proper subsets: remove the set itself.

Answer: 128 subsets, of which 127 are proper subsets

3.

A \times B = \{(0, a), (0, b), (0, c), (1, a), (1, b), (1, c)\}

Pair each element of A with each element of B, with the element of A first.

\vert A \times B\vert = 2 \cdot 3 = 6

Check the count: 6 pairs are listed.

Answer: {(0, a), (0, b), (0, c), (1, a), (1, b), (1, c)}

4.

\vert B \times A\vert = 3 \cdot 2 = 6

Multiply the sizes.

\vert A \times A \times A\vert = 2 \cdot 2 \cdot 2 = 8

Three factors, each of size 2.

Answer: |B × A| = 6 and |A × A × A| = 8

5.

\{2\} \subseteq A

(a) True: {2} is a subset of A, so {2} ∈ 𝒫(A).

2 \notin \mathcal{P}(A)

(b) False: 2 is a number, not a subset of A.

\varnothing \subseteq \mathcal{P}(A)

(c) True: the empty set is a subset of every set.

\{1\} \in \mathcal{P}(A)

(d) True: the only element of {{1}} is {1}, which is in 𝒫(A).

Answer: (a) true, (b) false, (c) true, (d) true

6.

\binom{6}{2} = \dfrac{6 \cdot 5}{2 \cdot 1}

Count the 2-element subsets with a combination.

= \dfrac{30}{2}

Multiply the numerator and the denominator.

= 15

Divide.

Answer: 15 subsets

7.

\mathcal{P}(\varnothing) = \{\varnothing\}

The only subset of ∅ is ∅.

\mathcal{P}(\mathcal{P}(\varnothing)) = \mathcal{P}(\{\varnothing\})

Substitute 𝒫(∅) = {∅}.

= \{\varnothing, \{\varnothing\}\}

The set {∅} has 2 subsets: ∅ and {∅}.

Answer: 𝒫(∅) = {∅} and 𝒫(𝒫(∅)) = {∅, {∅}}

8.

\vert L \times D\vert = 4 \cdot 10 = 40

Let L = {A, B, C, D} and D = {0, 1, …, 9}. A code is an ordered pair (letter, digit).

\vert L \times D \times D\vert = 4 \cdot 10 \cdot 10

With two digits, a code is an ordered triple.

= 400

Multiply: 4 · 10 = 40 and 40 · 10 = 400.

Answer: 40 codes with one digit and 400 codes with two digits

9.

\vert \mathcal{P}(T)\vert = 2^5 = 32

Let T be the set of 5 toppings. Each set of toppings is a subset of T.

\vert \mathcal{P}(T) \times R\vert = 32 \cdot 4

Let R be the set of 4 dressings. A salad is an ordered pair (set of toppings, dressing).

= 128

Multiply.

Answer: 128 different salads

10.

X \in \mathcal{P}(A)

Assume A ⊆ B, and start with an arbitrary element X of 𝒫(A).

X \subseteq A

Definition of power set.

X \subseteq B

X ⊆ A and A ⊆ B, so every element of X is in B.

X \in \mathcal{P}(B)

Definition of power set.

Answer: every element of 𝒫(A) is in 𝒫(B), so 𝒫(A) ⊆ 𝒫(B)

Power sets and Cartesian products FAQ

How many elements are in a power set?

If A has n elements, then 𝒫(A) has 2n elements. For example, a set with 4 elements has 2⁴ = 16 subsets.

Is the empty set in every power set?

Yes. The empty set is a subset of every set, so ∅ ∈ 𝒫(A) for every set A. Even 𝒫(∅) = {∅} has one element.

Is the Cartesian product commutative?

No. A × B and B × A contain different ordered pairs unless A = B or one of the sets is empty. They always have the same number of elements, |A| · |B|.

What is the difference between a power set and a Cartesian product?

A power set is built from one set and contains its subsets, so it has 2n elements. A Cartesian product is built from two or more sets and contains ordered pairs or tuples, so |A × B| = |A| · |B|.

Summary

  • The power set 𝒫(A) is the set of all subsets of A, including ∅ and A.
  • A set with n elements has 2n subsets, and C(n, k) of them have exactly k elements.
  • The Cartesian product A × B is the set of ordered pairs (a, b) with a ∈ A and b ∈ B.
  • |A × B| = |A| · |B|, but A × B ≠ B × A in general, because order matters in a pair.
  • The elements of 𝒫(A) are sets, so {a} ∈ 𝒫(A) while a ∉ 𝒫(A).

Previous lesson: Set Operations

Next lesson: Injective, Surjective and Bijective Functions

Back to the Discrete Math Index