Hacker News new | past | comments | ask | show | jobs | submit login

You can write a program that will always generate a real number, but you can't write a program that will generate all of the reals, or even any single real that's irrational (like pi). And the vast, vast majority of reals are irrational.

The best you can do is a program that generates a crude approximation to an irrational, because you'd need an infinite number of states to write the entire number and every physical computer has a finite number of states.

If your program that sits on top restarts the underlying program, then it will generate a repeating binary sequence. And that's a rational number.




>The best you can do is a program that generates a crude approximation to an irrational, because you'd need an infinite number of states to write the entire number and every physical computer has a finite number of states.

I can provide you with the requested infinite amount of state, I merely require infinite amounts of time.

>If your program that sits on top restarts the underlying program, then it will generate a repeating binary sequence. And that's a rational number.

And that would be stupid and obviously wrong. I should have clarified that the program sitting on top interrupting stuff is obviously changing something before restarting. Could be anything. Maybe flips some stateful starting info, maybe swaps to a different program, maybe starts xoring the output with something. Could be anything


Again, the same trap.

It doesn't matter what the program sitting on top changes, it does so in a deterministic way. And therefore the emulation of the program changes the same thing, in the same way. Which means that the emulation cannot figure out the next bit of its output faster than the actual program.

And therefore the program either never decides to output anything which would have diagonalized itself, or it gets stuck after a finite time by a liar's paradox attempting to figure out the next bit of it would put out so that it can put something different out instead. Either way diagonalization of itself cannot succeed.

The reasoning here is very similar to Turing's proof of the Halting Problem - no program exists that is able to take a program + input and reliably determine whether that program will halt. And the reason is that you set up a program which would have to set up a liar's paradox about itself fed input that translates to itself fed input about itself recursively. The only logically consistent result is that this program both cannot halt, and cannot figure out that it doesn't halt.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: