COMS W3261 CS Theory
Lecture 2: Finite Automata and Regular Languages

1. The Chomsky Hierarchy of Classes of Languages

2. Deterministic Finite Automata

3. Example 1: DFA for Binary Strings with an Even Number of 0's

4. Example 2: DFA for Binary Numbers Divisible by 3

5. Nondeterministic Finite Automata

6. Equivalence of DFA's and NFA's: the Subset Construction

7. A Bad Case for the Subset Construction

8. Practice Problems

  1. Let L be the language { w | w is any string of a's and b's containing at least one a and at least one b }.
    1. Construct a DFA for L.
    2. Show the behavior of your DFA processing the input string aabaa.
  2. Let L be the language { abxba | x is any string of a's, b's, and c's not containing the substring ba } over the alphabet {a, b, c}. This language models comments in the programming language C.
    1. Construct a DFA for L.
    2. Show the behavior of your DFA processing the input string abcbaba.
  3. Let L be the language consisting of all strings of a's and b's containing the substring abba. Construct a DFA for L.
  4. Let L be the language consisting of all strings of 0's and 1's having an even number of 0's and an even number of 1's.
    1. Construct a DFA for L.
    2. Show the behavior of your DFA processing the input string 01100101.
    3. Prove that your DFA is correct.
  5. Construct an NFA that accepts all strings of a's and b's ending in abb.
    1. Show all sequences of moves that your NFA can make on the input string ababb.
    2. Use the subset construction to convert your NFA into an equivalent DFA.
  6. Construct an NFA that accepts all strings of a's and b's in which the third last character is an a.
    1. Use the subset construction to convert your NFA into an equivalent DFA.
    2. Prove that any DFA recognizing this language must have at least eight states.
  7. Prove that the DFA in section 3 above accepts a string w iff w has an even number of 0's.
  8. Prove that the DFA in section 4 above accepts a binary string w iff w represents an integer divisible by three.

9. Reading


aho@cs.columbia.edu
verma@cs.columbia.edu