The halting problem: a question no computer can answer
Vertical version.
Chapters
Narration
Imagine one perfect program. Feed it any code at all, and it tells you whether that code will finish, or spin forever. Call it H, the judge. It would be the most useful tool ever written. And it seems reasonable enough. Most programs are easy. This one obviously stops. That one obviously never will. H handles them all, thousands of them, without breaking a sweat. So here is how you break it. Build a program called D. D has exactly one rule: ask H what I am going to do, and then do the opposite. Now hand D its own source code. D is a program, so it is perfectly valid input. The judge has to predict a program that is standing there listening to the prediction. Suppose H says: this one halts. But D was built to do the opposite of whatever H says. So D loops forever. H was wrong. Fine. Suppose H says the opposite: this one loops. Then D stops immediately, and H is wrong again. Every answer it can possibly give destroys itself. So H cannot exist. Not on a faster machine, not with infinite memory, not ever. Turing found that ceiling in 1936, nine years before anyone built a computer.
Based on the board The Question No Computer Can Answer.
Covered in The Question No Computer Can Answer.
Saved in this browser, and to your account when you sign in.