CSCE 531 Spring 2002
FINAL EXAMCorrection Guide
Wednesday 02/5/7Closed Book
The sum of all points is 180, but the maximum number of points attainable
is 170.
1
Short Questions1 point each; 14 points total
1. What is the dierence between a translator and a
1. (10 points) Using the method in class or in the text, construct an NFA
equivalent to the following regular expression:
[+-]?[012]+
ANSWER: There are many acceptable answers. Here is one (blank
entries denote the empty set ):
+
q0
q1
q2
q3
q4
q5
q6
q7
CSCE 531, Spring 2015
Midterm Exam Answer Key
1. Using the method described in the book or in class, convert the following regular expression into an
equivalent (nondeterministic) finite automaton:
(c(a|b)c)*
Answer: Here is one possible correct answer:
a
CSCE 531, Spring 2015
Final Exam Answer Key
1. (40 points total) Consider the following grammar with start symbol S 0 :
S0 S
S aSb
S T
T
Ta
T
cS
T
(a) (10 points) Find FIRST(S), FIRST(T ), FOLLOW(S), and FOLLOW(T ). You need not
justify your answer.
(