Turing reducibility

CSCI 2670
Introduction to Theory of
Computing
November 4, 2004
Agenda
• Yesterday
– Reductions (Section 5.3)
• Today
– Section 6.3
– We will not be covering section 6.4
• I will discuss some basic issues of this
section when covering chapter 7
November 4, 2004
2
Announcement
• Revised homework assignment for
next Tuesday
– 5.4, 5.5, 5.7, 5.9, 6.3
• I will hold extended office hours
next week
– Tuesday & Wednesday 3:00 – 5:00
November 4, 2004
3
Mapping reducibility
Definition: Language A is mapping reducible
to language B, written AmB, if there is a
computable function f:* → *, where for
every w,
w  A iff f(w)  B
f
f
November 4, 2004
4
Using mapping reductions
• Test whether w  A by finding a
mapping reduction f from A to be and
determining whether f(w)  B
• Example
– ALLDFA = {<A> | A is a DFA with L(A)=*}
– Let D = {B | B is a DFA} and let f:D→D
where f(A) = Ā
– Then A  ALLDFA iff Ā  EDFA
• Use membership of Ā in EDFA to determine
membership of A in ALLDFA
November 4, 2004
5
Mapping reductions & decidability
Theorem: If A m B and B is decidable,
then A is decidable.
Proof: Let M be a decider for B and let
f be a reduction from A to B.
Consider the following TM, N:
N = “On input w:
1. Compute f(w)
2. Run M on f(w) and report M’s output”
Then N decides A
November 4, 2004
6
Mapping reductions & undecidability
Corollary: If A m B and A is
undecidable, then B is undecidable.
•
We have been using this corollary
implicitly already
–
E.g., we showed ATM m HALTTM and
concluded HALTTM is undecidable
November 4, 2004
7
Example
• Let EV = {<A>| A is a DFA all strings
in L(A) have an even number of 1’s}
– How can we prove EV is decidable using a
mapping reduction?
• Consider the following DFA B
\{1}
1
\{1}
1
November 4, 2004
L(B) = {w * |
w has an even
number of 1’s}
8
Mapping reduction of L
• Use EQDFA = {<A,B> | A and B are
DFA’s with L(A) = L(B)}
• Mapping from L to EQDFA
– f(<A>) = <A,AB>
• A has an even number of 1’s if and
only if L(A) = L(AB)
– I.e., A  EV iff f(A)  EQDFA
November 4, 2004
9
Reductions & TM-recognizability
Theorem: If A m B and B is Turingrecognizable, then A is Turingrecognizable.
Proof: (same as decidable proof) Let M be a
recognizer for B and let f be a reduction
from A to B.
Consider the following TM, N:
N = “On input w:
1. Compute f(w)
2. Run M on f(w) and report M’s output”
Then N recognizeses
A
November 4, 2004
10
Reductions & non-TM-recognizability
Theorem: If A m B and A is not
Turing-recognizable, then B is not
Turing-recognizable.
Question: Which language have we
seen that is not Turingrecognizable?
Answer: ATM
November 4, 2004
11
Proving non-Turing-recognizability
Question: If A m U is Ā m Ū?
Answer: Yes since x  A iff f(x)  U
(Use this fact when doing homework
problem 5.5)
• How can we use the to prove nonTuring-recognizability?
• Prove ATM m U or prove ATM m Ū
November 4, 2004
12
Is mapping reducibility enough?
• Mapping reducibility does not
completely capture our intuition about
reductions
– Example: ATM and ATM are not mapping
reducible
• ATM is Turing-recognizable and ATM isn’t
– A solution to ATM would also provide a
solution to ATM
November 4, 2004
13
Oracle
• An oracle for a language B is an
external device that is capable of
reporting whether any string w is a
member of B
– We are not concerned how the oracle
determines membership
• An oracle Turing machine is a Turing
machine that can query an oracle
– The machine MB can query an oracle for
the language B
November 4, 2004
14
Example
•
An oracle Turing machine with an oracle
for EQTM can decide ETM
TEQ-TM = “On input <M>
1. Create TM M1 such that L(M1) = 
M1 has a transition from start state to reject
state for every element of 
2. Call the EQTM oracle on input <M,M2>
3. If it accepts, accept; if it rejects, reject”
•
•
TEQ-TM decides ETM
ETM is decidable
relative to EQTM
November 4, 2004
15
Turing reducibility
• A language A is Turing reducible to a
language B, written A T B, if A is
decidable relative to B
• Previous slide shows ETM is Turing
reducible to EQTM
• Whenever A is mapping reducible to
B, then A is Turing reducible to B
– The function in the mapping reducibility
could be replaced by an oracle
November 4, 2004
16
Applications
• If A T B and B is decidable, then A is
decidable
• If A T B and A is undecidable, then B
is undecidable
• If A T B and B is Turing-recognizable,
then A is Turing-recognizable
• If A T B and A is non-Turingrecognizable, then B is non-Turingrecognizable
November 4, 2004
17
November 4, 2004
18