Question: Do 4 and 5. 1. Given the following regular expression over the alphabet (a, b}, (ba)*a + b(ab)* to transform it to a regular grammar,

 Do 4 and 5. 1. Given the following regular expression overthe alphabet (a, b}, (ba)*a + b(ab)* to transform it to aregular grammar, we first transform it to an NFA as the one

Do 4 and 5.

1. Given the following regular expression over the alphabet (a, b}, (ba)*a + b(ab)* to transform it to a regular grammar, we first transform it to an NFA as the one shown below. Instead of converting this NFA to a regular grammar directly, we convert it to a DFA first and then convert the DFA to a regular grammar (why?). So we construct A-closures of the above NFA, A(O) = {0,1,3} A(1) = {1,3} (2) = {2} A(3) = {3} (4) = {4,5,7) A(5) = {5,7) A(6) = {6} $(7) = {7} (0) = 0 and build the following tree, (3 points) A(0) = {0,1,3} {7} |(2, 4, 5, 7} k1,3, 6 0 b {7} {2,5,7) so that the following nodes of the tree can be used to build a DFA. Fill out the following blanks and blanks in the above tree. {0,1,3} {7} {2,4,5,7k1, 3, 6}| {2,5,7) 0 (2 points) 2. With the selected nodes from the above tree, we build a DFA by constructing the following transition table (the table on the left), and renaming the states as S (start state), I, J, K, L and M: (3.5 points) I a S {0,1,3} { Z 24.57 Fl {7} | 0 0 M F (2,4,5,7 (1.3.67| 0 M 1,3,6} {7} {2,5,7) F (2,5,7} {1,3,6) M M M Then convert the table representation to a digraph representation as follows. Fill out the blanks in the following digraph. (3 points) 3. However, we don't need the portion circled in the above digraph representation of the DFA (why?). By removing that portion, the DFA is like the one shown on the left side of the following figure. Sa b J-a ( 1 K - a (b By constructing production rules from this FA, we get the production set of the regular grammar on the right side of the above figure. Fill out the blanks in the above figure. (3 points) 4. Can the above FA be further simplified into a form like the one shown below (left hand side of the following figure), why or why not?. (2 points) S al NBL L aS | A Put your justification in the following blank. Note that the regular expression of the above NFA is (ba)*(a + b), equivalent to the regular expression given in Question #1. 5. Given the following regular grammar: 5 as | albK, bal, J Kaj, K ak bk A one can use the algorithm given in slide 21 of the notes "Regular Languages and Finite Automata-IV" to construct an NFA to recognize the language of that grammar. Fill out blanks in the following figure so that the resulting NDA would fulfill such a task, i.e., would recognize the language of the given grammar. (2 points) 818002

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!