quiz2f03-sol-post

quiz2f03-sol-post - well. Hint: what are the properties of...

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

View Full Document Right Arrow Icon
CS373 Quiz 2, ********* solution *********** 9/23/03 1) (20 points) For the given NFA give the equivalent DFA produced by the “subset” construction. Label the states of the DFA with the subsets or clusters of states from the NFA that they represent. Show your work. (10 points) Describe the language the NFA represents. Analysis: δ *(0,a) = {0,1}, δ *(0,b) = {0} δ *(1,a) = δ *(1,b) = {2} δ *(2,a) = δ *(2,b) = δ ({0}, a) = {0, 1}, δ ({0}, b) = {0} δ ({0,1}, a) = {0, 1} {2} = {0, 1, 2}, δ ({0,1}, b) = {0} {2} = {0, 2} δ ({0,1, 2}, a) = {0, 1} {2} = {0, 1} {2} = {0, 1, 2} δ ({0,1, 2}, b) = {0, 1} {2} = {0} {2} = {0, 2} The language of the NFA is L = {w : w ends in an aa or ab} 2) (25 points) Give an NFA accepting all binary strings that represent numbers divisible by 4. Leading 0s are allowed. For convenience, accept the empty string as
Background image of page 1

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

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

Unformatted text preview: well. Hint: what are the properties of binary numbers that are multiples of 4? 3) (25 points) Give a DFA accepting all binary strings that represent numbers divisible by 5. Leading 0s are allowed. For convenience, accept the empty string as well. a b {0} {0,1} {0} {0,1} {0,1,2} {0,2} {0,2} {0,1} {0} {0,1,2} {0,1,2} {0,2} 1 1 1 1 1 a,b 1 2 a a,b {0} {0,1} {0,2} {0,1,2} a a a a b b b b 4) (20 points, 5 points per part) Given the DFA: Given the DFA N above, answer the following questions: a) Draw the transition graph for N. b) = ) 1 , C ( A c) *(B, 1100) = A d) Is 11100 L(N) ? No, *(A, 11100) {B} e) (Extra credit worth 5/100 points) Briefly describe L(N). L(N) = {x | (# of 1s in x) mod 3 = 1} 1 A A B B B C C C A start final A B C 1 1 1...
View Full Document

Page1 / 2

quiz2f03-sol-post - well. Hint: what are the properties of...

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