computability
Computability and Decidability
You should know: turing machines
Overview
A problem is decidable if some Turing machine can always determine the correct yes/no answer and halt. Not every well-defined problem is decidable — the most famous example, the halting problem (does a given program halt on a given input?), was proven undecidable by Turing in 1936. Computability theory studies exactly which problems can, in principle, ever be solved by any algorithm at all, regardless of how much time or memory is available.
Intuition
It's tempting to think 'given enough time, a computer can solve anything.' Computability theory proves this is false — there are precisely-stated, simple-to-describe problems (like 'will this program eventually stop?') for which NO algorithm, however clever or however much time it's given, can always give the correct answer. This is a hard mathematical limit, not a limit of current technology.
Formal Definition
Key definitions distinguishing degrees of computability:
Derivation
Sketch of Turing's proof that the halting problem is undecidable, by diagonalization/contradiction:
Theorems
Applications
Worked Examples
This is a non-trivial semantic property of program behavior, so Rice's theorem applies directly.
Answer: No — undecidable by Rice's theorem
Practice Problems
Explain, in one sentence, why the halting problem being undecidable does not mean 'we can never tell if any specific program halts.'
Rice's theorem says any non-trivial semantic property of a program's behaviour is undecidable. Why does this doom the dream of a perfect antivirus that decides 'is this program malicious?' for all inputs?
Which of these problems IS decidable (an algorithm always gives the right yes/no answer and halts)?
In practice, how do computer scientists PROVE a new problem is undecidable without re-running Turing's diagonal argument each time?
Common Mistakes
Believing undecidability means 'we haven't found the algorithm yet, but might in the future.'
Undecidability is a proven mathematical impossibility (via diagonalization), not a current technological limitation — no future hardware or cleverness can change it.
Quiz
Summary
- A problem is decidable if some Turing machine always halts with the correct answer.
- The halting problem is the canonical undecidable problem, proven via a diagonalization argument.
- Rice's theorem generalizes this: virtually every non-trivial question about a program's behavior is undecidable.
- This sets a hard theoretical limit on what any bug-finder, virus-scanner, or perfect optimizer can guarantee.
Mathematics