This preview shows pages 1–2. Sign up to view the full content.
Homework #10:
Regular expressions, FSA and regular languages
This homework consists of five sections (A
–
E). Answers must be typed (no exceptions) and are due in
class on
Thursday, May 1
. You may draw the FSA by hand, but make sure they are legible. Note that
honors students have a different assignment, see end of sheet.
A. Regular expressions (24 points)
Write regular expressions for the following cases. Make sure you account for all eventualities. Assume
that the alphabet is {a, b, c,
…
, z}.
1.
Match the string
flea
2.
Match either the string
flea
or the string
dog
3.
Match either the string
flea
or either the string
dog
or
cat
4.
Match any string starting with
d
, then two symbols that can be anything, then another
d
5.
Match any string containing at least one
a
6.
Match any string containing at least one
a
and two
b
’s
in that order
B. FSA (30 points)
Write Finite State Automata for each of the six regular expressions under A. Assume that each transition
input can only be one symbol (like
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
This is the end of the preview. Sign up
to
access the rest of the document.
 Spring '07
 Walker

Click to edit the document details