Menu

© 2025 369 Tesla Private Limited

All Rights Reserved

The Halting Problem Proof

Interactive step-by-step proof showing why the halting problem is undecidable

Halting Problem Proof

Interactive step-by-step proof using diagonalization

The Halting Problem Proof 🚫

Interactive step-by-step proof showing why the halting problem is undecidable using diagonalization

The Halting Problem

The Question

Given any Turing Machine M and input w, can we determine if M will halt on w?

Why Important?

This represents the fundamental question of program termination and computational limits

The Answer

NO - There is no algorithm that can solve this problem for all possible inputs

Example Turing Machines

Always Halts
halts

A simple TM that always accepts immediately

TM AlwaysHalt(w):
  return ACCEPT
Always Loops
loops

A TM that enters an infinite loop

TM AlwaysLoop(w):
  while true:
    // infinite loop
    continue
Conditional Behavior
unknown

Halts on even length strings, loops on odd

TM ConditionalTM(w):
  if |w| is even:
    return ACCEPT
  else:
    loop forever
Complex Pattern
unknown

Behavior depends on complex mathematical property

TM ComplexTM(w):
  n = interpret w as number
  if n satisfies some complex property:
    return ACCEPT
  else:
    loop forever

Proof Steps

1
The Halting Problem Definition
2
Assume HALT is Decidable
3
Construct the Diagonalization Machine D
4
The Critical Question
5
Case 1: H says D halts on ⟨D⟩
Contradiction!
6
Case 2: H says D doesn't halt on ⟨D⟩
Contradiction!
7
The Contradiction
Contradiction!
8
Therefore, HALT is Undecidable

Step 1: The Halting Problem Definition
Definition

The halting problem asks: Given a Turing Machine M and input w, does M halt on w?

Formal Description:

HALT = {⟨M, w⟩ | M is a TM that halts on input w}

Question: Is HALT decidable?
- If YES: There exists a TM H that always halts and correctly answers
- If NO: No such TM H can exist

Key Insight:

We want to determine if we can algorithmically decide whether any TM halts on any input.

Step 1 of 8
Proof Progress13% Complete

Implications & Applications

Theoretical Implications

Fundamental Limits:

Proves there are problems that cannot be solved algorithmically

Undecidability:

Establishes the concept of undecidable problems

Reduction Technique:

Provides method to prove other problems undecidable

Practical Applications

Program Analysis:

Explains why perfect program verification is impossible

Compiler Optimization:

Shows limits of automatic optimization

Software Engineering:

Informs testing and verification strategies

Other Undecidable Problems

Rice's Theorem

Any non-trivial property of the language recognized by a Turing machine is undecidable.

Undecidable

Post Correspondence Problem

Given a set of domino tiles, determine if there's a way to arrange them to match top and bottom.

Undecidable

Tiling Problem

Determine if a given set of tile types can tile the entire plane.

Undecidable