Automata Theory Exams
Automata Theory Exams
Automata Theory Exams
1 10
2 a 5
b 10 CS 341
3 10 First Midterm Exam
4 a 15 Practice
b 15
c 15
d 15 1. Use extra paper to determine your solutions then neatly transcribe
5 a 5 them (including intermediate steps) onto these sheets.
b 15 2. It’s possible that you won’t be able to finish. Read through the
c 15 whole exam once and start working on the problems you’re sure you
6 15 know how to do. Come back to the harder ones as you have time.
7 15
8 a 5
b 5
c 5
Total 175
(1) Consider the following problem: Given a database D and a query Q, what result is returned
when Q is executed against D?
(3) Show a (possibly nondeterministic) FSM that accepts {w ∈ {a, b}* : w contains at least one
instance of aaba, bbb or ababa}.
(4) For each of the following languages L, state whether it is regular or not and prove your answer.
(a) {x#y: x, y ∈ {0, 1}*, when viewed as binary numbers, x+y = 3y}. Example: 1000#100 ∈ L.
(b) Let Σ = {a, b}. L = {w ∈ Σ*: (w contains the substring ab) → (w contains the substring ba)}
(d){w = st : s ∈ {a, b}* and t ∈ {b, c}* and #b(s) = 2⋅#a(s) and #c(t) = 3⋅#b(t)}.
(5) Recall that maxstring(L) = {w: w ∈ L and ∀z∈Σ* (z ≠ ε → wz ∉ L)}.
(a) What is maxstring(L1L2), where L1 = {w ∈ {a, b}* : contains exactly one a} and L2 = {a}?
(b) Prove that the regular languages are closed under maxstring.
(6) Consider the following NDFSM M. Use ndfsmtodfsm to construct an equivalent DFSM. Begin
by showing the value of eps(q) for each state q:
1 ε,a 2 b 3 b 4 a 5
ε ε
a,b
(7) Define a decision procedure to answer the following question. You may use as subroutines all
the procedures that we have discussed in class. Let Σ = {a, b} and let α and β be regular
expressions. Is the following sentence true: