A is decidable relative to B

Reducibility

A reduction is a way of converting one
problem into another problem in such a way
that a solution to the second problem can be
used to solve the first problem.


HALTTM={<M,w>| M is a TM and M halts on input w}
Thm:
HALTTM is un-decidable
Proof:


By contradiction, assume R is a TM that decides
HALTTM .
With R, we construct a TM S to decide ATM:
S= “ On input <M,w>, an encoding of M and w:
1. Run TM R on input <M,w>
2. If R rejects, REJECT
3. If R accepts, simulate M on w until it halts.
4. If M has accepted, ACCEPT;
If M has rejected, REJECT. “
(Proof conti.)

If R decides HALTTM, then S decides ATM.
But ATM is un-decidable, thus HALTTM is un-decidable.


ETM={<M>| M is a TM and L(M)=∅ }
Thm:
ETM is un-decidable.
Proof:




Define Mw = “ On input x:
1. If x ≠ w , reject
2. If x = w , run M on input w and accept if M
does ”
Assume that R decides ETM.
Construct S that decides ATM as follows:
S = “ On input <M,w>
1. Use M and w to construct Mw
2. Run R on <Mw>
3. If R accepts, REJECT;
if R rejects, ACCEPT. “
But ATM is un-decidable, thus ETM is un-decidable .


REGULARTM = {<M>| M is a TM and L(M) is regular }.
Thm:
REGULARTM is un-decidable.
Proof:


Assume R decides REGULARTM .
Construct TM S to decide ATM .
S = “ On input <M,w>:
1. Construct the following TM Mw
Mw = “ On input x :
1. If x has the form 0n1n ,ACCEPT.
2. If x does not have this form, run
M on input w and ACCEPT
if M accepts w.
2. Run R on input <Mw>
3. If R accepts, ACCEPT;
If R rejects, REJECT. “


EQTM = {<M1, M2>| M1 and M2 are TMs
and L(M1)=L(M2) }
Thm:
EQTM is un-decidable.
Proof:


Let TM R decide EQTM and construct S to decide ETM
as follows:
S = “ On input <M>, where M is a TM:
1. Run R on input <M,M1>,
where M1 rejects all inputs.
2. If R accepts, accept; otherwise reject. “
If R decides EQTM , S decides ETM .
Reductions via computation histories

Def:
M: Turing Machine
w: an input string
An accepting computation history for M on w is a
sequence of configurations, C1, C2, …, Cl , where C1 is
the start configuration of M on w, Cl is an accepting
configuration of M, and each Ci legally follows from
Ci-1 .

Def:
Linear Bounded Automaton is a type of TM
where in the tape head is not permitted to
move off the portion of the tape containing
the input.

ALBA = {<M,w>| M is an LBA that accepts w}

Lemma:
Let M be an LBA with q states and g symbols
in the tape alphabet. There are exactly qngn
distinct configurations of M for a tape of
length n.
Proof:

1 2 3
Head positions : n
states
:q
tape contents : gn
n-1 n


ALBA = {<M,w> | M : LBA, M accepts w }
Thm:
ALBA is decidable.
Proof:

Algorithm:
L = “ On input <M,w>,
where M is an LBA and w is a string.
1. Simulate M on w for qngn steps until it halts.
2. If M has halted, accept if it has accepted;
and reject if it has rejected.
If it has not halted, reject.
“


ELBA = {<M>| M is an LBA where L(M)= ∅ }
Thm:
ELBA is un-decidable.
Proof:


Suppose R decides ELBA .
Construct S that decides ATM .
S = “ On input <M,w>,
where M is a TM and w is a string :
1. Construct LBA B from M and w
Recognizes all accepting computation histories
for M and w
2. Run R on <B>.
3. If R rejects, accept; if R accepts, reject.
B
Ci
#
⊦
#
Ci+1
#
“


ALLCFG = {<G>| G is a CFG and L(G)= * }
Thm:
ALLCFG is un-decidable.
A Simple un-decidable problem


Post correspondence problem(PCP)
Eg:  b , a , ca , abc : dominos
ca  ab   a   c 
match:

aba  cab  caa  aba  abcc 
Make a list of dominos (repetitions permitted)
so that the string we get by reading off the
symbols on the top is the same as the string
of symbols on the bottom.



An instance of the PCP is a collection P of
dominos: P  bt1 , bt2 ,, btk
1
2
k
a match is a sequence i1, i2, …, il , where
ti1 ti2 til  bi1 bi2 bil
      
The problem is to determine whether P has a
match.
PCP={<P>| P is an instance of the Post
Correspondence Problem with a match.}


MPCP = {<P> | P is an instance of the Post
Correspondence Problem with a match that
starts with the first domino }
Thm:
PCP is un-decidable.
Proof:


Let TM R decide the PCP and construct S deciding
ATM . Let M = (Q, , , , q0, qaccept, qreject ) .
S constructs an instance of the PCP P that has a
match iff M accepts w.
(Proof conti.)


MPCP
Part 1:
Put [ ##q w w w # ] into P’ as the 1st domino
0 1 2
n
Part 2:
For every a,b∈ and every q,r ∈Q,
qa
br

if (q,a)=(r,b,R), put [ ] into P’ .
Part 3:
For every a,b,c ∈ and every q,r ∈Q,

if (q,a)=(r,b,L), put [ rcb ] into P’ .
Part 4:
a
For every a∈ , put [ a ] into P’ .
cqa
 .
t1
b1
(Proof conti.)

Eg.
 ={0,1,2, }. w = 0100
t
Suppose (q0,0)=(q7,2,R), then [ b1 ]  [ ##q 0100 ]
1
0
q0 0
’
Part 2: places [ 2 q ] into P .
7
0
Part 4: places [ 0 ], [ 11 ], [ 22 ], and[ ] into P’ .
# q00 1 0 0 #
# q00 1 0 0 # 2q7 1 0 0 #
(Proof conti.)

Part 5:
Put [ ## ] and[ ## ]into P’ .
q7 1
If (q7,1)=(q5,0,R), then [ 0 q5 ] is in P’ .
# 2 q7 1 0 0 #
⋯
# 2 q7 1 0 0 # 2 0 q 5 0 0 #
If (q5,0)=(q9,2,L), then we have [
⋯
# 2 0 q5 0 0 #
[
0 q5 0
q9 02
][
q5 0
q9 2
# 2 0 q 5 0 0 # 2 q9 0 2 0 #
]
1q5 0
q9 12
][
2 q5 0
q9 22
]
(Proof conti.)


Part 6:
aqaccept
qaccepta
’ .
]
and
[
]
for every a∈ , Put [ q
into
P
qaccept
accept
# 2 1 qaccept0 2 #
⋯
# qaccept # #
⋯
# 2 1 qaccept0 2 # 2 1 qaccept 2 # ⋯ # qaccept # #
Part 7:
qaccept # #
Add [
#]
# qaccept # #
⋯
# qaccept # #
(Proof conti.)

Convert P’ to P:
Let u = u1u2…un
Define *u = *u1*u2… *un
u*= u1*u2*…*un*
*u*=*u1*u2*…*un*
P’
[
t1
b1

], [ bt22 ], , [ btkk ]
:
P : [ *t1 ], [ *t1 ], [ *t2 ], [ *t3 ], [ *tk ], [ * ]
*b *
b*
b *
b*
b *

1
1
2
3
k

Must start with the first domino, and
*
ends with an extra * on the top
■
Mapping Reducibility:
(many- one reducibility)

Def:
f : *  * is a computable function
if some TM M, on every input w, halts with
just f(w) on its step.

Def:
Language A is mapping reducible to B,
written A ≤m B , if there is a computable function
f : *  * , where for every w,
w ∈ A ⇔ f(w) ∈ B
f is called the reduction of A to B
A
f
w
f
B

Thm:
If A ≤m B and B is decidable,
then A is decidable.
Proof:

Let M be the decider for B,
f be the reduction from A to B.
N = “ On input w:
1. Compute f(w)
2. Run M on input f(w) and
output whatever M outputs.
“

Cor:
If A ≤m B and A is un-decidable,
then B is un-decidable.

Thm:
If A ≤m B and B is Turing-recognizable,
then A is Turing-recognizable.

Cor:
If A ≤m B and A is not Turing-recognizable,
then B is not Turing-recognizable.
Thm: EQTM is neither Turing-recognizable nor coTuring-recognizable.
__
Pf: We prove by showing ATM ≤m EQTM and
ATM ≤m EQTM. Why?
F=“On input <M, w>:
1. Construct M1 and M2.
M1= “On any input: Reject.”
M2= “On any input:
Run M on w. If it accepts, accept.”
2. Output <M1, M2>.

G=“On input <M, w>:
1. Construct M1 and M2.
M1= “On any input: Accept.”
M2= “On any input:
Run M on w. If it accepts, accept.”
2. Output <M1, M2>.
G completes the reduction of ATM ≤m EQTM.
Turing Reducibility
(mapping reducibility?)

Def:
An oracle for a language B is an external device that
is capable of reporting whether any string w is a
member of B.

Def:
An oracle Turing machine is a modified Turing
machine that has the additional capability of querying
an oracle.
MB : an oracle TM that has an oracle for B.
Eg: ETM : un-decidable.
T A TM = “ On input <M>, where M is a TM:

1. Construct TM N:
N = “ On any input:
1. Run M in parallel on all strings in * .
2. If M accepts any of these strings, accept. “
2. Query the oracle to determine
whether <N,0>∈ ATM .
3. If the oracle answers NO, accept; if YES, reject. “
T
A TM
decides ETM. Thus, ETM is decidable relative to ATM.

Def:
Language A is Turing reducible to language B, written
A ≤T B, if A is decidable relative to B.

Thm:
If A ≤T B and B is decidable,
then A is decidable.
Proof:
 If B is decidable, then replace the oracle for B by an
actual procedure(or TM) that decides B .

Thus, we may replace the oracle TM that decides A
by an ordinary TM that decides A.