
ECE 537 - Foundations of Computing
Prof. Sen
Homework #2
Due: Thursday, September 6, 2007 in class
1. Draw the diagram of a DFA that can recognize these languages over the alphabet Σ = {a, b}:
(a) L={a∗b∗a∗}
(b) L={w|whas at least three a’s and at least two b’s }
(c) L={w|whas an even length and an odd number of a’s }
(d) L= Σ∗−a∗b∗, which are the strings not in a∗b∗
(e) L={w|every odd position is an a}
2. Let Bn={ak|where kis a multiple of n}. Show that for each n≥1, the language Bnis regular.
3. Suppose you have the “reverse” language LRthat is defined as follows LR={w|wR∈L},
where wRis defined as the symbols of the string in reverse order and Lis a regular language. For
example, if w= 01011 then wR= 11010. Is LRa regular language? Show why or why not.
4. Given language Lover alphabet Σ = {0,1}such that L={w|wcontains equal number of “01”
and “10”}. For example 101 ∈Lbecause there is one “10” and one “01”, but 1010 is not (there
are two “10” and only one “01”). Is La regular language? Show why or why not.
5. Prove that NFA’s can be exponentially smaller in size than DFA’s by giving a family of languages
Lkthat can be recognized with an NFA of kstates but need a minimal DFA of Ω(2k)states.
6. Suppose we modify the NFA definition so that it accepts only if all the computation paths yield
an accept answer. Show that this new NFA recognizes exactly the regular languages by demon-
strating how to convert the new NFA into a DFA that recognizes the same language.
7. We showed that a DFA can be modified to accept the complement of a language Lby simply
swapping its accepting and non-accepting states. Show by example that this is not true for NFA’s.
8. Give two proofs (one using the pumping lemma and the other equivalence classes), that the
language L={a2n|n∈N}={a, aa, aaaa, aaaaaaaa}is not regular.
9. For a regular language Ldefine L1
2={x|xy ∈L, such that |y|=|x|}. In other words, L1
2is
the first half of the words in L, so for every x∈L1
2, there exists a string ysuch that xy ∈L.
Prove that L1
2regular.
10. What are the equivalence classes of language Lover alphabet Σ = {a, b}, where L={w|w
contains the substring aba }? Use these classes to draw the minimal DFA for L.
1