Undecidable
Problems
Explore the fundamental limits of computation: problems that no algorithm can ever solve for every possible input.
What Is a Decision Problem?
A decision problem is any problem that asks a yes-or-no question about some input. Given an input, the goal is to determine whether the answer is "yes" or "no."
Decidable vs. Undecidable
A decision problem is decidable if an algorithm exists that produces a correct yes/no answer for every possible input in a finite amount of time. If no such algorithm can exist, the problem is undecidable.
Why Does This Matter?
Understanding undecidability reveals the fundamental boundaries of what computers can do. It shapes how we design software, verify programs, and think about automation.
The Halting Problem
The most famous undecidable problem asks: given any program \( P \) and any input \( I \), will \( P \) eventually stop (halt) when run on \( I \), or will it run forever?
Proof by Contradiction
The halting problem is proved undecidable using a proof by contradiction. Assume a halting analyzer H exists, then construct a program that forces H to give the wrong answer.
The Contradiction Visualized
Undecidable vs. Intractable vs. Unsolvable
| Decidable | Intractable | Undecidable | |
|---|---|---|---|
| Algorithm exists? | Yes | Yes | No |
| Always gives correct answer? | Yes | Yes | Impossible |
| Runs in reasonable time? | Usually | No (too slow) | N/A |
| Example | "Is \( n \) even?" | Traveling Salesman | Halting Problem |
More Undecidable Problems
The halting problem is not the only undecidable problem. Many important questions about programs are also undecidable:
How to Identify Undecidable Problems
Example: A Decidable Problem
Problem: "Given a list of numbers, is every element positive?"
Example: An Undecidable Problem
Problem: "Given any program \( P \), does \( P \) produce output 42 for at least one input?"
Example: A Tricky Borderline Case
Problem: "Does this specific, known program halt on input 5?"
What Can We Do?
Even though some problems are undecidable, computer scientists have practical strategies:
Common Mistakes
Summary Table
| Question | Decidable? | Why? |
|---|---|---|
| Is \( n \) even? | Yes | Simple check: \( n \bmod 2 = 0 \) |
| Is a list sorted? | Yes | Compare adjacent elements |
| Does program \( P \) halt on input \( I \)? | No | Halting problem (Turing, 1936) |
| Do two programs produce the same output? | No | Reduces to halting problem |
| Is the shortest path \( < k \)? | Yes | Graph algorithms solve it |
| Does \( P \) ever output 0? | No | Rice's Theorem |
Question 1 of 5
A decidable problem is one where:
Question 2 of 5
Which of the following best describes the halting problem?
Question 3 of 5
A student says: "If we just get a faster computer, we can solve the halting problem." What is wrong with this reasoning?
Question 4 of 5
Which of the following problems is decidable?
Question 5 of 5
In the proof that the halting problem is undecidable, what role does the "Contrary" program play?