Hacker News new | ask | show | jobs
by bjourne 3359 days ago
Here is how you do it. Have a function p(r) which evaluates to the previous real number. Then your mapping function is:

    f(r) = if (r == 0) { 0 } { else f(p(r)) + 1 }
If your objection is "You can't determine what the previous real number is." Then my counter-objection is "Please prove that you can't." Which I don't think is possible without first assuming reals are uncountable.
2 comments

What is your definition of "previous real number"? If you define p(r) such that p(r) < r and there does not exist any real number x such that p(r) < x < r, then it is easy to show that p(r) cannot exist using a proof by contradiction.

Given real number r, assume there exists a real number q such that q < r and there does not exist a real number x such that q < x < r. Let real number y = (q + r) / 2. It is trivial to show that q < y < r. Therefore we have a contradiction, and therefore there does not exist a real number q that meets our conditions for a "previous real number".

If you take issue with this, then I suggest you read up on the standard construction of the number systems from the naturals up to the reals. This is all very rigorously defined in terms of ZFC set theory.

Your definition of f is circular: to calculate f(r) we need to know p(r), which in turn depends on f(r).

Cantor's diagonal argument shows that any mapping from the natural numbers to the real numbers must necessarily miss some real numbers out. It takes some time to get your head around if you aren't used to mathematical proofs, but it's definitely worth looking it up and trying to work through it if you're interested in this subject.

p(r) is given a real number and retrieves its predecessor. Why is it circular?
Suppose there exists an r' such that for some real number r, p(r)=r', where p(r) gives the real number that precedes r. What does that mean? Does it mean there are no numbers between r and r'? Because that's what I think predecessor means, even though it's trivial to prove that there are numbers between r' and r. For example, (r'+r)/2, the average of r and r', is between the two numbers. And there are also numbers between r and (r'+r)/2, and between r' and (r'+r)/2. So there can't possibly be a real that is the predecessor to another real, because there are always more real numbers between any two reals.