Quiz6Soln

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

Info iconThis 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).
Background image of page 1

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

View Full DocumentRight 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
Background 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

This note was uploaded on 02/07/2011 for the course CS 501 taught by Professor Sm during the Spring '11 term at Indiana.

Page1 / 2

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

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