hw10sol - Computer Science 340 Reasoning about Computation...

Info icon This 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 $ and then by moving to the right, we look for 0 ’s and we cross out at most two of them. If we couldn’t
Image of page 1

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

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

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern