Hmk5sol

Hmk5sol - COT 3100 Homework # 5 Solutions Spring 2000 1)...

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

View Full Document Right Arrow Icon
COT 3100 Homework # 5 Solutions Spring 2000 1) Give regular expressions for each of the following languages: (Note: each language is over the alphabet L = {a,b} Note: there are many other correct answers for each of these. a) The language of all strings containing at least one a and one b. (aa*b U bb*a)(a U b)* b) The language of all strings of length 2. (a U b)(a U b)(a U b)* c) The language of all strings with exactly 4 a’s. b*ab*ab*ab*ab* d) The set of all strings where contiguous letters are ALWAYS different. (ab)*a U (ba)*b U (ab)* U (ba)* 2) Create a DFA to recognize the following languages over the alphabet L = {a,b}. a) The language of all strings of even length. Let your states be s1 and s2. Let s1 be a start state. Let s1 be the only final state. Let both transitions from s1 go to s2, and both transitions from s2 go to s1.
Background image of page 1

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

View Full DocumentRight Arrow Icon
b) The language of all strings that contain exactly 3n a’s where n is an integer. Let your states be s1, s2, and s3. Let s1 be the start state.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 4

Hmk5sol - COT 3100 Homework # 5 Solutions Spring 2000 1)...

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

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