COMS W3261
Computer Science Theory
Lecture 3: September 12, 2012
Finite Automata

Outline

1. Review

2. Deterministic Finite Automata

3. Example DFA for 0*10*

4. Example DFA for Binary Numbers Divisible by 3

5. Nondeterministic Finite Automata

6. Equivalence of DFAs and NFAs: the Subset Construction

7. Bad Case for the Subset Construction

8. Practice Problems

  1. Construct a DFA for a light switch.
  2. 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.
    3. Construct a regular expression for L.
  3. Let L be the language { abxba | x is any string of a's, b's, and c's not containing ba }. 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. Construct a regular expression for L.
    4. Show how your regular expression generates ababcba.
  4. Construct a DFA for the language L((a+b)*abba(a+b)*).
  5. Let L be the language consisting of all strings of a's and b's having an even number of a's and an even number of b's.
    1. Construct a DFA for L.
    2. Show the behavior of your DFA processing the input string abbaabab.
    3. Construct a regular expression for L.
    4. Show how your regular expression generates abbaabab.
  6. 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.
    3. Construct an NFA that accepts (a+b)*a(a+b)(a+b).
    4. Use the subset construction to convert your NFA into an equivalent DFA.

9. Reading Assignment



aho@cs.columbia.edu