The Fucking Halting Problem
Or rather a variation of it called “the acceptance problem”. Suppose we have a program P and we want to know that P accepts or correctly computes some input i. Let H(P,i) be a program that tells us whether a program P accepts input i. Thus:
- H(P,i) returns
truewhen when P accepts i. - H(P,i) returns
falsewhen when P does not accept i.
Let be [P] be an encoding of program P (that is, the “code” of P). Running H(P,[P]) tells us whether P accepts itself as input.
Next, let D([P]) be a program that runs H(P,[P]) as a subroutine but returns the opposite of H. Thus, D returns false when P accepts its encoding [P] as input and returns true when P does not accept itself as input.
Now, Run D([D])—that is, run D with its encoding as input:
- D([D]) returns
truewhen H(D,[D]) returnsfalseand H(D,[D]) returnsfalsewhen D([D]) returnsfalse.- So, D([D]) returns
truewhen D([D]) returnsfalse.
- So, D([D]) returns
- D([D]) returns
falsewhen H(D,[D]) returnstrueand H(D,[D]) returnstruewhen D([D]) returnstrue.- So, D([D]) returns
falsewhen D([D]) returnstrue.
- So, D([D]) returns
Due to the obvious contradiction, neither programs D nor H can exist. I hope I got that right.
Also, this is hell.
Notes:
-
particularapparatus reblogged this from tristn and added:
Yes, I know :) I ask again… Well, maybe it is a little harsh. I am just cranky about computation this week, don’t mind...
-
tristn reblogged this from particularapparatus and added:
It matters because it tells us that there...functions that cannot be computed by any...
-
particularapparatus reblogged this from tristn and added:
who cares? “What are the civilian applications?”
-
poisonville liked this
-
tristn posted this