Skip to content

20. Reductions

Mar 15/17, 2022

  • Reduction: problem X is reduced to problem Y => if we can solve Y then we can solve X

  • Language A is reduced to language B => there is a computable function f (reduction) such that wAf(w)B

Using reductions

Theorem 1: If language A is reduced to language B and language B is decidable, then A is decidable.

  • Basic proof idea: Build the decider for A, using the decider for B, then, from reduction: wAf(w)B

                       decider for A
            |=================================|
            |           |  f(w)   |  decider  |---> yes  M accepts w
     w ---> | reduction |-------->|   for B   |
            |           |         |           |---> no   M rejects w
            |=================================|
    

Theorem 2: Language A is reduced to B, and language A is undecidable, then B is undecidable.

  • Basic proof idea: suppose B is decidable. Using the decider for B build the decider for A => contradiction
  • To prove that B is undecidable, we only need to reduce a known undecidable language A to B

Theorem 3: If language A is reduced to B and language A is undecidable, then B is undecidable.

  • If B is decidable, then B is decidable (see: complement)
  • Basic proof idea: suppose B is decidable then B is decidable. Using the decider for B build the decider for A => contradiction
  • wAf(w)B   (or alternatively: wAf(w)B ) --- contradiction:

                       decider for A
            |=================================|
            |           |  f(w)   |  decider  |---> yes  M accepts w
     w ---> | reduction |-------->|   for !B  |
            |           |         |           |---> no   M rejects w
            |=================================|
    

  • To prove that language B is undecidable, we only need to reduce a known undecidable language A to B or B.

EX1. EQUALDFA

EQUALDFA = { <M1, M2>: M1 and M2 are DFAs that accept the same language }

is reduced to: EMPTYDFA = {<M>: M is a DFA that accepts the empty language }

To prove this, we only need to construct:

<M1, M2> => TM for reduction f => f(<M1,M2>)=<M> DFA

Then <M1,M2>EQUALDFA<M>EMPTYDFA (T1)


Let L1 be the language of DFA M1 and let L2 be the language of DFA M2.

Construct DFA M by combining M1 and M2 so that L(M)=(L1L2)(L1L2)

Then: L1=L2L(M)= and T1 holds.

                    decider for EQUAL_DFA
             |==================================|
             |           |   <M>    |  decider  |---> yes
<M1,M2> ---> | reduction |--------->|    for    |
             |           |          | EMPTY_DFA |---> no
             |==================================|

EX2. State-entry problem

  • Input: Turing machine M, state q, string w
  • Question: does M enter state q while processing w?
  • Corresponding language: STATETM = { <M,w,q>: M enters state q on input w }

Theorem: STATETM is undecidable

Proof. Reduce HALTTM to STATETM. Given the reduction, if STATETM is decidable, then HALTTM is decidable => contradiction

                    decider for HALT_TM
             |==================================|
             |           | <M',q,w> |  decider  |---> yes
<M,w> -----> | reduction |--------->|    for    |
             |           |          | STATE_TM  |---> no
             |==================================|

We only need to build <M,w> => reduction => <M^,q,w> so that <M,w>∈HALTTM<M^,w,q>∈STATETM.

For the reduction, construct M^ from M:

  • for all halting states in M, add transition xx,R to special halt state q where x is a placeholder for every unused tape symbol x of qi.

  • Then, if M halts M^ halts on state q

Therefore: when M halts on input w, then M^ halts on state q on input w.
Equivalently: <M,w>∈HALTTM<M^,w,q>∈STATETM.

EX3. Blank-tape halting problem

  • Input: Turing machine M
  • Question: Does M halt when started with a blank tape?
  • Corresponding language: BLANKTM = { <M>: M is a Turing machine that halts when started on a blank tape }

Theorem: BLANKTM is undecidable (blank tape halting problem is unsolvable)

Proof. Reduce HALTTM (halting problem) to BLANKTM (blank tape problem). Given this reduction, if BLANKTM is decidable, then HALTTM is decidable => contradiction

                    decider for HALT_TM
             |=================================|
             |           |   <M'>  |  decider  |---> yes
<M,w> -----> | reduction |-------->|    for    |
             |           |         | BLANK_TM  |---> no
             |=================================|

We only need to build the reduction <M,w> => reduction => <M^> so that <M,w>∈HALTTM<M^>∈BLANKTM

Construct <M^> from <M,w>:

  • is tape blank?
    • N: accept and halt
    • Y: write w on tape => run M with input w
  • => if M halts then M^ halts also.

Therefore: if M halts on input w then M^ halts when started on blank tape.
Equivalently: <M,w>∈HALTTM<M^>∈BLANKTM.

Undecidable problems for Recognizable Languages

See: Rice's theorem

Let L be some Turing-recognizable language. All of these are undecidable: (1) is L empty? (2) is L regular? (3) does L have size 2?

EX1. Empty language problem

  • Input: Turing machine M
  • Question: is L(M) empty: L(M)=?
  • Corresponding language: EMPTYTM = { <M>: M is a Turing machine that accepts the empty language }

Theorem: EMPTYTM is undecidable (empty-language problem is unsolvable).

Proof. Reduce ATM (membership problem) to EMPTYTM (empty language problem). Given the reduction, if EMPTYTM is decidable, then ATM is decidable => contradiction.

We only need to build the reduction: <M,w> => reduction => <M^> so that <M,w>∈ATM<M^>∈EMPTYTM.

Construct <M^> from <M,w>:

  • let s be input string: does s equals x (some arbitrary value x)?

    • Y: write w on tape and simulate M on w => if M accepts w, then accept s
    • for all other outcomes: reject
  • When M accepts w => L(M)={x}

  • When M does not accept w => L(M^)=

Therefore: M accepts wL(M).
Equivalently: <M,w>∈ATM<M^>∈EMPTYTM.

EX2. Regular language problem

  • Input: Turing machine M
  • Question: is L(M) a regular language?
  • Corresponding language: REGULARTM = { <M> : M is a Turing machine that accepts a regular language }

Theorem: REGULARTM is undecidable (regular language problem is undecidable)

Proof. Reduce ATM (membership problem) to REGULARTM (regular language problem). Given the reduction, if REGULARTM is decidable, then ATM is decidable => contradiction.

We only need to build the reduction <M,w> => reduction => <M^> so that <M,w>∈ATM<M^>∈REGULARTM.

Construct <M^> from <M,w>:

  • let s be input string: does s=akbk for some k0?

    • Y: write w on tape and simulate M on w => if M accepts w, then accept s
    • for all other outcomes: reject
  • When M accepts w => L(M^)={anbn:n0} (not regular)

  • When M does not accept w => L(M^)= (regular)

Therefore: M accepts wL(M^) is not regular.
Equivalently: <M,w>∈ATM<M^>∈REGULARTM.

EX3. Size-2 language problem

  • Input: Turing machine M
  • Question: does L(M) have size 2 (|L(M)|=2)?
  • Corresponding language: SIZE2TM = { <M> : M is a Turing machine that accepts exactly 2 strings }

Theorem: SIZE2TM is undecidable (size2 problem is unsolvable).

Proof. Reduce Reduce ATM (membership problem) to SIZE2TM (size 2 language problem). Given the reduction, is SIZE2TM is decidable, then ATM is decidable => contradiction.

We only need to build the reduction <M,w> => reduction => <M^> so that <M,w>∈ATM<M^>∈SIZE2TM.

Construct <M^> from <M,w>: - let s be input string: does sL for some L accepting exactly 2 strings? - Y: write w on tape and simulate M on w => if M accepts w, then accept s - for all other outcomes: reject

  • When M accepts w => L(M^) = { Language of 2 strings }
  • When M does not accept w => L(M^)=   (0 strings)

Therefore: M accepts wL(M^) has size 2.
Equivalently: <M,w>∈ATM<M^>∈SIZE2TM.