355hw6sol

355hw6sol - Solutions for Homework Six, CSE 355 1. ( 8.1,...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Solutions for Homework Six, CSE 355 1. ( 8.1, 10 points ) Let M be the Turing machine defided by B a b c q q 1 ,B,R q 1 q 2 ,B,L q 1 ,a,R q 1 ,c,R q 1 ,c,R q 2 q 2 ,c,L q 2 ,b,L a) Trace the computation for the input string aabca . b) Trace the computation for the input string bcbc . c) Give the state diagram of M . d) Describe the result of a computation in M . Solution: a) q BaabcaB Bq 1 aabcaB Baq 1 abcaB Baaq 1 bcaB Baacq 1 caB Baaccq 1 aB Baaccaq 1 B Baaccq 2 aB Baacq 2 ccB Baaq 2 cbcB Baq 2 abbcB Bq 2 acbbcB q 2 BccbbcB b) q BbcbcB Bq 1 bcbcB Bcq 1 cbcB Bccq 1 bcB Bcccq 1 cB Bccccq 1 B Bcccq 2 cB Bccq 2 cbB Bcq 2 cbbB Bq 2 cbbbB q 2 BbbbbB c) The state diagram of M is q q 1 q 2 a/aR,b/cR,c/cR a/cL,c/bL B/BR B/BL d) The result of a computation is to replace the a s in the input string with c s and the c s with b s. 2. ( 8.2, 10 points ) Let M be the Turing machine defined by 1 B a b c q q 1 ,B,R q 1 q 1 ,B,R q 1 ,a,R q 1 ,b,R q 2 ,c,L q 2 q 2 ,b,L q 2 ,a,L a) Trace the computation for the input string abcab . b) Trace the first six transitions of the computation for the input string abab . c) Give the state diagram of M . d) Describe the result of a computation in M . Solution: a) q BabcabB Bq 1 abcabB Baq 1 bcabB Babq 1 cabB Baq 2 bcabB Bq 2 aacabB q 2 BbacabB b) q BababB Bq 1 ababB Baq 1 babB Babq 1 abB Babaq 1 bB Bababq 1 B BababBq 1 c) q q 1 q 2 B/BR,a/aR,b/bR a/bL,b/aL B/BR...
View Full Document

This note was uploaded on 02/27/2011 for the course CSE 355 taught by Professor Lee during the Fall '08 term at ASU.

Page1 / 6

355hw6sol - Solutions for Homework Six, CSE 355 1. ( 8.1,...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online