Quiz6Soln - something along the lines of move to the end of...

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

View Full Document Right Arrow Icon
CSCI 2670 Intro. to Theory of Comp. Quiz 6 10/12/2005 Name: _______________________________ (1) (5 points) In class and in the text, we used the following Turing machine E to enumerate a language accepted by Turing machine M. First, we determined a way of listing all strings in Σ* - i.e., we let Σ* = { s 1 , s 2 , s 3 , … }: E = “Ignore the input. 1 For i = 1, 2, 3, … 2 Run M for i steps on each input s 1 , s 2 , …, s i 3 Whenever M accepts a string, print it” Why didn’t we use the following method, which seems more intuitive? E bad = “Ignore the input. 1 For i = 1, 2, 3, … 2 Run M on input s i 3 If M accepts, print s i Because M may not halt on some s i . In this case, E bad would not print out any string s j where j > i even if s j is in L(M).
Image of page 1

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

View Full Document Right Arrow Icon
(2) (5 points) Let L = {0 n 1 m | n < m}. Describe a 2-tape Turing machine that decides L. You may describe the Turing machine at a high level (e.g., you may say
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: something along the lines of move to the end of the tape). M = “on input w 1. if w starts with a 1 2. move right until a symbol other than 1 is encountered 3. if the tape head points to ~ accept 4. else reject 5. else if the tape head does not start with a 0 reject 6. replace the 0 with X 7. move right past all 0’s and Y’s 8. if the tape head does not point to a 1 reject 9. replace the 1 with a Y 10. move left past all Y’s 11. if the tape head points to an X 12. move right once then move right past all Y’s 13. if the tape head does not point to a 1 reject 14. move right past all 1’s 15. if the tape head points to a ~ accept 16. else reject 17. else move left past all 0’s 18. move right 1 space 19. go to line 6”...
View Full 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