t1ans - University of Central Florida School of Computer...

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

View Full Document Right Arrow Icon
University of Central Florida School of Computer Science COT 4210 Spring 2004 Prof. Rene Peralta Answers to T1 1. Consider integers written in base 3 with no leading 0s. Let L 1 be the set of such strings which represent odd numbers. (a) Construct a DFA that accepts L 1 . answer: (b) Construct a left-linear grammar for L 1 . answer: Let Y,B,R denote the yellow, blue, and red states resp. Associate with each state the set of strings whose computation ends at that state. Then the language is composed of those strings associated with Y . The derivation rules of the grammar are B λ Y B 1 + R 1 + Y (0 + 2) R B 2 + Y 1 + R (0 + 2) The initial non-terminal of the grammar is Y . 1
Background image of page 1

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

View Full DocumentRight Arrow Icon
2. Consider the language L 2 generated by the following grammar S AB + C A aB + C B Ab + C C b + aaaC Characterize L 1 using a combination of set notation and regular ex- pressions. answer: (This problem was harder than intended because of a typo - mea culpa). C
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 06/09/2011 for the course COT 4210 taught by Professor Staff during the Spring '08 term at University of Central Florida.

Page1 / 5

t1ans - University of Central Florida School of Computer...

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