hw2_solution

hw2_solution - CS150 Assignment 2 Solutions by Bob Problem...

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

View Full Document Right Arrow Icon
Solutions by Bob Problem 1. (Exercise 2.5.2) Consider the following ² -NFA. ² a b c p { q,r } { q } { r } q { p } { r } { p,q } * r (a) Compute the ² -closure of each state. (b) Give all the strings of length three or less accepted by the automaton. (c) Convert the automaton to a DFA. (a) eclose ( p ) = { p,q,r } eclose ( q ) = { q } eclose ( r ) = { r } (b) First we check ²,a,b,c and they’re all accepted. In addition, we have p ˆ δ ( p,a ) and p ˆ δ ( p,c ) which means if the first bit is a or c , we can choose to go back to start state and start over. Hence, a ( a + b + c ) and c ( a + b + c ) are all accepted. Now we check ba,bb,bc and they’re all accepted. Now we know ( a + b + c )( a + b + c ) (all strings of length 2) are all accepted. For the same reason as above, we have a ( a + b + c )( a + b + c ) and c ( a + b + c )( a + b + c ) be accepted. However, there are no ways to accept
Background image of page 1

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

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

Page1 / 7

hw2_solution - CS150 Assignment 2 Solutions by Bob Problem...

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

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