2

Real numbers are proved to be uncountable so there should be no way to count them.

Having said that, I would still like to try to present a method for counting them. First I'll count the non-negative Real numbers and then I'll generalize that to all the Real numbers.

For easier presentation I'll use binary numeral system, but the same can be applied to any numeral system.

Let's map all the non-negative Real numbers to a table where the number's integer part represents the row and the reversed fractional part represents the column:

int\rev frac 0 1 10 11
0 0.0 0.1 0.01 0.11
1 1.0 1.1 1.01 1.11
10 10.0 10.1 10.01 10.11
11 11.0 11.1 11.01 11.11

For example $1.01$ maps to row $1$ and column $10$. We need to reverse (read backwards) the fractional part because otherwise $.01$ would map to the same column as $.1$. With digit reversal we guarantee that we get unique colums for same fractional parts.

Having done that we can now enumerate all the non-negative Real numbers by diagonally counting them:

i\f 0 1 10 11
0 0 1 3 6
1 2 4 7 ...
10 5 8 ... ...
11 9 ... ... ...

We can transform this to a function that maps from non-negative Reals ($\mathbb{R}$) to Natural ($\mathbb{N}_0$) numbers:

$$ f(x) = (\sum_{n=1}^{i} {n+1}) + (\sum_{m=1}^{f} m+i) $$

where $i$ is the integer part and $f$ is the reversed fractional part of Real number $x$.

For example number $11.0010001111_2$ ($\approx3.14_{10}$ in binary) would be enumerated as the $468031_{10}$th non-negative binary Real number.

We can generalize this to all the Real numbers by adding the "negative" rows to the table and alternating diagonal counting to the positive end negative sides:

i\f 0 1 10 11
-11 19 ... ... ...
-10 11 17 ... ...
-1 5 9 15 ...
-0 1 3 7 13
0 0 2 6 12
1 4 8 14 ...
10 10 16 ... ...
11 18 ... ... ...

For example $-0.01$ maps to row $-0$ and column $10$ so it is enumerated as $7$.

This transforms to a function:

$$ f(x) = \begin{cases} 2((\sum_{n=1}^{i} {n+1}) + (\sum_{m=1}^{f} m+i)), & \text{if } 0 \leq i \\ 2((\sum_{n=1}^{-i} {n+1}) + (\sum_{m=1}^{f} m+(-i))) + 1, & \text{otherwise} \end{cases} $$

Here the number $11.0010001111_2$ ($\approx3.14_{10}$ in binary) would be enumerated as the $936062_{10}$th binary Real number.

In decimal system the $3.14$ would be enumerated as the $312$th decimal Real number.

There is a little problem that this method counts $0.0$ twice (as $0.0$ and $-0.0$). To fix this we remove the $0.0_2$ to $0_{10}$ enumeration and let $0.0_2$ be enumerated as $1_{10}$. Therefore we now map from $\mathbb{R}$ to $\mathbb{N}$ (and not $\mathbb{N}_0$).

By using the presented method we can enumerate $\mathbb{R}$ and have a bijection between $\mathbb{R}$ and $\mathbb{N}$.

But this would mean that $\mathbb{R}$ is countable which, as far as I know, is proven (by different methods) that it is not. So my question is, what is wrong with the enumeration method presented here and/or with my understanding of countability? :)

blaztinn
  • 123
  • 3
    "We need to reverse (read backwards) the fractional part" $;-;$ You can't do that when the fractional part is non-terminating. – dxiv Jan 10 '22 at 06:54
  • @dxiv Right, haven't though of that, thank you for pointing that out. – blaztinn Jan 10 '22 at 07:21
  • “Real numbers are proved to be uncountable so there should be no way to count them. Having said that, I would still like to try to present a method for counting them.” Are you usually that skeptical about the validity of proofs? – Zanzag Jan 10 '22 at 07:24
  • @Zanzag No I'm not :) Maybe it would be better if I prefixed my post with the part I wrote at the very end: "So my question is, what is wrong with the enumeration method presented here and/or with my understanding of countability?" – blaztinn Jan 10 '22 at 07:46
  • @Zanzag Just my 2¢, but a healthy dose of skepticism can be a good thing in math. Whenever unsure of something like this, one of the best ways to sort it out in one's own mind is try to find a hole in the given proof, or try shoot it down entirely. That will (most likely) be a failed effort, yet it will point to what the oversight might have been and where the real difficulties are. Here for example, the OP did not get to prove that reals are countable after all, but (hopefully) got a better understanding of and appreciation for the known proofs of uncountability. – dxiv Jan 10 '22 at 07:48
  • @dxiv I know, I was just joking. I also think it is good to try some examples and question the proof. – Zanzag Jan 10 '22 at 07:54
  • @Zanzag I thought so, just didn't want someone else reading it to get discouraged from questioning every math thing, from Cantor to their own proof attempts. – dxiv Jan 10 '22 at 08:14

2 Answers2

1

Very early on in your construction, you say:

and the reversed fractional part represents the column

You did not define what "the reversed fractional part" of a real number is. Without defining this term, your mapping is not really defined, so it is impossible to tell why it does not surjectively map $\mathbb N$ to $\mathbb R$.


In fact, as far as I see from your post, the first table that you write only contains numbers that have a finite binary representation. So, the table contains numbers such as $0.1, 0.001, 0.101101001001$, but it does not contain numbers with an infinite binary representation, so numbers such as $\frac13$. Therefore, what you have constructed is the inverse of a mapping from $\mathbb N$ to a subset of the set of all rational numbers $\mathbb Q$.

In other words, the domain of your mapping is a subset of $\mathbb Q$, and as such, it is no surprise it is countable.

5xum
  • 126,227
  • 6
  • 135
  • 211
  • I see now, thank you for clearing that up :) So basically even if the table is "infinitely" large it won't represent 1/3 or Pi or similar? – blaztinn Jan 10 '22 at 07:16
  • 1
    @blaztinn Depends on how large the table is. If the table is countably infinitely large, then no, it won't represent $\pi$ or $\frac13$. The problem is that if you make the table larger than countably infinite, then you cannot diagonally count the members of the table. – 5xum Jan 10 '22 at 07:17
0

As comments have noted, only very specific reals come up in your list, namely those with a terminating binary expansion. You've encountered the fact that a countable (in your case finite) alphabet has countably many finite-length strings, but uncountably many strings of countable length, say if you wanted to accommodate $\pi$ in binary.

To take another example of this subtlety, any positive integer can be represented by the infinite sequence of powers to which primes are raised in its prime factorization. While there are infinitely many sequences of non-negative integers, we're actually restricted to those which contain only finitely many nonzero values, and can be regarded as terminating with the last one and so will have a finite length.

Having said that, a generalization has been considered.

J.G.
  • 118,053