This Study Resource Was: King Saud University College of Computer and Information Sciences Computer Science Department
This Study Resource Was: King Saud University College of Computer and Information Sciences Computer Science Department
Assignment 2
m
e r as
Exercise 1: (30=20+10)
co
Consider the following NFA, M=(K,∑ ,Δ , s, F) where K={A, B, C, D}, ∑={0,1}, s=A, F={A} and Δ
eH w
given by the following transition relation { (A, 0, B), (A, 0, C), (B, 1, A), (C, 1, D), (D, 0, A)}.
o.
1. Use the subset construction algorithm to produce an equivalent DFA. Explicit all the
calculation steps.
rs e
ou urc
2. Give the Regular Expression that generates L(M)
o
Solution:
aC s
1.
v i y re
ed d
ar stu
sh is
Th
2. (01 + 010)*
Exercise 2: (25=20+5)
Considerer the following Regular Expression R:
(ab + aba)*
1. Use the conversion algorithm from a regular expression to a DFA to generate the DFA
that accepts L(R). Explicit clearly the application of the algorithm.
https://www.coursehero.com/file/14281576/Solutions-assignment-2/
2. Compare this DFA with the one obtained in exercise 1.
Solution
m
e r as
co
eH w
o.
rs e
ou urc
o
aC s
v i y re
ed d
Exercise 3: (20)
ar stu
Solution:
https://www.coursehero.com/file/14281576/Solutions-assignment-2/
m
e r as
co
eH w
o.
rs e
ou urc
o
aC s
v i y re
ed d
ar stu
sh is
Th
https://www.coursehero.com/file/14281576/Solutions-assignment-2/
Exercise 4: (25=20+5)
Consider the NFA obtained in exercise 3:
1. Apply on it the subset construction algorithm to obtain the equivalent DFA.
2. Compare this DFA with the ones obtained in exercises 1 and 2.
m
e r as
co
eH w
o.
rs e
ou urc
o
aC s
v i y re
ed d
ar stu
sh is
Th
https://www.coursehero.com/file/14281576/Solutions-assignment-2/