hwsoln07

hwsoln07 - CS 341: Foundations of Computer Science II Prof....

Info iconThis preview shows pages 1–2. 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: CS 341: Foundations of Computer Science II Prof. Marvin Nakayama Homework 7 Solutions 1. The Turing machine M below recognizes the language A = { 2 n | n ≥ } . q 1 q 2 q 3 q 4 q 5 q reject q accept → rightangleswrightanglese ,R → x,R rightangleswrightanglese → rightangleswrightanglese ,L rightangleswrightanglese → rightangleswrightanglese ,R → ,L x → x,L x → x,R x → x,R rightangleswrightanglese → rightangleswrightanglese ,R x → x,R rightangleswrightanglese → rightangleswrightanglese ,R → x,R → ,R x → x,R rightangleswrightanglese → rightangleswrightanglese ,R In each of the parts below, give the sequence of configurations that M enters when started on the indicated input string. (a) 00 Answer: q 1 00 rightangleswrightanglese q 2 rightangleswrightanglese xq 3 rightangleswrightanglese rightangleswrightanglese q 5 x q 5 rightangleswrightanglese x rightangleswrightanglese q 2 x rightangleswrightanglese xq 2 rightangleswrightanglese rightangleswrightanglese x rightangleswrightanglese q accept (b) 000000 Answer: q 1 000000 rightangleswrightanglese q 2 00000 rightangleswrightanglese xq 3 0000 rightangleswrightanglese x q 4 000 rightangleswrightanglese x xq 3 00 rightangleswrightanglese x x q 4 rightangleswrightanglese x x xq 3 rightangleswrightanglese rightangleswrightanglese x x q 5 x rightangleswrightanglese x xq...
View Full Document

This note was uploaded on 01/22/2011 for the course CIS 341 taught by Professor Nakayama during the Fall '10 term at NJIT.

Page1 / 3

hwsoln07 - CS 341: Foundations of Computer Science II Prof....

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

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