Proof that the real numbers are countable: Help with why this is wrong

Your function ignores all the real numbers whose decimal representations are not finite, such as

$\dfrac13=0.3333\ldots$

The subset of real numbers that do have finite decimal representations is indeed countable (also because they are all rational and $\mathbb Q$ is countable).


If you know Cantor's diagonalization argument, then you should be able to find a counterexample to your problem using it. Say the method we use to make the $k$-th digit of our new real number different from the $k$-th digit of the $k$-th number in your list is adding 1 to it (and make it 0 if it's 9). Then Cantor's argument gives the number $0.21111111111111...$ Which is not in your list because (as said below) you only have real numbers with finite decimal expansions in your list.

(was previously a comment, but made an answer following suggestion)


The set you have shown is a list of all rationals between $0$ and $1$ that can be written in the form $x /10^n$ with $x\in\mathbb{Z}$, which is countable. But the full set of reals between $0$ and $1$ is bigger.

All reals are the limit of some sub-sequence of this sequence, but not all are in this sequence, e.g. $\sqrt{2}=1.14142\ldots$ or $\frac{1}{3}=0.33333\ldots$.