Countable vs Uncountable

The rationals fit into a single list; the reals do not — verified by Cantor's diagonal argument.

Q={q1,q2,… }\mathbb{Q} = \{q_1, q_2, \dots\}
(0,1) is uncountable(0,1) \text{ is uncountable}

Part of these learning paths

Examples & Exercises

Prove Z\mathbb{Z} is countable via the explicit enumeration 0,1,−1,2,−2,…0, 1, -1, 2, -2, \dots.

a0=0,a2k−1=k,a2k=−k  (k≥1)a_0 = 0,\quad a_{2k-1} = k,\quad a_{2k} = -k\ \ (k \geq 1)
The same diagonal idea as the rationals — starting with the integers.
Show proof
  1. With a0=0a_0 = 0, a2k−1=ka_{2k-1} = k and a2k=−ka_{2k} = -k for k≥1k \geq 1, every integer appears exactly once: m=0m = 0 as a0a_0, m≥1m \geq 1 as a2m−1a_{2m-1}, and m<0m < 0 as a−2ma_{-2m}.
  2. Hence n↦ann \mapsto a_n is a bijection N→Z\mathbb{N} \to \mathbb{Z}, so Z\mathbb{Z} is countable.

Prove (0,1)(0,1) is uncountable by Cantor's diagonal argument.

xn={5rn’s nth digit≠56otherwisex_n = \begin{cases} 5 & r_n\text{'s }n\text{th digit} \ne 5 \\ 6 & \text{otherwise} \end{cases}
The flipped diagonal cannot be anywhere in the list.
Show proof
  1. Suppose the elements of (0,1)(0,1) could be fully enumerated as r1,r2,…r_1, r_2, \dots. Each rnr_n has a unique decimal expansion not ending in infinite 99s, so its nn-th digit is well defined.
  2. Define xx digit by digit: its nn-th digit is 55 when rnr_n's nn-th digit is not 55, and 66 otherwise. Then x∈(0,1)x \in (0,1), but x≠rnx \ne r_n for every nn since they differ at digit nn — a contradiction.
  3. Hence no enumeration of (0,1)(0,1) exists: (0,1)(0,1) is uncountable.

Explain at idea level why a countable union of countable sets is countable, via diagonal enumeration. (Idea level; full proof omitted.)

n=64n=64: the same diagonal sweep of the grid.
Show proof
  1. [Sketch] Arrange A1,A2,…A_1, A_2, \dots as the rows of an infinite grid. Sweeping it in diagonal order — exactly as for the rationals — every element shows up at some finite diagonal position.
  2. [Sketch] This is an idea-level explanation; the full proof needs care with duplicate elements.

1. Number Systems