{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

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

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

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

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

View Full Document
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
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### 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
Ask a homework question - tutors are online