Quant Memo
Core

Cardinality and Countability

The idea that infinite sets can have different 'sizes' — a countably infinite set can be listed off one at a time and matched to the whole numbers, while an uncountable set, like the real numbers, provably cannot be, no matter how you try to list it.

Prerequisites: Set Theory Basics

Cardinality is the mathematical notion of the "size" of a set, extended to infinite sets in a way that turns out to distinguish different sizes of infinity. Two sets have the same cardinality if there's a one-to-one correspondence (a perfect pairing with nothing left over on either side) between their elements. A set is countably infinite if it can be put in one-to-one correspondence with the natural numbers 1,2,3,1, 2, 3, \dots — meaning you could, in principle, list its elements one at a time and eventually reach any particular one.

Surprisingly, the even numbers are countably infinite despite being "half" of the natural numbers — pair n2nn \leftrightarrow 2n and every natural number matches exactly one even number, with none left over. Even the rational numbers (all fractions) are countable, via a diagonal listing scheme. But the real numbers are uncountable: Cantor's diagonal argument shows that no matter how you attempt to list all real numbers between 0 and 1, you can always construct a new real number, differing from the nn-th listed number in its nn-th decimal digit, that is guaranteed not to appear anywhere on your list — proving no such complete list can exist.

Worked example. Suppose someone claims to have listed every real number between 0 and 1: 0.3,0.5000,0.141590.\overline{3}, 0.5000\ldots, 0.14159\ldots, and so on. Build a new number by taking the 1st digit of the 1st listed number, adding 1 (wrapping 9 to 0), taking the 2nd digit of the 2nd number and adding 1, and so on down the diagonal. This new number differs from every number on the list in at least one digit — the nn-th digit versus the nn-th listed number — so it cannot be anywhere on the supposedly complete list, contradicting the claim.

Countable infinity (natural numbers, integers, rationals) can be listed one item at a time and matched to 1,2,3,1, 2, 3, \dots; uncountable infinity (the real numbers) provably cannot, via Cantor's diagonal argument — showing that "infinite" is not a single size, but a hierarchy of different, mathematically distinguishable sizes.

Related concepts

Practice in interviews

Further reading

  • Standard undergraduate real analysis treatment of countability
ShareTwitterLinkedIn