hw06 - CS 154 Intro. to Automata and Complexity Theory...

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

View Full Document Right Arrow Icon
CS 154 Intro. to Automata and Complexity Theory Handout 24 Autumn 2009 David Dill November 10, 2009 Problem Set 6 Due: November 17, 2009 Homework: (Total 100 points) Do the following exercises. Problem 1 [20 points] This was the example CFG in lecture for regular expressions over the alphabet Σ = { a, b } . Rewrite the grammar into an equivalent grammar (i.e., one with the same language) that is unambiguous. The resulting grammar should group operations according to their precedence ( * should be “stickier” than · , which should be “stickier” than +). Draw the parse tree for ( a + b · a ) * using your new grammar. R → ∅ R e R a R b R R + R R R · R R R * R ( R ) Problem 1’ [20 points] If you felt that the previous problem was too easy, you can do this one instead: Give a context-free grammar for the set of all strings over the al- phabet { a, b } that are not of the form ww (i.e, the same string concatenated with itself). (This is exercise 5.1.1 (c) in the textbook.)
Background image of page 1

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

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

This note was uploaded on 01/12/2010 for the course CS 154 at Stanford.

Page1 / 2

hw06 - CS 154 Intro. to Automata and Complexity Theory...

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