ps2-sol - ECE 468 Problem Set 2: Regular expressions and...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

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

Unformatted text preview: ECE 468 Problem Set 2: Regular expressions and Finite Automata [ Solutions ] 1. Give a non-deterministic finite automaton for the following regular expression: (( a * b ) * ( bc * ) * ) Answer: We will build this NFA up in pieces. First, let us build NFAs for a * and c * (assume that the leftmost state is the start state): a c Now let us build a * b and bc * : a c b b Now we build ( a * b ) * and ( bc * ) * : 1 a c b b And now we concatenate them by attaching the final state of the first NFA to the start state of the second. Ive numbered the states for convenience in solving the next problem: 4 3 2 a 8 7 c b 6 b 1 5 2. Give a deterministic version of the finite automaton, using the construction we de- scribed in class. Provide both the graphical representation of the automaton as well as the state transition diagram. Answer: 2 We will build the DFA using the subset construction. Recall that every time we see a -transition, we will split our pointer and have one pointer take the transition...
View Full Document

This note was uploaded on 02/19/2012 for the course ECE 468 taught by Professor Test during the Fall '08 term at Purdue University-West Lafayette.

Page1 / 4

ps2-sol - ECE 468 Problem Set 2: Regular expressions and...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online