Professional Documents
Culture Documents
2. Give DFA’s accepting the following languages over the alphabet {0, 1}.
3. Give a DFA which accepts the following language over the alphabet {0, 1}: The set of
all strings beginning with a 1 that, when interpreted as a binary integer, is a multiple of
5. For example, strings 101, 1010, and 1111 are in the language, and 0, 100, and 111 are
not. [1, Ex. 2.2.6a]
4. Let A = (Q, Σ, δ, q0 , {qf }) be a DFA, and suppose that for all a in Σ we have δ(q0 , a) =
δ(qf , a).
0 1
→A A B
∗B B A
Informally describe the language accepted by the DFA, and prove by induction on the
length of an input string that your description is correct. Hint: When setting up the
inductive hypothesis, it is wise to make a statement about what inputs get you to each
state, not just what inputs get you to the accepting state. [1, Ex. 2.2.10]
Page 1 of 3
6. The following language is the intersection of two simpler languages:
Construct the DFAs for the two simpler languages, then combine them using the product
construction discussed in lectures to obtain the DFA for the given language. [2, Ex.
1.4b]
{w : w has an even number of a’s and each a is followed by at least one b}.
Construct the DFAs for the two simpler languages, then combine them using the product
construction discussed in lectures to obtain the DFA for the given language. [2, Ex.
1.4d]
Construct the DFA for the simpler language, and then modify it to obtain a DFA for the
given language. Hint: Replace the set of states F by its complement Q − F to obtain a
machine for the complement language. [2, Ex. 1.5a]
Construct the DFA for the simpler language, and then modify it to obtain a DFA for the
given language. Hint: Replace the set of states F by its complement Q − F to obtain a
machine for the complement language. [2, Ex. 1.5b]
0 1
→p {p, q} {p}
q {r} {r}
r {s} φ
∗s {s} {s}
2. Give a nondeterministic finite automaton to accept the following language: the set of
strings over alphabet {0, 1, . . . , 9} such that the final digit has appeared before. [1, Ex.
2.3.4a]
Page 2 of 3
3. Design an NFA to accept the set of all strings ending in abc, abd or aacd. Assume the
alphabet is {a, b, c, d}. [1, Ex. 2.4.4a]
4. Design an NFA to accept the language {abc, abd, aacd}. Assume the alphabet is {a, b, c, d}.
a b c
→p φ {p} {q} {r}
q {p} {q} {r} φ
∗r {q} {r} φ {p}
7. Prove that every NFA can be converted to an equivalent one that has a single accept
state. [2, Ex. 1.11]
References
[1] J. E. Hopcroft, R. Motwani and J. D. Ullman, “Introduction to Automata Theory, Lan-
guages, and Computation”, 3rd Edition, Pearson Education India, 2008.
[2] M. Sipser, “Introduction to the Theory of Computation”, 3rd Edition, Cengage, 2014.
Page 3 of 3