100 likes | 336 Views
Giorgi Japaridze Theory of Computability. Reducibility. Episode 3. 3.1.a. Giorgi Japaridze Theory of Computability. The undecidability of the halting problem. Let HALT TM = {<M,w> | M is a TM and M halts on input w } HALT TM is called the halting problem.
E N D
Giorgi Japaridze Theory of Computability Reducibility Episode 3
3.1.a Giorgi JaparidzeTheory of Computability The undecidability of the halting problem Let HALTTM = {<M,w> | M is a TM and M halts on input w} HALTTM is called the halting problem. Theorem 3.1:HALTTM is undecidable. Proof idea: Assume, for a contradiction, that HALTTMis decidable. I.e. there is a TM R that decides HALTTM. Construct the following TM S: S = “On input <M,w>,an encoding of a TM M and a string w: 1. Run 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.” • If M works forever on w, what will S do on <M,w>? Expicitly reject • If M accepts w, what will S do on input <M,w>? Accept • If M explicitly rejects w, what will S do on <M,w>? Expicitly reject Thus, S decides the problem ATM. But this is impossible (Theorem 2.2)
3.3.a Giorgi JaparidzeTheory of Computability Definition of mapping reducibility Let A and B be sets of strings over an alphabet . We say that A is mapping reducible to B, written AmB, if there is a computable function f: ** such that, for every w*, wA ifff(w)B. The function f is called a mappingreduction(映射归约)of A to B. * * A B f f
3.3.a Giorgi JaparidzeTheory of Computability Definition of mapping reducibility Let A and B be sets of strings over an alphabet . We say that A is mapping reducible to B, written AmB, if there is a computable function f: ** such that, for every w*, wA ifff(w)B. The function f is called a mappingreduction(映射归约)of A to B. * * A B f f
3.3.a Giorgi JaparidzeTheory of Computability Definition of mapping reducibility Let A and B be sets of strings over an alphabet . We say that A is mapping reducible to B, written AmB, if there is a computable function f: ** such that, for every w*, wA ifff(w)B. The function f is called a mappingreduction(映射归约)of A to B. * * A B f f
3.3.b Giorgi JaparidzeTheory of Computability Exercise on mapping reducibility In each case below, find (precisely define) a particular function that is a mapping reduction of A toB. Both A and B are sets of strings over the alphabet{0,1}. A = {w | the length of w is even}, B = {w | the length of w is odd} A = B = {w | the length of w is even} A={0,1}*, B={00,1,101}
3.3.c Giorgi JaparidzeTheory of Computability Using mapping reducibility for proving decidability/undecidability Theorem 3.2: If AmB andBis decidable, thenAis decidable. Proof: Let DB be a decider for B and f be a mapping reduction of A to B. We describe a decider DA for A as follows. DA= “On input w: 1. Compute f(w). 2. Run DB on input f(w)and do whateverDBdoes.” Corollary 3.3: If AmB andAis undecidable, thenBis undecidable. Theorem 3.2 remains valid with “recognizable” instead of “decidable”. So does Corollary 3.3.
3.3.d Giorgi JaparidzeTheory of Computability For every TM M, let M*be the following TM: M*= “On input x: 1. Run M on x. 2. If M accepts, accept. 3. If M rejects, enter an infinite loop.” A mapping reduction of ATM to HALTTM Thus, • If M accepts input x, then M* • If M explicitly rejects x, then M* • If M never halts on x, then M* • To summarize, M accepts x iff M* accepts x never halts on x never halts on x halts on x Let then f be the function defined by f(<M,w>)=<M*,w>. Is f computable? Yes! Obviously <M,w>ATMiff f(<M,w>) i.e. f is a HALTTM mapping reduction of ATMto HALTTM So, sinceATMis undecidable, HALTTMis undecidable as well.
3.3.e Giorgi JaparidzeTheory of Computability Turing reducibility An oracle (谕示) for a set B is an external device that is capable of reporting whether any string w is a member of B. An oracle Turing machine (OTM) is a modified Turing machine that has the additional capability of querying an oracle. Example: Construct an OTM O such that, as long as the oracle of O is for the acceptance problem ATM, O decides the non-acceptance problem ATM. O = “On input <M,w>,where M is a TM and w is a string: 1. Query the oracle to determine whether <M,w>ATM. 2. If the oracle answers NO, accept; if YES, reject.” A set A is Turing reducible (图灵可归约) to set B, written ATB, iff there is an OTM M such that, as long as the oracle of M is for B, M decides A.
3.3.f Giorgi JaparidzeTheory of Computability Using Turing reducibility Theorem 3.4: a) If ATBand B is decidable, then A is decidable. Consequently, b) If ATBand A is undecidable, then B is undecidable. Proof (a):AssumeMisanOTMthatdecidesAaslongastheoracle ofMisforB. If B is decidable, then we may replace the oracle for B byan actual procedure that decides B. Thus we may replace Mby an ordinary TM that decides A. Exercise:Showthatthe acceptanceproblem(ATM) isTuring reducibletothehaltingproblem(HALTTM).