COMS W3261 CS Theory
Lecture 3: Regular Expressions

1. Nondeterministic Finite Automata with Epsilon-Transitions

2. Converting an ε-NFA to an Equivalent DFA Using the Subset Construction

3. Regular Expressions

4. POSIX Regular Expressions

5. A detailed proof that a DFA defines a given language

6. Practice Problems

  1. Construct an epsilon-NFA that accepts all strings of a's and b's ending in abb or in baa.
    1. Show all sequences of moves that your NFA can make on the input string ababb.
    2. Use the subset construction to convert your epsilon-NFA into an equivalent DFA.
  2. Do the two regular expressions (a+b)* and (a*b*)* denote the same language?
  3. Write a Kleene regular expression for all strings of 0's and 1's with an even number of 0's and an even number of 1's.
  4. 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 regular expression for L.
    2. Explain how your regular expression defines the string abcbaba.
  5. Write a Kleene regular expression for all strings of a's and b's that begin and end with an a.
  6. Write a POSIX regular expression that matches all English words ending with the substring dous.
  7. Write a POSIX regular expression that matches all English words with the five vowels a, e, i, o, u in order. All five vowels have to appear in order but they do not have to be next to one another. (Example: facetious.) Note that vowels can be repeated. (Example: sacrilegious.)

7. References



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