SUNY Geneseo, Department of Computer Science
CSci 342, Fall 2001
Prof. Doug Baldwin
General Directions: This is an open-book, open-notes, closed-neighbor test. You have until the end of class to complete it. Each question is marked with a value in points, for a total of 50 points. There are as many points on the test as minutes in the class period, so you can use point values to tell how long its worth spending on each question. Put your answer to each question in the space provided. Be sure to Show Your Work! Partial credit will be given for incorrect answers if you show correct steps leading up to them. Conversely, full credit will not be given for correct answers if it isnt clear how you got them. Good luck.
This exam contains 4 questions on 3 pages.
(15 Points).
Design a finite automaton (either deterministic or non-deterministic) that accepts all and only strings of the form anbmc(n+m) mod 3.
(20 Points).
Show that Kleene * can be replaced by Kleene + (meaning one or more) in the definition of regular expression without weakening the expressive power of the expressions.
More formally, change the definition of regular expression over alphabet Sigma to be
Show that for every standard regular expression, there is an equivalent regular expression of the new sort that describes the same language.
(10 Points).
Consider the Latin alphabet (i.e., the letters A through Z and their lower-case equivalents), and the language over it consisting of all strings of the form wW where string W is the upper-case equivalent of string w. For example, abcdABCD and xyzXYZ are in this language, whereas xyzABC and PqRs are not. Show that this language is not regular.
(5 Points).
Does the following NFA accept the string aabb? Briefly explain your answer.
