{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

quiz2f03-sol-post

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

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

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

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

View Full Document
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

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern