hw6sol - CS 181 — Winter 2008 Formal Languages and...

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

View Full Document Right Arrow Icon

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

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

Unformatted text preview: 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 ....
View Full Document

This homework help was uploaded on 04/02/2008 for the course COM SCI 181 taught by Professor Griebach during the Spring '08 term at UCLA.

Page1 / 2

hw6sol - CS 181 — Winter 2008 Formal Languages and...

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