Flac-hw6 - ” strings with more than one “ ” are don’t-care inputs that can be ignored to simplify the design of your PDA Exercise 3 Show

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
FLAC Assignment 6 Exercise 1. Give context-free grammars that generate the following languages. In all parts the alphabet is Σ is { 0 , 1 } . a. { w | w contains at least three 1 s } b. { w | w starts and ends with the same symbol } c. { w | the length of w is odd } d. { w | the length of w is odd and its middle symbol is a 0 } e. { w | w = w R , i.e., w is a palindrome (of either odd or even length) } f. The empty set (Note: You may check your answers to parts (a) and (d) in the book; see Exercise 2.4 on page 128 and 132. But don’t peek without first trying it yourself!) Exercise 2. Give the state diagrams of pushdata automata for the following languages. d. The language of Exercise 1(d). e. The language of Exercise 1(e). f. { w # v | w has more occurrences of 1 than does v } . You may assume that the input string has no more than one occurrence of “
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: # ”; strings with more than one “ # ” are don’t-care inputs that can be ignored to simplify the design of your PDA. Exercise 3. Show the intersection of a context-free language C with a regular language R is always context-free. Exercise 4. Show that the language { n 1 m n 1 m | n ≥ } is not context-free. Exercise 5. Show that the language { ww | w ∈ ( + 1 ) * } is not context-free. Hint: Intersect with * 1 * * 1 * and use the results from Exercises 3 and 4. Exercise 6 (bonus). Is the following language context-free? Prove your answer. { ww | w ∈ ( a + b ) * , w ∈ ( a + b ) * , w 6 = w , and | w | = | w |} Page 1...
View Full Document

This note was uploaded on 02/29/2012 for the course CS 15-453 taught by Professor Edmundm.clarke during the Spring '09 term at Carnegie Mellon.

Ask a homework question - tutors are online