Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 1. Eliminate all  -transitions from the following FA without changing the number of states and the language accepted by the automaton. You should also.

Similar presentations


Presentation on theme: "1 1. Eliminate all  -transitions from the following FA without changing the number of states and the language accepted by the automaton. You should also."— Presentation transcript:

1 1 1. Eliminate all  -transitions from the following FA without changing the number of states and the language accepted by the automaton. You should also clearly show how (i.e., the procedure) you found your answer. Key to Homework #5 (Models of Computation, Spring, 2001) 5 4 1 3 start a,b b  a b  b  2 Answer: For each state i and input symbol t  {a, b}, we find the reachable state set  (i, t) in the new FA by computing  (i,  *t  *) in the given FA. The results are as follows.  (1, a) = {1},  (1, b) = {1, 2},  (2, a) = {4, 5},  (2, b) = {1, 3, 4, 5},  (3, a) = {1, 3, 4, 5},  (3, b) = {1, 2, 3, 4, 5},  (4, a) = {1, 3, 4, 5},  (4, b) = {1, 3, 4, 5},  (5, a) = {1, 3, 4, 5},  (5, b) = {1, 3, 4, 5} 5 4 1 3 start a,b b b 2 b b

2 2 2. Using the technique discussed in the class, construct a regular grammar which generates the same language that is recognized by the FA in problem 1 above. You should show how you got your answer. D C S B start a,b b  a b  b  A Answer: S  aS | bS | bA A  aC | bB |  B  S | C C  bC | D D  aB | bB | 

3 3 3. Find a regular expression which denotes the language accepted by the FA in problem 1 above. You should also clearly show the procedure that you took to get your answer. 5 4 1 3 start a,b b  a b  b  2 Change edge labels to regular expression, and eliminate states 3. Eliminate state 4 b 5 4 1 start a+b b  2 b 5 1 start a+b b 2 b (a+b)b * a+b Change state 2 to non-accepting state And eliminate it. 5 1 start a+b+bb b(a+b)b * (a+b)b * a+b Change state 5 to non-accepting state and eliminate it. 1 start a+b b 2 b+(a+b)b * ((a+b)b * ) * (a+b) Regular expression denoting the language: (1) accepted by state 5: r 5 = (a+b+bb) * b(a+b)b * ((a+b)b * +(a+b)(a+b+bb) * b(a+b)b * ) * (2) accepted by state 2: r 2 = (a+b)*b((b+(a+b)b * ((a+b)b * ) * (a+b))(a+b) * b) * (3) Accepted by the automaton: r = r 5 + r 2 Answer:

4 4 4. Construct an FA (either DFA or NFA whichever for your convenience) which recognizes the language of the following regular grammar. Your answer should clearly show how you got your answer. S  abS | cC A  aS | B | a B  aA |  C  aB | abc S B C A start a bc a a b c a a  Answer: a

5 5 5. (a) Construct an FA (either NFA or DFA) which recognizes the language expressed by the regular expression below. (b) Construct a regular grammar which generates the language expressed by the following regular expression. For both answers, you should clearly show how you got your answers. ((ba + b)* + (cd(a + b))*)bba ba (a) FA accepting the language expressed by (ba+b)  ba    (b) FA accepting the language expressed by (ba+b) * cd a b (c) FA accepting the language expressed by cd(a+b) cd a b (d) FA accepting the language expressed by (cd(a+b)) *     Answer:

6 6 ba (e) FA accepting the language expressed by bba b  ba    (b) FA accepting the language expressed by (ba+b) * cd a b (d) FA accepting the language expressed by (cd(a+b)) *           An FA accepting the language expressed by the regular expression ((ba + b)* + (cd(a + b))*)bba

7 7 6. Using the procedure discussed at the class, construct a DFA which recognizes the same language that is recognized by the following NFA. Your answer should show how you got the answer. a, b 1 2 3 a aa 4 start 1 b {1,2}{1,2,3}{1,2,3,4} a aa b b b Answer: a


Download ppt "1 1. Eliminate all  -transitions from the following FA without changing the number of states and the language accepted by the automaton. You should also."

Similar presentations


Ads by Google