CSI 409: DFA Design Problems Some Answers and Hints

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

CSI 409: DFA design problems

Some answers and hints

1. Disprove the following: A ◦ (B ∩ C) = (A ◦ B) ∩ (A ◦ C) for all languages A, B, C.

Take A = {, a}, B = {}, C = {a}.

2. Disprove the following: for all languages A, B


A ( B → A∗ ( B ∗

Take A = {a} and B = {, a}.

3. Construct deterministic finite automata (DFAs) recognizing the following languages over the
alphabet {a, b}:

(a) {ai bj | i ≥ 0, j ≥ 0, i + j is an even number}

0 1

b b
b

2 3
b

a a

a,b
(b) The set of all strings that begin with a but do not contain aab as a substring.

a
b a

a a
0 1 2

b b

a, b

(c) (ab)∗ ∪ a

a b a
0 1 2 3

b a b a

a, b

2
(d) b(aa)∗

b
1 2 4

a b b

a, b

4. Consider the language a∗ b ∪ b∗ over the alphabet {a, b}. Show that any DFA that accepts
this language has to contain a dead state.

No string that has ba as a prefix is in the language.

You might also like