Professional Documents
Culture Documents
Mock Midterm 1
CS 373: Formal Models of Computation
Fall 2009
Name:
Netid:
• Print your name and netid, neatly in the space provided above; print your name at the upper
right corner of every page. Please print legibly.
• This is a closed book exam. No notes, books, dictionaries, calculators, or laptops are permitted.
• You are free to cite and use any theorems from class or homeworks without having to prove
them again.
• Write your answers in the space provided for the corresponding problem. Let us know if you
need more paper.
• Suggestions: Read through the entire exam first before starting work. Do not spend too much
time on any single problem. If you get stuck, move on to something else and come back later.
• If you run short on time, remember that partial credit will be given.
(a) Consider the complement Ac of a nonregular language A. Can we always conclude that
Ac is nonregular? (4 points)
(b) Is it true that every subset of a regular language is regular? (4 points)
(c) Is {0500n 1500n | n ≥ 0} a regular language? (4 points)
(d) If r and s are regular expressions, then does (r ∪ s)∗ = r∗ ∪ s∗ ∪ (rs)∗ hold? (4 points)
(e) Given a DFA M of size n (the number of states) that accepts some string of length at
least n, is it possible for L(M ) to be fininte? (4 points)
CS 373 Mock Midterm 1 – Fall 2009 3 Name:
CS 373 Mock Midterm 1 – Fall 2009 4 Name:
q1
a
q0 q2
b
CS 373 Mock Midterm 1 – Fall 2009 7 Name:
CS 373 Mock Midterm 1 – Fall 2009 8 Name:
0,1
1
q5
q1
0 1
0,1
1
0
q0 q3 q4
0 1
0
q2
CS 373 Mock Midterm 1 – Fall 2009 11 Name:
CS 373 Mock Midterm 1 – Fall 2009 12 Name: