2002-Automata_and_Formal_Languages-solutions

2002-Automata_and_Formal_Languages-solutions -...

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

View Full Document Right Arrow Icon
Comprehensive Exam: Autumn 2002-03 Automata and Formal Languages (60 points) Sample Solutions Problem 1. [10 points] Recall that a string x is called a substring of another string w if x appears consecutively within w (i.e. w =yxz for some strings y,z ). 1. [3 points] Give a regular expression for the language L = { * w ∈Σ | the string papi is a substring of w }, where Σ is the English alphabet. 2. [7 points] Give a deterministic finite automaton for L . (Partial credit for a nondeterministic finite automaton if you cannot get a DFA.) Solution: 1. ** papi ΣΣ 2. p a START {} p Σ − {,,} pai Σ − p {,} p a Σ− p p a Σ p Problem 2. [10 points] Decide whether the following statements are TRUE or FALSE. You will receive 2 points for each correct answer and –2 points for each incorrect answer. 1. Nondeterministic and deterministic finite automata recognize the same set of languages. 2. Nondeterministic and deterministic pushdown automata recognize the same set of languages.
Background image of page 1

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

View Full DocumentRight Arrow Icon
3. Nondeterministic and deterministic Turing machines recognize the same set of languages. 4. The intersection of two recursive languages is recursive. 5. The intersection of two context-free languages is context-free. Solution: 1. True 2. False 3. True 4. True 5. False Problem 3. [15 points] Classify each of the following languages as being in one of the following classes of languages:
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/18/2011 for the course CS 154 at Stanford.

Page1 / 4

2002-Automata_and_Formal_Languages-solutions -...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online