You have 3 free guides left 😟
Unlock your guides
You have 3 free guides left 😟
Unlock your guides

6.1 The halting problem and its proof

3 min readjuly 22, 2024

The asks if a computer program will ever finish running or go on forever. It's a key concept in computer science that shows some problems can't be solved by any algorithm, no matter how smart or powerful.

This idea has big implications for what computers can and can't do. It proves there are limits to computation, affecting areas like and . Understanding these limits is crucial in computer science.

The Halting Problem and Its Undecidability

Halting problem in computability theory

Top images from around the web for Halting problem in computability theory
Top images from around the web for Halting problem in computability theory
  • Asks whether a given will or run forever on a given input
  • Fundamental problem demonstrates the existence of (problems that cannot be solved by any algorithm)
  • has significant implications for the limitations of computation and the capabilities of computers (program verification, automated theorem proving)
  • Proves there are problems that cannot be solved by any algorithm, regardless of the computational power available

Proof of halting problem undecidability

  • Assume, for contradiction, that a hypothetical exists that can solve the halting problem
    • HALT takes as input a Turing machine MM and an input string ww, determines whether MM halts on ww or runs forever
  • Construct a new Turing machine that uses HALT as a subroutine
    • CONTRA takes a Turing machine MM as input and behaves as follows:
      1. If HALT determines MM halts on input MM, then CONTRA enters an
      2. If HALT determines MM does not halt on input MM, then CONTRA halts
  • Consider what happens when CONTRA is given itself as input (MM = CONTRA)
    • If HALT determines CONTRA halts on input CONTRA, then CONTRA must enter an infinite loop, contradicting HALT's determination
    • If HALT determines CONTRA does not halt on input CONTRA, then CONTRA must halt, again contradicting HALT's determination
  • This contradiction proves the initial assumption, the existence of HALT, must be false
  • Therefore, the halting problem is undecidable, no algorithm can solve it for all possible inputs

Implications for computational limitations

  • Demonstrates inherent limitations to what can be computed by algorithms
  • Shows there are problems for which no algorithm can provide a solution, regardless of available
  • Proves not all mathematically well-defined problems are computable
  • Establishes a fundamental boundary between what is computable and what is not
  • Has implications for various areas of computer science (program verification, automated theorem proving, )

Halting problem vs Turing completeness

  • A programming language or computational system is Turing complete if it can simulate any Turing machine
  • implies a system can perform any computation that a Turing machine can perform
  • The undecidability of the halting problem is closely related to Turing completeness
    • In a Turing-complete system, the halting problem is undecidable
    • If a system can solve the halting problem, it would not be Turing complete, as it could perform a task Turing machines cannot
  • The halting problem serves as a litmus test for Turing completeness
    • If a system is powerful enough to encounter the halting problem, it is likely Turing complete
    • If a system is not Turing complete, it may avoid the halting problem by having limited computational capabilities
  • Understanding the relationship helps assess the computational power and limitations of various systems and programming languages (, )
© 2024 Fiveable Inc. All rights reserved.
AP® and SAT® are trademarks registered by the College Board, which is not affiliated with, and does not endorse this website.


© 2024 Fiveable Inc. All rights reserved.
AP® and SAT® are trademarks registered by the College Board, which is not affiliated with, and does not endorse this website.

© 2024 Fiveable Inc. All rights reserved.
AP® and SAT® are trademarks registered by the College Board, which is not affiliated with, and does not endorse this website.
Glossary
Glossary