CS150 HW2
Set April 15
Due April 27 (at 3pm)
Total: 75 pts
Q1 [15 pts] Consider the following e-NFA with 3 states p, q and r:
|| e | a | b | c
=======================================
-> p || {q,r} | {} | {r} | {q}
q || {} | {p} | {p,q} | {r}
*r || {} | {} | {} | {}
(a) Compute the e-closure of each state.
(b) Give all strings of lengths three or less accepted by the automaton.
(c) Convert the automaton to a DFA.
Q2 [10 pts] Write a regular expression for the following language:
The set of all binary strings whose number of 1's is divisible by five.
E.g., 0111110, 01101110 and 11001101101110010 are accepted but
00000111, 00110011011, 0000011100000 are not.
Q3 [10 pts] P. 107 in HMU (or P. 106 in 2nd edition) Ex.3.2.3
Convert the following DFA to a regular expression, ...
For the convenience of grading, please eliminate states in
the order q,r,s.
Again, please be careful with the page and exercise numbers if you are
using an international edition of the book!!!
Q4 [20 pts] P. 108 in HMU (or P. 107 in 2nd edition) Ex.3.2.6: c), d)
You may describe the languages using a combination of plain English
and mathematics notations (such as set notations). Please also
consult the answers for parts a) and b) available on the textbook
homepage: http://www-db.stanford.edu/~ullman/ialc.html
Q5 [20 pts] P. 121-122 in HMU (or P. 120-121 in 2nd ed) Ex.3.4.1: c), d)
You may use the test technique in Section 3.4.7 (also see the
sample solution for part a) on the textbook homepage), or the general
proof technique used in the proof of Theorem 3.11.