Ma · Mathematics

How Do You Find the Cardinality of a Set Containing Sets?

Published By the 9to5Science editorial team

At a glance

  1. 1. Identify the outer set

    Look at the elements immediately inside the outermost pair of braces.

  2. 2. Count distinct elements

    Count each different outer element once, even if that element is itself a set.

  3. 3. Check equality

    Sets with the same members are equal, so they count as one element.

  4. 4. Keep levels separate

    The number of members inside a nested set does not change the outer set’s cardinality.

To find the cardinality of a set whose elements are themselves sets, count the distinct elements of the outer set. A nested set counts as one element at that level; its own members are not counted separately when finding the outer set’s cardinality.

For example, the set {{1,2},{3,4,5}}\{\{1,2\},\{3,4,5\}\} has cardinality 22. Its two elements are the set {1,2}\{1,2\} and the set {3,4,5}\{3,4,5\}. The fact that those elements contain two and three numbers, respectively, does not make the outer set have five elements.

Read the braces from the outside in

In an expression with nested braces, the outermost braces define the set whose cardinality you are being asked to find. The expressions separated at that outer level are its elements. Each such element may itself be a set.

For instance, in

A={{a,b},{c},d},A=\{\{a,b\},\{c\},d\},

the elements of AA are {a,b}\{a,b\}, {c}\{c\}, and dd. Assuming these are distinct, ∣A∣=3|A|=3. The first two elements are sets, but each still contributes just one element to AA.

A useful question to ask is: “What are the objects immediately inside the outermost braces?” Count those objects, after accounting for any that are equal.

Worked examples

Two nested sets with different sizes

Let

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

The outer set has two elements:

  1. {1,2}\{1,2\}
  2. {3,4,5}\{3,4,5\}

Therefore, ∣B∣=2|B|=2. The inner sets have cardinalities 22 and 33, but adding those numbers would answer a different question: it would count their members, not the elements of BB.

A set containing one set

Let

C={{1,2,3}}.C=\{\{1,2,3\}\}.

There is one object inside the outer braces: the set {1,2,3}\{1,2,3\}. Thus ∣C∣=1|C|=1, even though the sole element of CC has cardinality 33.

The number of braces can help you see the nesting, but braces themselves are not elements. Count the objects specified by the outermost braces.

Equal sets do not count twice

Consider

D={{1,2},{2,1},{∅}}.D=\{\{1,2\},\{2,1\},\{\varnothing\}\}.

Because order does not matter in a set, {1,2}={2,1}\{1,2\}=\{2,1\}. So the first two displayed entries describe the same element of DD. The distinct elements are {1,2}\{1,2\} and {∅}\{\varnothing\}, giving ∣D∣=2|D|=2.

This illustrates that a set is not a list: repeated or differently ordered descriptions of the same set do not create additional elements.

The empty set and nested empty sets

The empty set ∅\varnothing has no elements, so ∣∅∣=0|\varnothing|=0. But the set whose only element is the empty set, {∅}\{\varnothing\}, has cardinality 11. One level farther in, {{∅}}\{\{\varnothing\}\} also has cardinality 11: its only element is {∅}\{\varnothing\}.

These examples show why it matters to identify which set you are counting. The contents of a nested set belong to that nested set, not automatically to the outer set.

What if the outer set is infinite?

The same principle applies to infinite sets: the cardinality concerns the distinct elements at the outer level. For example,

E={{n}:n∈N}E=\{\{n\}:n\in\mathbb{N}\}

is the set of singleton sets {n}\{n\} for natural numbers nn. Under the usual convention that N\mathbb{N} is infinite, EE is countably infinite. Each member of EE is a one-element set, and there is one such member for each natural number.

Common mistakes

  • Adding the sizes of the inner sets. This does not give the outer set’s cardinality. Count outer elements instead.
  • Counting every written entry separately. Check whether two entries define equal sets; equal elements count once.
  • Treating braces as elements. Braces indicate how a set is written. They are not objects to count.
  • Confusing ∅\varnothing with {∅}\{\varnothing\}. The first has zero elements; the second has one.
  • Stopping at the wrong level. In a nested expression, specify which pair of outer braces defines the set whose cardinality you need.

In short, identify the outer set, list its distinct immediate elements, and count them. The fact that some or all of those elements are sets does not change the counting rule.

References

  1. Paul R. Halmos, Naive Set Theory

Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.