CS 373 – Fall 2003 – NMG
****** SOLUTION ******************
September 11, 2003, updated 9/18/03 – P10 corrected
Homework Assignment 2
Due 9/19/03 (Friday)
at the end of class
Problems related to chapter 2
:
You are advised to study related exercises if solutions are given in the back of the book (3
rd
edition).
In all problems below, if an NFA is requested, the resulting NFA must have some non-
deterministic element.
All problems are 10 points each.
P1
Consider the “mystery” automata below.
Give a reasonably simple explanation of the
language it recognizes.
Simply sketching a graph for this automata is not an acceptable answer.
M = ({s, q, p, f}, {a, b},
δ
, s, f )
where
δ
is given by:
δ
(s, a) = q
δ
(s, b) = p
δ
(q, a) = f
δ
(q, b) = q
δ
(p, a) = p
δ
(p, b) = p
δ
(f, a) = q
δ
(f, b) = f
Answer:
The graph for this automata (not acceptable for an answer) is:
L = { (ab
n
ab
m
)
p
:
n, m
≥
0, p > 0 }, where
∑
= {a, b}
Some students may use a regular expression: (ab*ab*)
+
or some equivalent.
P2