{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

355hw6sol

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

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

Solutions for Homework Six, CSE 355 1. ( 8.1, 10 points ) Let M be the Turing machine defided by δ B a b c q 0 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 0 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 0 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 0 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

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

View Full Document
δ B a b c q 0 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 0 BabcabB Bq 1 abcabB Baq 1 bcabB Babq 1 cabB Baq 2 bcabB Bq 2 aacabB q 2 BbacabB b) q 0 BababB Bq 1 ababB Baq 1 babB Babq 1 abB Babaq 1 bB Bababq 1 B BababBq 1 c) q 0 q 1 q 2 B/BR, a/aR, b/bR a/bL, b/aL B/BR c/cL d) The result of a computation is to replace the a ’s before the first c with b
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}