11
$\begingroup$

Applying Cantor's diagonal argument to irrational numbers represented in binary, one and only one irrational number can be generated that is not on the list.

Wikipedia image:

binary

But if you change the base from 2 to 3 or higher, including base-10, there are an infinite number of irrational numbers that can be generated that are not on the list, through various combinations of digits at tenths, hundredths, thousandths, etc places.

How can this be possible? Bases are just representations of a number, not a number in themselves. But binary produces fewer number of uncountable irrationals than ternary or quaternary.

Please correct me if I've gone wrong somewhere.

$\endgroup$
3
  • 3
    $\begingroup$ Let $d(x, i)$ mean the $i$th binary digit of the base-2 expansion of $x$. Define $s_P$ so that $d(s_P, P(i)) = 1- d(s_i, P(i))$, where $P$ is any permutation of the positive integers. Then $s_P$ is different from every $s_i$ because for each $i$, $s_P$ is different from $s_i$ in the $P(i)$th position. This constructs a large family of numbers not on the list. $\endgroup$
    – MJD
    Commented Dec 16, 2014 at 9:24
  • 4
    $\begingroup$ The problem with base $2$ is that you might create an anti-diagonal number $0.01111111111111\ldots$ that differs from all binary sequences and yet represents the number $0.10000\ldots$ that possibly is ion the list. $\endgroup$ Commented Dec 16, 2014 at 9:34
  • 4
    $\begingroup$ This is not a problem only for base 2. With base 10, depending on how you construct s exactly, you could end up with $s=0.0\overline{9}$, while your list contains $0.1$. It seems like it is often forgotten to proof that the construction of s is such that these numbers will not occur. In bases other than 2, this is relatively easy. In base 2, you need a different method to exclude these numbers. $\endgroup$
    – user193810
    Commented Dec 16, 2014 at 12:47

4 Answers 4

21
$\begingroup$

Cantor's diagonal argument proves (in any base, with some care) that any list of reals between $0$ and $1$ (or any other bounds, or no bounds at all) misses at least one real number. It does not mean that only one real is missing. In fact, any list of reals misses almost all reals. Cantor's argument is not meant to be a machine that produces reals not in your list. It's an argument by contradiction to show that the cardinality of the reals (or reals bounded between some two reals) is strictly larger than countable. It does so by exhibiting one real not in a purported list of all reals. The base does not matter. The number produced by cantor's argument depends on the order of the list, and the base chosen. In base $2$, you have no freedom in choosing the digits, so each ordering of the list produces in this way one real guaranteed not to be in the list. In other bases you have more freedom in choosing the digits, but this is irrelevant.

$\endgroup$
9
  • 1
    $\begingroup$ What does this statement mean? "In fact, any list of reals misses almost all reals." I've heard it before and I don't quite understand it. Thanks. $\endgroup$
    – Akash C
    Commented Dec 16, 2014 at 9:50
  • 3
    $\begingroup$ The cardinality of a list is countable, denoted by $\omega $. The cardinality of the reals can be shown not just to be not countable, but to be equal to $2^\omega$ (you can use binary representations again, you have two choices for each digit, and there are $\omega $ many digits to choose (ignoring double representations, though strictly speaking you need to account for these). Now, it can also be shown that $2^\omega - \omega = 2^\omega$. So, any listing of real numbers contains only $\omega $ many numbers, and misses $2^\omega$, as many as the entirely of all the reals. $\endgroup$ Commented Dec 16, 2014 at 10:52
  • 1
    $\begingroup$ @AkashC The above explanation is correct but pretty technical. "Almost all" means, essentially, that if you imagine that it's somehow possible to randomly select a real number within a certain range such that every real in that range has an equal probability of being selected, then the total probability that you will select a rational number is 0. (See the Wiki page on "Almost surely," which is a similar concept in probability; the first example given, regarding throwing a dart a a unit square, is somewhat similar to my example of picking a random number within a range on the continuum.) $\endgroup$ Commented Dec 16, 2014 at 17:05
  • 1
    $\begingroup$ @KyleStrand What you say is true, but it's is a weaker statement than Ittaly's. Any countable set of points has measure zero, but some sets (like the Cantor set) have the same cardinality as the fulls reals but null measure. In this context, I'd say the cardinality is the important point. $\endgroup$ Commented Dec 16, 2014 at 17:19
  • 2
    $\begingroup$ yes, but it is not meant to be used as an interesting/efficient/useful manner to produce reals. In fact, the proof exploits a certain typographical property of the reals (their representations as strings of digits) to deduce something about cardinalities. The construction of a real not on the list depends on so many arbitrary choices ... $\endgroup$ Commented Dec 16, 2014 at 18:51
7
+50
$\begingroup$

The order of the binary numbers $s_n$ are arbitrary. For example, if we swapped the places of $s_2$ and $s_3$, a different number will be formed. Hence there are still an infinite number of irrational numbers that can be generated.

$\endgroup$
2
  • $\begingroup$ The order is of course arbitrary, but if you change the order and create a new irrational not on the second list, you could end up with a number that was present on the first list and thus was a countable on the first list. $\endgroup$
    – Akash C
    Commented Dec 16, 2014 at 9:46
  • 6
    $\begingroup$ @AkashC No, using the second list, you will never end up with the binary representation of a number in the first list, because the lists have the same numbers! But as Hagel mentioned, you should not be using binary representations because of other problems. $\endgroup$ Commented Dec 16, 2014 at 9:52
3
$\begingroup$

The fundamental result proven by Cantor's diagonal argument (as applied to the real numbers) is that:

For any countable subset $S \subset \mathbb R$ of the real numbers, there is a real number $x \in \mathbb R$ such that $x \notin S$.

From this result, it then obviously follows that $\mathbb R$ itself cannot be countable, since otherwise we could choose $S = \mathbb R$ and derive a contradiction.

(Here, "$S$ is countable" means that there exists a surjection $f$ from the natural numbers $\mathbb N$ to $S$, and hence, that we can enumerate all members of $S$ as $S = \{f(1), f(2),f(3),\dotsc\}$.)

The diagonal argument proves the fundamental result quoted above directly and constructibly, by providing an "algorithm"1 that, given an enumeration $f$ of a countable subset $S = f(\mathbb N) \subset \mathbb R$ of the reals, computes a real number $x \in (\mathbb R \setminus S)$.

As you correctly note, for any given countable subset $S \subset \mathbb R$, it's possible to produce several such numbers $x$ by varying the details of the diagonal algorithm, such as the base used to expand the reals into digit sequences, or the specific digits chosen for $x$, if the base is high enough to allow multiple choices.

This should not really be surprising, since, for any countable set of real numbers $S$, there are infinitely (and, in fact, uncountably) many real numbers that are not in $S$, and could therefore be chosen as $x$. Any given instance of the diagonal algorithm (with the digit choice rules fully specified) only picks out one such $x$ for each enumeration $f$, but that's enough for what it's supposed to do.

(Of course, you can always generate more $x$s by modifying the enumeration $f$ — for example, you can take a previously generated $x$, prepend it to the enumeration, and run the algorithm again to get a new real number $x_2 \ne x$ that is also not in $S$, and so on.)


Ps. As alluded to in the comments, when applying the diagonal argument to the real numbers, there are certain practical reasons to choose a base higher than 2 anyway. The problem is that, in any base $b$, certain real numbers (specifically, those of the form $n / b^k$, for some integers $n$ and $k$) have two possible base-$b$ expansions: one that ends in an infinite string of zeros, and one that ends in an infinite string of $(b-1)$-digits (e.g. 9s, for base 10).

One way to make sure that we don't accidentally generate such an alternate representation of a number that does occur in the given enumeration is to avoid ever choosing the digit $(b-1)$ when constructing the base-$b$ expansion of $x$. In base 2, however, we don't have that freedom: if the $i$-th base-$b$ digit of $f(i)$ is 0, the diagonal algorithm has to choose a non-zero $i$-th digit for $x$, but if $b = 2$, the only possible choice is $1 = (2-1)$. Thus, to make sure that the diagonal algorithm really does what it's supposed to, we really should use base 3 or higher.

That said, it's possible to modify the diagonal algorithm in other ways, to make it work in base 2. For example, we may choose all odd-numbered digits of $x$ to be 0, and choose the even-numbered digits such that digit $2i$ of $x$ is not equal to digit $2i$ of $f(i)$. As long as we also make sure that, for any $f(i)$ that has two base-2 expansions, we always choose the one that ends in all zeros, this is sufficient to guarantee that $x \ne f(i)$ for any $i \in \mathbb N$.


1) It's not actually an algorithm in the strict sense used by computer scientists, since it requires infinitely many steps to exactly compute $x$, but it's close enough.

$\endgroup$
2
$\begingroup$

one and only one irrational number can be generated that is not on the list.

That is not true. If you take the number that you generate and add it to the list (say at the top), and then run the same procedure again, you will generate another number that is not on the list. You can do this ad infinitum and still not have all the real numbers in $[0, 1)$ in the list.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .