in Theory of Computation
2,367 views
3 votes
3 votes

..............................................................

.

in Theory of Computation
2.4k views

2 Answers

5 votes
5 votes

While solving these type of questions simply use one trick.

Take variable on LHS, from that variable draw output operations such as :

S -> bS

means S on seeing b goes to S again.

S --> aA

means S on seeing a goes to A.

Overall DFA is :

Let input string is aaa.

By using Grammar : S --> aA --> aaB --> aaa.

Using DFA : (S, a) = A

(A,a) = B

(B,a) = S accepted.

edited by

4 Comments

Sorry, I just missed that case. I've edited my solution.
0
0
what about the final state? how you recognize the final state ?
0
0

why u have taken initial state S' ?

0
0
0 votes
0 votes
i think this grammar is actually accpeting n(a) w mod3=0

Related questions