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 more→→Many-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 Zero → The Number Zero → Counting to Five → Counting to 10 → Counting to 20 → Counting a Set of Objects Up to 20 → Cardinality: The Last Number Counted → Matching Numerals to Quantities → Subitizing Small Quantities → Addition Within 10 → Number Bonds to 10 → Addition Within 20 → Doubles and Near Doubles → Doubles Facts Within 10 → Near Doubles Facts Within 20 → Mental Math Strategies for Addition → Mental Math: Adding and Subtracting Tens → Addition Within 100 → Repeated Addition as Multiplication → Multiplication as Equal Groups → Multiplication: Arrays → Basic Multiplication Facts (0s, 1s, 2s, 5s, 10s) → Multiplication Facts Within 100 → Division as Equal Sharing → Division as Grouping (Measurement Division) → Division: Grouping (Repeated Subtraction) Model → Division: Fair Sharing Model → Division as Equal Sharing → Division as Grouping → Basic Division Facts → Division Facts Within 100 → Multiplication and Division Fact Families → Relationship Between Multiplication and Division → Division Facts as Inverse of Multiplication → Remainders and Quotients in Division → Division Word Problems → Multi-Step Word Problems → Solving Multi-Step Word Problems → Multiplication Word Problems → Division Word Problems → Introduction to Long Division → Factors and Multiples → Prime and Composite Numbers → Equivalent Fractions → Relating Fractions and Decimals → Decimal Place Value → Integers and the Number Line → Comparing and Ordering Integers → Absolute Value → Adding Integers → Subtracting Integers → Multiplying Integers → Introduction to Exponents → Order of Operations → Integer Order of Operations → Variable Expressions → The Distributive Property → Variables and Expressions Review → Introduction to Polynomials → Adding and Subtracting Polynomials → Multiplying Polynomials → Factorial → Permutations → Combinations → Counting Principles: Addition and Multiplication Rules → Introduction to Graph Theory → Propositional Logic Foundations → Logical Equivalences → Boolean Algebra → Introduction to Propositional Logic → Introduction to Predicate Logic (First-Order Logic) → First-Order Logic Syntax → ZFC Axioms Overview → Axiom Schema of Separation → Axiom Schema of Replacement → Von Neumann Ordinals → Hereditarily Finite Sets → Recursive Definitions on Finite Sets → Well-Founded Relations and Transfinite Recursion → The Axiom of Choice and Equivalent Formulations → Axiom of Choice → Well-Ordering Theorem → Infinite Cardinal Numbers → Cantor's Theorem → Uncountability and the Diagonal Argument → The Cantor Set: An Uncountable Nowhere Dense Example → Uncountable Sets and Cantor Diagonalization → The Halting Problem → Decidable and Semi-Decidable Languages

Longest path: 89 steps · 515 total prerequisite topics

Prerequisites (3)

Leads To (3)