2003-Automata_and_Formal_Languages-scanned-solutions

# 2003-Automata_and_Formal_Languages-scanned-solutions -...

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

Comprehensive Exam Solutions Autumn 2003-04 Automata and Formal Languages (60 points) Problem 1. [lo points] Consider the following grammar G over the alphabet C = {0,1}, where S is the start symbol of the grammar. S -+&IOTIlU T--+ OTI 1s u-+ 0s 1. [2 points] Give a derivation of the string 1001. 2. [4 points] Give a deterministic finite automaton for the language of G. 3. [4 points] Give a regular expression for the language of G. Solution. 2. The DFA is shown in the following figure. It is ok to omit state D. f Problem 2c [lo points] For each' of the following statements, write TRUE if the statement is true for all languages L,M that satisfy the hypothesi& otherwise, write FALSE. You will receive 2 points for'each correct answer and -2 points for each incorrect answer.

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

View Full Document
1. If L is a nonregular language and M is a regular language then their concatenation LM is not regular. (Recall that the concatenation is LM = {xy 1 XE L, y E M ) .) 2. All finite languages L are regular. 3. All context-free languages L are in the class P (Polynomial Time). 4. If L, M are languages in PSPACE then their difference L-M is also in PSPACE. (Recall that L-M ={xlx~ L andxg: M).) 5. If L, M are recursively enumerable languages then L-M is also recur&vely enumerable. Solution.
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

2003-Automata_and_Formal_Languages-scanned-solutions -...

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

View Full Document
Ask a homework question - tutors are online