• ↑↓ to navigate
  • ↵ to open
  • ⟶ to select
  • ⌘ ⌥ ↵ to open in a panel
  • ←→ to navigate
  • esc to dismiss
⌘ '
keyboard shortcuts

The Problem

Is there an algorithm that can determine whether any arbitrary program will eventually halt or run forever?

Core Idea

The halting problem asks: given a program and its input, will it terminate (halt) or run forever? Alan Turing proved in 1937 that no algorithm can solve this for all possible program-input pairs.

How It Works

The proof uses self-reference and diagonalization:

  1. Assume a hypothetical “halting solver” H(P, I) that returns “halts” or “loops forever”
  2. Create a paradoxical program that does the opposite of what H predicts
  3. Feed this program to itself → contradiction
  4. Therefore, H cannot exist

This is one of the most important results in computability theory.

Key Properties

  • Proved undecidable by Alan Turing in 1937
  • Example of a concrete problem that is easy to formulate but impossible to solve
  • Foundation for much of computability theory
  • Any problem that can encode the halting problem is also undecidable

Visual Explanation

Halting_Problem A Halting Problem Input B Halting Problem Core Mechanism A->B triggers C Halting Problem Output B->C produces

Semantic Network

semantic_Halting_Problem THIS Halting Problem REL1 Related Concept THIS--REL1 related REL2 Builds Into THIS--REL2 builds into

Edge Cases & Gotchas

  • The problem is undecidable for Turing machines, but some specific programs can be analyzed
  • Knowing individual instances are solvable doesn’t make the general problem solvable

Why This Matters

The halting problem proves that there are limits to what algorithms can know. This fundamental result shapes how we think about program analysis, verification, and the boundaries of computation.