Intermediate Topic 30 of 51 Theory & Discrete Math
Decidability
Whether an algorithm can always answer a yes/no question.
How it works
A problem is decidable if there is an algorithm that always halts and correctly answers yes or no for every input. A language is recognizable if a machine accepts exactly its members, but may loop on non-members; it is decidable if some machine also always halts. Many natural problems are decidable, such as whether a string matches a regular expression, whereas others are undecidable, such as the halting problem, equivalence of context-free grammars and whether a program has a given property.
Step-by-step walkthrough
- A decision problem asks a yes or no question.
- It is decidable if an algorithm always halts with the right answer.
- The algorithm answers on every input.
- Some problems have no such algorithm.
- Undecidable problems exist, the halting problem is the classic example.
Where it is used
Decidability results show what compilers, verifiers and static analyzers can and cannot do in general, motivating approximations, restricted languages and semi-decision procedures.
Common pitfall
Undecidable means no algorithm works for all inputs, not that every instance is hard. Many specific instances can be solved, and tools work heuristically. Confusing recognizable with decidable, or decidable with efficient, is common. To show undecidability, reduce from a known undecidable problem such as halting.
Where it fits in the course
Decidability is topic 30 of 51 in Theory & Discrete Math, rated Intermediate. It follows Church-Turing Thesis. The next topic is Halting Problem.
Practice and explore
- Open the interactive lesson, with a mini quiz.
- Take the Theory & Discrete Math quiz.
How to study this topic
- Read the explanation above and restate the definition in your own words.
- Open the interactive lesson and answer its mini quiz.
- Read the common pitfall, then write a short example that avoids it.
- Check your understanding in the Theory & Discrete Math quiz, and revisit the topic if you miss a question.
Frequently asked questions
What is Decidability?
Where do people use Decidability?
What is the most common mistake with Decidability?
What should I learn before this topic?
How can I practice it?
Is Decidability hard to learn?
How long does it take to learn Decidability?
Which topics are related to Decidability?
What should I study after Decidability?
Related topics
- Church-Turing Thesis (Theory & Discrete Math)
- Halting Problem (Theory & Discrete Math)
- Turing Machines (Theory & Discrete Math)
- Reductions (Theory & Discrete Math)