# t2sample - u,v,w,x,y , such that vx 6 = ; and uv i wx i y...

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 sample questions T2 1. Construct a left-linear grammar for the following DFA. 2. State De Morgan’s laws for sets. Prove or disprove “context-free languages are closed under intersection”. answer: covered in class (see chapter 8, section 5 of textbook). 3. Let L be the language generated by the following grammar. S Sa + Ab A Bb + Ab + a B Sb + λ Find a regular expression for L .

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

View Full Document
4. Use the state-minimization algorithm learned in class to ﬁnd a smallest DFA equivalent to the following DFA. answer: I get a machine with 3 states. 5. Show that the set of palindromes over Σ = { a,b,c } is not regular. 6. Write a Chomsky-Normal Form grammar for the set of palindromes over Σ = { a,b } . answer: S AT + BR + λ W AT + BR + a + b T WA + a R WB + b A a B b
7. Consider the following grammar G S V W + λ V XY + b W Y X + a X ZR + c Y RZ R RV + d Z a ﬁnd speciﬁc strings
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: u,v,w,x,y , such that vx 6 = ; and uv i wx i y belongs to L ( G ) for all i 0. answer: An easy way to get such a string is to draw a derivation tree that repeats a variable along a path from the root. Then see what happens to the string when the derivation tree rooted at the lower of the repeated variables is exchanged for the derivation tree rooted at the higher one. This is how I got the following u = v = ad w = b x = da w = a i.e. ( ad ) i b ( da ) i a L ( G ) for all i . 8. For the following grammar, write an equivalent grammar that is not left-recursive. S SS + AA A Ab + a B BS + 9. Construct a PDA for the language L = { | #( w ) a 1 mod 3 } { a n b n | n } . answer: The straight-forward construction yields a machine with 4 states....
View Full 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 / 3

t2sample - u,v,w,x,y , such that vx 6 = ; and uv i wx i y...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online