Computer Science 456/656 -- Spring 1998 -- Midterm February 18, 1998
Name:
No books, notes, or scratch paper. Use pen or pencil, any color.
Use the rest of this page and the backs of the pages for scratch paper.
If you need more scratch paper, it will be provided.
The entire test is 150 points.}
-
True or False. [5 points each]
-
The intersection of any two regular languages is regular.
-
If L is any regular language, define PREF(L) to be the set of
all prefixes of strings in L. (A prefix of a string w is a substring
consisting of the first k symbols of w, for some k.) Then
PREF(L) is regular.
-
Every subset of a regular language is regular.
-
If h is a homomorphism Sigma --> Gamma*, and if L is a language
over Sigma such that h(L) is regular, then L must be regular.
-
Let M be a finite state machine with both input and output, where the
input alphabet is Sigma and the output alphabet is Gamma.
Let L be a regular language over Sigma, and let M(L) be the
language over Gamma consisting of all possible output strings providing
the input string is in L. Then M(L) must be regular.
-
Give a definition of each of the following terms.
Giving an example does not help.
[10 points each]
-
Deterministic, as in "deterministic machine." No more than 10 words.
-
The Kleene closure of a language.
-
Regular set of natural numbers.
-
Pigeonhole principle.
-
[15 points]
Draw an NFA which accepts the language
over {0,1} described by the regular expression
(0+1)*(00101+0110+11011)(0+1)*
-
[20 points]
State the pumping lemma for regular languages.
-
[20 points]Construct the unique minimal DFA equivalent to the NFA drawn here.
(Missing diagram)
-
[30 points]
You learned in class that the language {a^nb^n | n >= 0}
is not regular. Using this fact, and other facts you have learned,
prove that the language over {0,1} consisting of all strings
which have exactly
twice as many 0's as 1's (such as the strings 001, 010,
101100000, for example) is not regular. (Hint: do not try to use
the Pumping Lemma.)