ToC - Sheet 3
ToC - Sheet 3
Directions for Question 4 and 5: Consider the following NFA with E moves.
4. If the given NFA is converted to NFA without E -moves, which of the following denotes the set
of final states?
(a) {q2} (b) {q1, q2}
(c) { q0, q1, q2} (d) Can't be determined
5. Which of the following strings will not be accepted by the given NFA?
(a) 00 11 22 (b) 11 22
(c) 21 (d) 22
6. Which of the following regular expression corresponds to the language of all strings over the
alphabet {a, b} that do not end with ab?
(a) (a + b)* (aa + ba + bb)
(b) (a + b)* (aa + ba + bb) + a + b + ϵ
(c) b* ab* a
(d) b* aa b*
10. The given transition table is for the FSM that accepts a string if it ends with ' aa' .
Which is the final state?
S a b
Start q0 q2
q0 q1 q2
ql q1 q2
q2 q0 q2
(a) q0 (b) q1
(c) q2 (d) Can't be determined
4) For each of the following expressions E, answer the following three questions and
prove your answer:
i) Is E a regular expression?
ii) If E is a regular expression, give a simpler regular expression.
iii) Does E describe a regular language?
a) ((a ∪ b) ∪ (ab))*.
b) (a+ anbn).
c) ((ab)* ∅).
d) (((ab) ∪ c)* ∩ (b ∪ c*)).
e) (∅* ∪ (bb*)).
6) let L = {w ∈ {1, 2}* : for all prefixes p of w, if |p| > 0 and |p| is even, then the last
character of p is 1}.
a) Write a regular expression for L.
b) Show an FSM that accepts L.
Indicate, for each of the following regular expressions, whether it correctly describes L:
a) (a ∪ ba)bb*a.
b) (ε ∪ b)a(bb*a)*.
c) ba∪ ab*a.
d) (a ∪ ba)(bb*a)*.
The first printing of the book has two mistakes in this figure: The transition from q2 back to q0 should be
labeled a, and state q3 should not be accepting. We’ll give answers for the printed version (in which we’ll
simply ignore the unlabeled transition from q2 to q0) and the correct version.
a) Show a regular expression for L(M).
b) Describe L(M) in English.
10) Show a possibly nondeterministic FSM to accept the language defined by each
of the following regular expressions:
a) (((a ∪ ba) b ∪ aa)*.
b) (b ∪ ε)(ab)*(a ∪ ε).
c) (babb* ∪ a)*.
d) (ba ∪ ((a ∪ bb) a*b)).
11) Show a DFSM to accept the language defined by each of the following regular
expressions:
a) (aba ∪ aabaa)*
b) (ab)*(aa)