CSE 355
Theory of Computing
ID: ___________
Fall 2010 - Colbourn
Midterm # 1
Page 2 of 6
Question 1.
[15 marks total]
Consider the language L over {a,b} in which every b is immediately
preceded
by at least
two consecutive a’s.
(a)
[5 marks] Give an NFA-
λ
for L.
(Q,
Σ
,
δ
,q0,F) with Q ={q0,q1,q2};
Σ
= {a,b}, F = {q0,q1,q2}, and
δ
defined by
δ
(q0,a) =
{q0,q1},
δ
(q1,a) = {q2}, and
δ
(q2,b) = {q0}
(b)
[5 marks] Using the algorithm developed in class, from the NFA-
λ
, form a regular
expression for L. (Describe briefly the steps that you follow.)
I make the machine above have only one accept state by adding a new state q3 with transitions
δ
(q0,
λ
) = {q3},
δ
(q1,
λ
) = {q3},
δ
(q2,
λ
) = {q3}, and then change the accepting states to F =
{q3}.
Then I use the algorithm from class to remove states q1 and q2 to get (a