COMP 412
Fall 2008
Homework 1 Due Monday, September 22, 2008
This homework exercise is intended to give you practice in creating and manipulating
both regular expressions and finite automata.
As an optional warmup exercise, you should do Exercise 2.3.1 in the textbook (page
727). Do not include it on the paper you submit for your homework. It is practice to
make you more comfortable writing regular expressions.
To submit as homework, do the following problems:
1. Derive a regular expression for the set of strings that consist of lower-case alphabetic
characters, with the constraint that each string has exactly two vowels. (For this
problem, the letter y is a consonant.)
You can use the abbreviation CONS for the regular expression
[ b | c | d | f | g | h | j | k | l | m | n | p | q | r | s | t | v | w | x | y | z ]
Now, derive a second regular expression for the set of strings that consist of lower-
case alphabetic characters, with the constraint that each string has exactly two distinct
vowels.
2. Consider the following regular expression
ae | ai | ao | au | ea | ei | eo | eu
a. Derive an NFA from this regular expression using Thompson’s construction
b. Convert the NFA to a DFA using the subset construction
c. Minimize the number of states in the DFA using Hopcroft’s algorithm