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

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

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.

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

View Full Document
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.
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 4

Hmk5sol - COT 3100 Homework 5 Solutions Spring 2000 1 Give...

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

View Full Document
Ask a homework question - tutors are online