HM7-Grammars-ParseTrees-Ambiguity-Answers

HM7-Grammars-ParseTrees-Ambiguity-Answers - CS 341 Automata...

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 341 Automata Theory Elaine Rich Homework 7 Due: Thursday, March 1, 2007 This assignment covers Sections 11.1 - 11.6. 1) Let = { a , b }. For the languages that are defined by each of the following grammars, do each of the following: i . List five strings that are in L . ii . List five strings that are not in L . iii . Describe L concisely. You can use regular expressions, expressions using variables (e.g., a n b n , or set theoretic expressions (e.g., { x : }) iv . Indicate whether or not L is regular. Prove your answer. a) S a S | S b | i. , a , b , aaabbbb , ab ii . ba , bbaa , bbbbba , ababab , aba iii . L = a * b * iv . L is regular because we can write a regular expression for it. b) S a S a | b S b | a | b i. a , b , aaa , bbabb , aaaabaaaa ii . , ab , bbbbbbba , bb , bbbaaa iii . L is the set of odd length palindromes, i.e., L = { w = x ( a b ) x R , where x { a , b }*}. iv . L is not regular. Easy to prove with pumping. Let w = a k baba k . y must be in the initial a region....
View Full Document

Page1 / 5

HM7-Grammars-ParseTrees-Ambiguity-Answers - CS 341 Automata...

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