# Hw4 - Homework 4 CISC 303 Timo Kötzing([email protected]

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

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Homework 4 CISC 303 Timo Kötzing ([email protected]) Handed out: Friday, March 6. Due Date: Friday, March 13. Problem 1. (8 points) Give a regular expression for the following languages. (i) L = { w ∈ { a,b } * | the second to last symbol of w is a } ; (ii) L 1 = { w ∈ { a } * | | w | is divisible by 3 or by 5 } ; (iii) L 2 = { a n | n ≥ } ∪ { ( ba ) n | n ≥ } ; (iv) The language introduced in Homework Set 2, Problem 3 ( oating point numbers). Problem 2. (8 points) Transform the following regular expressions into ε-NFAs, using the algorithm from class. (i) ( bb ) * | bb ; (ii) ( aba ) * ba ; (iii) a * ( bb | ab | ba ) aa . Problem 3. (8 points) Let A = { c,d } * and L = { w ∈ A * | w contains the same number of c s and d s } . Claim: L is not regular. Proof: Suppose, by way of contradiction, L is regular. L ( c * d * ) is regular, so L ∩ L ( c * d * ) is regular as it is the intersection of two regular languages. But L ∩ L ( c * d * ) = { c n d n | n ≥ } is not regular as shown in class (just with...
View Full Document

• Spring '08
• Carberry,M
• Regular expression, Regular language, Nondeterministic finite state machine, Automata theory, c∗ d∗

{[ snackBarMessage ]}

Ask a homework question - tutors are online