4.6.17 · D3Theory of Computation

Worked examples — Decidability — decidable (recursive) and recognizable (recursively enumerable) languages

2,167 words10 min readBack to topic

Before we start, one picture to fix the vocabulary we will reuse in every single example.


The scenario matrix

Every language falls into one of these case classes. Each row is a different combination of "how does the machine behave on members?" and "how does it behave on non-members?", plus the degenerate and limiting edges.

Cell Case class On members On non-members Verdict we expect
C1 Bounded simulation (no loop possible) halts-accept halts-reject decidable
C2 Unbounded simulation, one-sided halts-accept may loop recognizable, undecidable
C3 Complement of a decidable set halts-reject→accept halts-accept→reject decidable (swap trick)
C4 Complement of a "loops-on-no" set not recognizable
C5 Both and recognizable accept accept (other machine) decidable (dovetail)
C6 Degenerate: or trivial trivial decidable
C7 Limiting: input where the machine does loop loops shows recognizer decider
C8 Real-world word problem halts-accept halts-reject decidable
C9 Exam twist: "undecidable ⇒ not recognizable?" false — recognizable stays

The 9 examples below hit every cell.


Worked examples


Recall Self-test: name the cell for each language

::: C1 — decidable (bounded simulation) ::: C2 — recognizable, undecidable ::: C4 — not recognizable and ::: C6 — trivially decidable " slides right forever" fed to ::: C7 — the loop that proves recognizer ≠ decider