3 ms·
Well, we can't really "count to infinity" in real life, and most of mathematics (unless you're a finitist or something, which is rather rare) assumes that we ca
by Tainnor 3y ago
Well, we can't really "count to infinity" in real life, and most of mathematics (unless you're a finitist or something, which is rather rare) assumes that we can somehow do it and establishes some base rules about how that would have to work without leading to contradictions.
With that said, assume that you have some list of real numbers. In a sense, what we're asking for is a function f, such that f(i, j) returns the j-th digit of the i-th number on that list. [0, 1]
Then you construct a function g as follows:
def g(j)
f(j, j) + 1 % 10
end
Now you convince yourself of the fact that there is no number i, such that f(i, j) = g(j) for all j - or in other words, g encodes a different number than f(i, .) for any i. So, for every list of real numbers, there must be a number not on that list.
[0]: I'm brushing over the fact that some different sequences of integers encode the same real number, e.g. 0.999... and 1.000... - it doesn't affect the argument substantially.
[1]: This function doesn't necessarily have to implementable in a programming language - mathematicians are fine with talking about "uncomputable functions" and claiming that they exist. The argument shows that such a function can't exist even non-constructively. You can avoid all that talk about uncomputable functions and numbers by getting into constructive mathematics, but that's another can of worms and as far as I know it comes with its own unintuitive results. For example, exactly the same diagonalisation argument shows that there is no computable function encoding a list of all computable numbers.