Halting Problem
Halting Problem
[A short computer program.]
[Caption below the panel]: The big picture solution to the halting problem.

In 1936 Alan Turing proved that it's not possible for an algorithm to decide whether an arbitrary program will eventually halt, or run forever. This was later called the Halting problem by Martin Davis . The official definition of the problem is to write a program (actually, a Turing Machine ) that accepts as parameters a program and its parameters. That program needs to decide, in finite time, whether that program will ever halt running these parameters.
The halting problem is a cornerstone problem in computer science. It is used mainly as a way to prove a given task is impossible, by showing that solving that task will allow one to solve the halting problem.
Randall , however, is providing a simpler solution. He implements his own code for the question "Does it halt?" which always returns "true", and directs us to think about the bigger picture.
From a physical perspective, according to our current understanding of physics, this is right. Given enough time, any program will halt. This is due to factors external to the actual program. Sooner or later, electricity will give out, or the memory containing the program will get corrupted by cosmic rays, or corrosion will eat away the silicon in the CPU, or the second law of thermodynamics will lead to the Heat death of the universe . Nothing lasts forever, and this includes a running program.
From a mathematical point of view, this is not true: a Turing machine will never have a hardware failure because it's not a physical machine. It's a theoretical construct, and it's defined mathematically, independent of any physical hardware. Similarly, ⅓ + ⅓ + ⅓ = 1 no matter what any physical hardware you are computing it on claims.
Another interpretation of Randall 's code is that, assuming the language uses an eager evaluation strategy, the Program in the parentheses is actually being run whenever his function is called. In this case, the function would wait until the program finishes and exits before returning "True". Therefore, Randall 's function is mathematically accurate. It does not solve the problem though, as it simply shifts the question to whether the function itself will ever halt. If his language uses lazy evaluation, the input program is completely ignored, and it reduces to the incorrect mathematical interpretation.
From a practical point of view, there are of course times that a programmer would want to return "false", since some programs can be mathematically shown to run forever.
The title text further relates to this issue by claiming to have found a case where something need not die, but Randall does not know how to actually show it to anyone, because just the fact everyone will die sooner than it doesn't prove it will not die. The wording of the title text might also be a reference to Fermat's Last Theorem .
It should be noted that Randall's solution, barring its unsoundness, solves more than the halting problem in the form it is usually stated. The halting problem requires two parameters (a program and its parameters), while Randall's function only accepts one (the program). The question of whether a program halts for every input can be shown to be even harder to solve than the halting problem, meaning that even if a Turing machine had an additional instruction allowing it to check whether a program halts with given parameters, it still could not always confirm that a given program that halts for all parameters does so.
The code in this comic is written in pseudocode , to demonstrate the "algorithm" rather than an implementation in some existing programming language. The syntax resembles a mix of C and Python .
The proof that the halting problem is unsolveable is to write a new function that uses Randall's program:
DEFINE META_DOESITHALT():
IF ( DOESITHALT(META_DOESITHALT) ) WHILE ( TRUE ) DO_NOTHING; ELSE HALT;

If Randall's function says that META_DOESITHALT halts by returning "TRUE" - then that makes META_DOESITHALT loop forever.   But if it decides that it must halt by returning "FALSE" - then META_DOESITHALT halts.
This proves that DOESITHALT can't possibly work - no matter what it actually does.
This is the software equivalent of "Everything I say is a lie".
[A short computer program.]
[Caption below the panel]: The big picture solution to the halting problem.
