A topic in the Open Knowledge Graph — a free, open map of 15,290 topics and the order to learn them in.

Decidable and Semi-Decidable Languages

College Depth 88 in the knowledge graph I know this Set as goal
20topics build on this
515prerequisites beneath it
See this on the map →
The Halting ProblemTuring Machines+1 moreMany-One Reducibility in ComputabilityProperties of Recursively Enumerable Languages+1 more
decidability languages recognition

Core Idea

A language is decidable (in RE ∩ co-RE) if a Turing machine can recognize it and also recognize its complement. A language is semi-decidable (RE) if a machine can recognize membership but may loop indefinitely on non-members. The halting problem is semi-decidable but not decidable, illustrating the fundamental gap between 'can verify a solution' and 'can decide membership.'

How It's Best Learned

Construct machines that decide versus semi-decide simple languages (e.g., palindromes vs. Gödel numbers of terminating programs).

Common Misconceptions

Explainer

You already know what a Turing machine is and that the halting problem cannot be solved — no TM can decide, for every input, whether an arbitrary program halts. Build on that foundation by asking a more refined question: what kinds of problems can a Turing machine *partially* solve? The answer carves computational problems into two fundamental classes. A language L is decidable (also called recursive) if there exists a TM that always halts and correctly answers "yes" or "no" for every input. A language is semi-decidable (also called recursively enumerable, or RE) if there exists a TM that halts and accepts on every input in L, but may run forever on inputs not in L. The machine can confirm membership but cannot always confirm non-membership.

The halting problem is the canonical semi-decidable language. You can simulate a given program and halt as soon as it halts — outputting "yes." But if the program runs forever, your simulator also runs forever, never giving a "no" answer. This is why the halting problem is semi-decidable but not decidable: the asymmetry between "yes" and "no" witnesses is fundamental, not a gap to be closed with a cleverer algorithm.

The key structural insight is that decidability requires both the language *and* its complement to be semi-decidable. If L is RE and its complement L̄ is also RE, you can run both machines in parallel (dovetailing): whichever one accepts first gives you the answer. Since every input is either in L or in L̄, one machine will eventually halt, giving a total decision procedure. This characterizes decidability as RE ∩ co-RE, where co-RE is the class of languages whose complements are RE. The halting problem is RE but not co-RE — you cannot semi-decide non-halting — so it is not decidable.

The gap between semi-decidable and decidable is not a matter of degree. It is absolute. There is no way to "time-limit" a semi-decision procedure and get a correct answer — doing so would sometimes incorrectly reject valid inputs that would have been accepted eventually. This asymmetry drives the entire hierarchy of undecidability: problems above the decidable level are classified by whether they are RE, co-RE, or neither, and by how hard they are relative to each other under reducibility. Everything you will encounter about reduction, completeness, and the RE and co-RE hierarchies flows from this basic trichotomy.

Practice Questions 5 questions

Prerequisite Chain

Understanding ZeroThe Number ZeroCounting to FiveCounting to 10Counting to 20Counting a Set of Objects Up to 20Cardinality: The Last Number CountedMatching Numerals to QuantitiesSubitizing Small QuantitiesAddition Within 10Number Bonds to 10Addition Within 20Doubles and Near DoublesDoubles Facts Within 10Near Doubles Facts Within 20Mental Math Strategies for AdditionMental Math: Adding and Subtracting TensAddition Within 100Repeated Addition as MultiplicationMultiplication as Equal GroupsMultiplication: ArraysBasic Multiplication Facts (0s, 1s, 2s, 5s, 10s)Multiplication Facts Within 100Division as Equal SharingDivision as Grouping (Measurement Division)Division: Grouping (Repeated Subtraction) ModelDivision: Fair Sharing ModelDivision as Equal SharingDivision as GroupingBasic Division FactsDivision Facts Within 100Multiplication and Division Fact FamiliesRelationship Between Multiplication and DivisionDivision Facts as Inverse of MultiplicationRemainders and Quotients in DivisionDivision Word ProblemsMulti-Step Word ProblemsSolving Multi-Step Word ProblemsMultiplication Word ProblemsDivision Word ProblemsIntroduction to Long DivisionFactors and MultiplesPrime and Composite NumbersEquivalent FractionsRelating Fractions and DecimalsDecimal Place ValueIntegers and the Number LineComparing and Ordering IntegersAbsolute ValueAdding IntegersSubtracting IntegersMultiplying IntegersIntroduction to ExponentsOrder of OperationsInteger Order of OperationsVariable ExpressionsThe Distributive PropertyVariables and Expressions ReviewIntroduction to PolynomialsAdding and Subtracting PolynomialsMultiplying PolynomialsFactorialPermutationsCombinationsCounting Principles: Addition and Multiplication RulesIntroduction to Graph TheoryPropositional Logic FoundationsLogical EquivalencesBoolean AlgebraIntroduction to Propositional LogicIntroduction to Predicate Logic (First-Order Logic)First-Order Logic SyntaxZFC Axioms OverviewAxiom Schema of SeparationAxiom Schema of ReplacementVon Neumann OrdinalsHereditarily Finite SetsRecursive Definitions on Finite SetsWell-Founded Relations and Transfinite RecursionThe Axiom of Choice and Equivalent FormulationsAxiom of ChoiceWell-Ordering TheoremInfinite Cardinal NumbersCantor's TheoremUncountability and the Diagonal ArgumentThe Cantor Set: An Uncountable Nowhere Dense ExampleUncountable Sets and Cantor DiagonalizationThe Halting ProblemDecidable and Semi-Decidable Languages

Longest path: 89 steps · 515 total prerequisite topics

Prerequisites (3)

Leads To (3)