Williams College Homework 9 Leslie Chong (much help from B.S.G. ...

Williams College Homework 9 Leslie Chong (much help from B.S.G. ... Williams College Homework 9 Leslie Chong (much help from B.S.G. ...

wso.williams.edu
from wso.williams.edu More from this publisher
10.07.2015 Views

Williams College Homework 9 Leslie Chong (much help from B.S.G.)Question 1 (60 points). Recall the denition of recursive languages:REC = {L | L is Turing-decidable}For each problem below, formulate the problem as a language and then determine whether that language is a memberof REC. Said differently, show which languages are decidable and which languages are undecidable.(a) (10 points) Given a Turing machine M, does it halt on the empty string?Proof. LetHALT ɛ = {< M > |M(ɛ) halts}HALT T M = {< M, w > |M halts on w}Recall from Siper Theorem 5.1 that HALT T M is undecidable. HALT ɛ is undecidable. Consider the followingreduction to HALT T M :f((< M, w >) = M ′ (y) = ”M(w)”This produces a machine that ignores its input and instead simulates M on w.f(< M, w >) ∈ HALT T M⇐⇒ M halts on w ⇐⇒ M ′ halts on any string ⇐⇒ M ′ halts on ɛ⇐⇒ f(< M, w >) ∈ HALT ɛSince f is computable, we have shown that HALT T M reduces to HALT ɛ . Since HALT T M is undecidable,HALT ɛ is also undecidable.(b) (10 points) Given a Turing machine M, is there a string for which it halts?Proof. LetUse HALT T MHALT T M :HALT a = {< M > |M(a) where a ∈ Σ*}from the previous problem. HALT a is undecidable. Consider the following reduction tof((< M, w >) = M ′ (y) = ”M(w)”This produces a machine that ignores its input and instead simulates M on w.f(< M, w >) ∈ HALT T M ⇐⇒ M halts on w ⇐⇒ M ′ halts on any string ⇐⇒ M ′ halts on a ∈ Σ*⇐⇒ f(< M, w >) ∈ HALT aSince f is computable, we have shown that HALT T M reduces to HALT a . Since HALT T M is undecidable,HALT a is also undecidable.(c) (10 points) Given a Turing machine M, is L(M) nite?Proof. LetF INIT E T M = {L(M) where M is a turing machine and L(M) is nite}A T M = {< M, w > where M is a turing machine and M accepts w}Recall that A T M is undecidable. F INIT E T M is undecidable. It is sufcient to show that A T M reduces toF INIT E T M . Consider the following computable reduction function:f < M, w >= M ′ (y) = ”M(w)”This produces a machine that ignores its input and instead simulates M on w. It is clear that f is computable.f(< M, w >) ∈ A T M ⇐⇒ M accepts w ⇐⇒ M ′ accepts any string ⇐⇒ M ′ accepts any y ∈ Σ*⇐⇒ f(< M, w >) ∈ F INIT E T MSimilarly,Fall Semester 2003 Theory of Computation - Computer Science 361 1

<strong>Williams</strong> <strong>College</strong> <strong>Homework</strong> 9 <strong>Leslie</strong> <strong>Chong</strong> (<strong>much</strong> <strong>help</strong> <strong>from</strong> B.S.G.)Question 1 (60 points). Recall the denition of recursive languages:REC = {L | L is Turing-decidable}For each problem below, formulate the problem as a language and then determine whether that language is a memberof REC. Said differently, show which languages are decidable and which languages are undecidable.(a) (10 points) Given a Turing machine M, does it halt on the empty string?Proof. LetHALT ɛ = {< M > |M(ɛ) halts}HALT T M = {< M, w > |M halts on w}Recall <strong>from</strong> Siper Theorem 5.1 that HALT T M is undecidable. HALT ɛ is undecidable. Consider the followingreduction to HALT T M :f((< M, w >) = M ′ (y) = ”M(w)”This produces a machine that ignores its input and instead simulates M on w.f(< M, w >) ∈ HALT T M⇐⇒ M halts on w ⇐⇒ M ′ halts on any string ⇐⇒ M ′ halts on ɛ⇐⇒ f(< M, w >) ∈ HALT ɛSince f is computable, we have shown that HALT T M reduces to HALT ɛ . Since HALT T M is undecidable,HALT ɛ is also undecidable.(b) (10 points) Given a Turing machine M, is there a string for which it halts?Proof. LetUse HALT T MHALT T M :HALT a = {< M > |M(a) where a ∈ Σ*}<strong>from</strong> the previous problem. HALT a is undecidable. Consider the following reduction tof((< M, w >) = M ′ (y) = ”M(w)”This produces a machine that ignores its input and instead simulates M on w.f(< M, w >) ∈ HALT T M ⇐⇒ M halts on w ⇐⇒ M ′ halts on any string ⇐⇒ M ′ halts on a ∈ Σ*⇐⇒ f(< M, w >) ∈ HALT aSince f is computable, we have shown that HALT T M reduces to HALT a . Since HALT T M is undecidable,HALT a is also undecidable.(c) (10 points) Given a Turing machine M, is L(M) nite?Proof. LetF INIT E T M = {L(M) where M is a turing machine and L(M) is nite}A T M = {< M, w > where M is a turing machine and M accepts w}Recall that A T M is undecidable. F INIT E T M is undecidable. It is sufcient to show that A T M reduces toF INIT E T M . Consider the following computable reduction function:f < M, w >= M ′ (y) = ”M(w)”This produces a machine that ignores its input and instead simulates M on w. It is clear that f is computable.f(< M, w >) ∈ A T M ⇐⇒ M accepts w ⇐⇒ M ′ accepts any string ⇐⇒ M ′ accepts any y ∈ Σ*⇐⇒ f(< M, w >) ∈ F INIT E T MSimilarly,Fall Semester 2003 Theory of Computation - Computer Science 361 1


<strong>Williams</strong> <strong>College</strong> <strong>Homework</strong> 9 <strong>Leslie</strong> <strong>Chong</strong> (<strong>much</strong> <strong>help</strong> <strong>from</strong> B.S.G.)f(< M, w >) /∈ A T M⇐⇒ M rejects or loops on w ⇐⇒ M ′ rejects any string ⇐⇒ M ′ (L) = empty set⇐⇒ f(< M, w >) /∈ F INIT E T MSince f is computable and A T M reduces to F INIT E T M , we have that F INIT E T M is undecidable sinceA T M is undecidable. Since decidability is closed uner complementation, we have that F INIT E T M is undecidable.(d) (10 points) Given a Turing machine M, does it ever write the symbol a ∈ Γ to its tape?Proof. LetW RIT E a = {< M, a > |M is a TM that contains a rule to write the symbol a ∈ Γ to its tape }Recall that A T M is undecidable. W RIT E a is undecidable. Consider the following reduction <strong>from</strong> A T M toW RIT E a .f < M, w >= M ′ (< T, a >) = Simulate M(w)1. If M(w) accepts, write a to the tape.2. If M(w) rejects, do nothing.This produces a machine that will write a to the tape iff M accepts w. It is clear that f is computable.⇐⇒ M accepts w ⇐⇒ M ′ writes a to the tape.f(< M, w >) ∈ A T M⇐⇒ f(< M, w >) ∈ W RIT E aSimilarly,f(< M, w >) /∈ A T M⇐⇒ M rejects or loops on w ⇐⇒ M ′ doesn't write anything to the tape⇐⇒ f(< M, w >) /∈ W RIT E aSince f is computable and A T M reduces to W RIT E a , we have that W RIT E A is undecidable since A T M isundecidable.(e) (10 points) Given two Turing machines M 1 and M 2 , is there a string for which they M 1 and M 2 halt?Proof. Let2HALT S T M = {< M1, M2 > | there exists some string w for which they both halt}2HALT S T M is undecidable. Recall that HALT T M is undecidable. Use the following technique to show thatHALT T M reduces to 2HALT S T M . Always generate the turing machine-string pair (< M, w >,< M, w >).Accept iff simulating M(w) accepts.f(M, w) ∈ A T M ⇐⇒ M halts on w ⇐⇒ trivially, that M and itself of course always halts on w.Since f is computable and HALT T M reduces to 2HALT S T M , we have that 2HALT S T M is undecidablesince HALT T M is undecidable.(f) (10 points) Sipser 5.12Proof. LetS = {< M > |M is a TM that accepts w R whenever it accepts w}Recall A T M is undecidable. S is undecidable. Reduce S to A T M . Consider the following reducing computablereducing function:F = ”On input < M > where M is a TM:1. Simulate M(w). If M accepts w, create M ′ that just accepts the string 1111.2. If M rejects w, create M ′ that just accepts string 01.Fall Semester 2003 Theory of Computation - Computer Science 361 2


<strong>Williams</strong> <strong>College</strong> <strong>Homework</strong> 9 <strong>Leslie</strong> <strong>Chong</strong> (<strong>much</strong> <strong>help</strong> <strong>from</strong> B.S.G.)This creates a machine that will accept M when f(< M >) accepts w R whenever it accepts w (where w = 1111and w R = 1111). Also, it will reject M when f(< M >) doesn't accept w R = 10 whenever it accepts w = 01.By construction, we have shown S to be undecidable.Question 2 (20 points). Sipser 5.10Proof. First, let's show that J is not Turing-recognizable. Recall A T M is not recognizable. Consider the followingreduction:f(< M, w >) = 0 < M, w >This will add a 0 to the beginning of any input that is accepted by A T M . So, when M is accepted, f(< M >) willaccept. Also, when M rejects, f(< M >) rejects.Now, let's show that J is not Turing-recognizable.J ≤ m A T M(as shown in class) ⇐⇒ J ≤ m A T MA T M is unrecognizable so J is unrecognizable.Question 3 (20 points). Sipser 5.11Using J <strong>from</strong> the previous question:J = {w|w = 0x for some x ∈ A T M or w = 1y for some y ∈ A T M }J = {w|w = 0x for some x ∈ A T M or w = 1y for some y ∈ A T M }Map <strong>from</strong> J to J with an easy bijection. If w = 0w ′ and w ∈ J, map w to w = 1w ′ which is certainly in J. Ifw = 1w ′ and w ∈ J, map w to w = 0w ′ which is certainly in J.Fall Semester 2003 Theory of Computation - Computer Science 361 3

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!