Handout #61
CS103
June 2, 2010
Robert Plummer
Practice Final Solutions
FINITE AUTOMATA
1. (5 points)
Let L be the following language:
L = { w  w
{0, 1}* and the number of 0's in w is divisible by 2 and the number of 1's
in w is divisible by 3} .
Draw a state diagram for a DFA whose language is L.
2. (5 points)
Draw a state diagram for an NFA over {0, 1}that accepts strings that consist of either
01 followed by 01 repeated zero or more times or
010 followed by 010 repeated zero or more times.
For example, acceptable strings would include 01, 010101, and 010010.
0
0
0
0
0
0
1
1
1
1
1
1
0
1
0
1
0
0
0
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document2
REGULAR EXPRESSIONS and REGULAR LANGUAGES
3. (15 points)
There are three parts to this question.
Let A = (Q,
,
, , {q
f
}} be an NFA such that there are no transitions into q
0
and no
transitions out of q
f
.
Decsribe the language accepted by each of the following
modifications of A, in terms of L = L(A):
(a) The automaton constructed from A by adding an
transition from q
f
to q
0
.
LL*, which is L
+
.
(b) The automaton constructed from A by adding an
transition from q
0
to every state
reachable from q
0
(along a path whose labels may include symbols from
as well as
).
The set of suffixes of strings in L.
(c) The automaton constructed from A by adding an
This is the end of the preview.
Sign up
to
access the rest of the document.
 Fall '09
 Formal language, Regular expression, leftmost tape cell

Click to edit the document details