Decidability

Deciders, diagonalization, PCP · Chapters 4–5

Which problems are decidable?

Each problem is a language of encoded inputs, as in Sipser. Theorem numbers are from the 3rd edition.

LanguageQuestionStatusSipserTry it
ADFA, ANFADoes the automaton accept w?decidableTheorems 4.1, 4.2Finite automata → Test
AREXDoes the regular expression generate w?decidableTheorem 4.3Regular expressions
EDFAIs L(A) empty?decidableTheorem 4.4Below
EQDFAIs L(A) = L(B)?decidableTheorem 4.5Below
ACFGDoes the grammar generate w?decidableTheorems 4.7, 7.16Grammars → CYK
ECFGIs L(G) empty?decidableTheorem 4.8Below
EQCFG, ALLCFGAre two grammars equivalent? Does G generate every string?undecidableTheorem 5.13, Exercise 5.1
ATMDoes the Turing machine accept w?recognizable, not decidableTheorem 4.11Undecidability tab
ATMDoes M fail to accept w?not recognizableCorollary 4.23
HALTTMDoes M halt on w?recognizable, not decidableTheorem 5.1Turing machines (step limit)
ETM, REGULARTMIs L(M) empty? Is it regular?undecidableTheorems 5.2, 5.3
EQTMDo two TMs recognize the same language?neither recognizable nor co-recognizableTheorems 5.4, 5.30
PCPDoes a set of dominoes have a match?recognizable, not decidableTheorem 5.15Post Correspondence tab

A language is decidable exactly when it and its complement are both Turing-recognizable (Theorem 4.22).

Automata A and B

One move per line: from symbol to. Use commas for several symbols and ε for an empty move.

Load into A:
Load into B:

EDFA = {⟨A⟩ | L(A) = ∅}

The decider marks the start state, then keeps marking any state with an arrow coming in from a marked state. A accepts some string exactly when an accepting state gets marked (Theorem 4.4).

EQDFA = {⟨A, B⟩ | L(A) = L(B)}

The decider builds C that accepts the strings where A and B disagree, and runs the EDFA decider on C (Theorem 4.5).

ECFG = {⟨G⟩ | L(G) = ∅}

The decider marks every terminal, then marks a variable A whenever some rule A → U1⋯Uk has every Ui marked. L(G) is empty exactly when the start variable is never marked (Theorem 4.8).

Decidability, step by step

Chapter 4 of Sipser asks which questions about machines an algorithm can answer. Some can be decided by simple marking procedures; others, like whether a Turing machine accepts a string, cannot be decided at all. This page lets you run the deciders, follow the diagonal proofs, and play with an undecidable puzzle.

Writing an automaton

LineMeans
start: q0the start state (default: the first state)
accept: q1, q2the accepting states
q0 a q1q0 goes to q1 on a
q1 a,b q1the same move for a and b
q0 ε q2an ε-move

Or load the drawing you made on the Finite automata page: it is read straight from this browser.

Deciders

  1. A decider is a Turing machine that halts on every input, answering accept or reject.
  2. EDFA and ECFG are decided by marking: keep marking until nothing changes, then look at what got marked.
  3. EQDFA reduces to EDFA: two machines agree exactly when the machine for their symmetric difference accepts nothing.

Undecidable problems

  1. The diagonal method builds an object that differs from every item in a list.
  2. Applied to Turing machines, it gives a machine D that disagrees with itself, so ATM has no decider.
  3. Chapter 5 spreads this result by reductions: HALTTM, ETM, EQTM and PCP are undecidable too.