Regular Expressions Help Center

Learn more

Warning: The hard deadline has passed. You can attempt it, but you will not get credit for it. You are welcome to try it as a learning exercise.

To specify an array or sequence of values in an answer, separate the values in
the sequence by whitespace. For example, if the question asks for the first
ten powers of two (starting at 1), then the following answer is acceptable:

1 2 4 8 16 32 64 128 256 512

If you wish to discuss a particular question and answer in the forums, please
post the entire question and answer, including the seed (which can be used by
the course staff to uniquely identify the question) and the explanation (which
contains the correct answer).

Question 1

(seed = 262475)
Consider the NFA for the regular expression

( ( ( A * B ) | C ) * A )

with match transitions

0 1 2 3 4 5 6 7 8 9 10 11 12 13
(() (() (() (A)----->(*) (B)----->()) (|) (C)----->()) (*) (A)----->()) ( )


and epsilon transitions

0->1
1->10
1->8
1->2
2->3
3->4
4->5
4->3
6->7
7->9
9->10
10->11
10->1
12->13


Give the set of states (in ascending order) that the NFA could be in after reading
the following sequence of 6 characters:

B B A B C A

Question 2

(seed = 797827)
Compute the NFA that corresponds to the following regular expression using
the NFA construction algorithm described in lecture and in the textbook:

( B ( A | ( D C * ) ) * )

Here are the match transitions:

0 1 2 3 4 5 6 7 8 9 10 11 12 13
(() (B)----->(() (A)----->(|) (() (D)----->(C)----->(*) ()) ()) (*) ()) ( )


Which of the following are edges in the epsilon-transition digraph?
    
You cannot submit your work until you agree to the Honor Code. Thanks!