Why is the cardinality of irrational numbers greater than rational numbers?

This was asked by blogegog on a YouTube comment (gasp!):

[Regarding Cantor's diagonal argument:]

Couldn't I just make the same statement about rational numbers and say, 'take the largest number [sic he probably meant the one with the most digits] on the chart and append to the end of it a 1 if I'm hungry, or a 2 if I'm not' to show that his list of rational numbers doesn't contain them all?


Another way of looking at this is via continued fractions. Note the following facts:

  1. Every rational number finite continued fraction representation of the form $[a;b_1,b_2,\ldots,b_n]$ -- although every rational number has two such representations. Also, every such finite continued fraction represents a rational number.
  2. Every irrational number has a unique infinite continued fraction representation of the form $[a;b_1,b_2,\ldots]$, and every such infinite continued fraction represents an irrational number in this interval.

If we restrict our attention to the interval $[0,1)$, we may assume that $a=0$ in all of these representations.

It follows easily that the family of rational numbers in $[0,1)$ has cardinality not greater than the family of all finite sequences of positive integers. Similarly, the family of all irrational numbers in $[0,1)$ has cardinality exactly equal to the family of all infinite sequences of positive integers. We have thus reduced our problem to comparing the families of finite and infinite sequences of positive integers.

It is not too difficult to show that the family of all finite sequences of positive integers is equinumerous to the family of all positive integers itself. From this and the above observation we have that $\mathbb{Q} \cap [0,1)$ is countable.

Exactly using Cantor's diagonalisation technique one can show that the family of infinite sequences of positive integers is uncountable, and therefore $[0,1) \setminus \mathbb{Q}$ is also uncountable.