ECE 537 Homework 2: Foundations of Computing - Recognizing Regular Languages, Assignments of Electrical and Electronics Engineering

Professor sen's ece 537 - foundations of computing homework assignment, due on september 6, 2007. The assignment includes various problems related to recognizing regular languages using finite automata, such as drawing diagrams of dfas, showing regularity of certain languages, and proving properties of nfas and dfas.

Typology: Assignments

Pre 2010

Uploaded on 07/23/2009

koofers-user-m4l
koofers-user-m4l 🇺🇸

9 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
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={aba}
(b) L={w|whas at least three a’s and at least two bs }
(c) L={w|whas an even length and an odd number of as }
(d) L= Σab, which are the strings not in ab
(e) L={w|every odd position is an a}
2. Let Bn={ak|where kis a multiple of n}. Show that for each n1, the language Bnis regular.
3. Suppose you have the “reverse” language LRthat is defined as follows LR={w|wRL},
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 NFAs can be exponentially smaller in size than DFAs 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 NFAs.
8. Give two proofs (one using the pumping lemma and the other equivalence classes), that the
language L={a2n|nN}={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 xL1
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

Partial preview of the text

Download ECE 537 Homework 2: Foundations of Computing - Recognizing Regular Languages and more Assignments Electrical and Electronics Engineering in PDF only on Docsity!

ECE 537 - Foundations of Computing Prof. Sen Homework # 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 | w has at least three a’s and at least two b’s } (c) L = {w | w has 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 }

  1. Let Bn = {ak^ | where k is a multiple of n}. Show that for each n ≥ 1 , the language Bn is regular.
  2. Suppose you have the “reverse” language LR^ that is defined as follows LR^ = {w | wR^ ∈ L}, where wR^ is defined as the symbols of the string in reverse order and L is a regular language. For example, if w = 01011 then wR^ = 11010. Is LR^ a regular language? Show why or why not.
  3. Given language L over alphabet Σ = { 0 , 1 } such that L = {w | w contains equal number of “01” and “10”}. For example 101 ∈ L because there is one “10” and one “01”, but 1010 is not (there are two “10” and only one “01”). Is L a regular language? Show why or why not.
  4. Prove that NFA’s can be exponentially smaller in size than DFA’s by giving a family of languages Lk that can be recognized with an NFA of k states but need a minimal DFA of Ω(2k) states.
  5. 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.
  6. We showed that a DFA can be modified to accept the complement of a language L by simply swapping its accepting and non-accepting states. Show by example that this is not true for NFA’s.
  7. Give two proofs (one using the pumping lemma and the other equivalence classes), that the language L = {a^2 n | n ∈ N} = {a, aa, aaaa, aaaaaaaa} is not regular.
  8. For a regular language L define L 12 = {x | xy ∈ L, such that |y| = |x|}. In other words, L 12 is the first half of the words in L, so for every x ∈ L 1 2 , there exists a string y such that xy ∈ L. Prove that L 12 regular.
  9. What are the equivalence classes of language L over alphabet Σ = {a, b}, where L = {w | w contains the substring aba }? Use these classes to draw the minimal DFA for L.