# hw6sol - CS 181 Winter 2008 Formal Languages and Automata...

• Homework Help
• 2
• 100% (1) 1 out of 1 people found this document helpful

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

CS 181 — Winter 2008 Formal Languages and Automata Theory Problem Set #6 Solutions Problem 6.1. (10 points) Show that a language for which there exists an enumerator that enumer- ates the language in increasing lexicographical order is a decidable language. [For this, give a high level description of a Turing machine that halts on all inputs and accepts exactly the language.] Solution Let L be a language and E an enumerator that lists the words of L in increasing lexicographical order (i.e. by length, breaking ties lexicographically). We will show how build a Turing machine M that decides L . Given a word w , we can check to see if w L by comparing w with each of the words enumerated by E in order. If w L then eventually we’ll find a match. However, if w / L , then we may continue forever. Yet we can take advantage of the fact that E enumerates the words in increasing length. In particular, we can check w against the enumerated words until the length of the enumerated words becomes larger than that of w . If this is the case, then we know w will never appear in E ’s list and so must not be in L . Then our Turing machine M decides L by enumerating words (using E ) one at a time and comparing against w . If w is found, then it accepts. If

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

This is the end of the preview. Sign up to access the rest of the document.
• Spring '08
• griebach
• #, Halting problem, #w2, #wi

{[ snackBarMessage ]}

### What students are saying

• 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.

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

• 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.

Dana University of Pennsylvania ‘17, Course Hero Intern

• 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.

Jill Tulane University ‘16, Course Hero Intern