Countable and Uncountable Sets

A set AA is countable if it is finite, or if there is a bijection f:N→Af:\mathbb{N}\to A; that is, we can list its elements as x1,x2,x3,…x_1, x_2, x_3, \dots so that every element appears exactly once, eventually, at some finite position. A set that is not countable is uncountable.

Building enumerations

Z\mathbb{Z} is countable: the zig-zag rule f(n)=n/2f(n)=n/2 for even nn and f(n)=−(n−1)/2f(n)=-(n-1)/2 for odd nn lists 0,1,−1,2,−2,3,−3,…0,1,-1,2,-2,3,-3,\dots, hitting every integer exactly once.


N×N\mathbb{N}\times\mathbb{N} (and hence Q+\mathbb{Q}^+, since every positive rational is a pair p/qp/q) is countable by the diagonal listing shown in the figure: sweep through the grid along the anti-diagonals p+q=2,3,4,…p+q=2,3,4,\dots, assigning the next natural number to each pair as you meet it.


Every pair sits on some finite diagonal, so every pair receives a finite position −- even though the running count grows like (s2)\binom{s}{2}, the enumeration never "gets stuck."

Diagonal enumeration of \mathbb{N}\times\mathbb{N}: the number beside each filled dot is the position assigned to that pair (p,q) as the grid is swept along the diagonals p+q=\text{constant}. The q axis is labelled and increases downward; open dots mark grid points whose positions are not shown.

Diagonal enumeration of N×N\mathbb{N}\times\mathbb{N}: the number beside each filled dot is the position assigned to that pair (p,q)(p,q) as the grid is swept along the diagonals p+q=constantp+q=\text{constant}. The q axis is labelled and increases downward; open dots mark grid points whose positions are not shown.

Cumulative pairs listed by the Cantor pairing enumeration

Cumulative pairs listed by the Cantor pairing enumeration

Showing a set is uncountable

To show (0,1)(0,1) is uncountable, suppose (for contradiction) it could be listed as x1,x2,x3,…x_1,x_2,x_3,\dots, each written as an infinite decimal. Construct y=0.y1y2y3…y=0.y_1y_2y_3\dots by setting yn=4y_n=4 when the nnth digit of xnx_n is not 4, and yn=5y_n=5 when it is 4.


Thus every digit of yy is 4 or 5, so yy neither terminates nor has an eventually repeating tail of 9s; its decimal expansion is unambiguous.


For every nn, yy differs from xnx_n in digit nn, so y≠xny\ne x_n. Therefore yy was left off the list, a contradiction. This is the diagonalization technique.



Which of the following sets is countably infinite?

Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

The figure shows the diagonal enumeration of N×N\mathbb{N}\times\mathbb{N}: position 1 is assigned to (1,1)(1,1), and positions increase along successive diagonals p+q=constantp+q=\text{constant}, with pp increasing within each diagonal. What position number is assigned to the pair (2,3)(2,3)?

Diagonal enumeration of \mathbb{N}\times\mathbb{N}: the number beside each filled dot is the position assigned to that pair (p,q) as the grid is swept along the diagonals p+q=\text{constant}. The q axis is labelled and increases downward; open dots mark grid points whose positions are not shown.

Diagonal enumeration of N×N\mathbb{N}\times\mathbb{N}: the number beside each filled dot is the position assigned to that pair (p,q)(p,q) as the grid is swept along the diagonals p+q=constantp+q=\text{constant}. The q axis is labelled and increases downward; open dots mark grid points whose positions are not shown.

Cumulative pairs listed by the Cantor pairing enumeration

Cumulative pairs listed by the Cantor pairing enumeration

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

The bijection f:N→Zf:\mathbb{N}\to\mathbb{Z} defined by f(n)=n/2f(n)=n/2 when nn is even and f(n)=−(n−1)/2f(n)=-(n-1)/2 when nn is odd is used to show Z\mathbb{Z} is countable. Using this formula, what is f(15)f(15)?

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors