hw10sol - Computer Science 340 Reasoning about Computation...

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

View Full Document Right Arrow Icon
Computer Science 340 Reasoning about Computation Homework 10 Due at the beginning of class on Wednesday, December 5, 2007 Problem 1 Give an implementation level description of a Turing machine that decides the following language over alphabet { 0 , 1 } : { w | w does not contain twice as many 0 s as 1 s } . Read the Section on “Terminology For Describing Turing Machines” in the notes (pages 144-147) in order to clarify what an implementation level description is. Solution: I assume the start of the tape is marked by a $ , and that # represents a blank. The string lies somewhere on the tape and all the other characters are blanks. We start from the beginning and go right so that we either reach a blank (end of the string) or a 1 . In the former case, we check the tape again to see if there was any 0 ’s there (ACCEPT) or not (REJECT). In the latter though, i.e. if we found a 1 , we cross it out by substituting an X for it. After that we go back to the start (by looking for $
Background image of page 1

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

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

This homework help was uploaded on 01/29/2008 for the course COS 340 taught by Professor Charikarandchazelle during the Fall '07 term at Princeton.

Page1 / 2

hw10sol - Computer Science 340 Reasoning about Computation...

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