in Theory of Computation
2,374 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

7 Comments

Thanks.

But this DFA implies that the language accepts $\epsilon$ but which is not true. The smallest string that the language accepts is $' \ b\ '$.

Please clear my doubt
0
0
You have given the right procedure but this is not correct. It can be clearly seen as it is accepting $\epsilon$. If you follow the procedure (given by you), you will get NFA, which you can convert into DFA.
0
0

always regular grammer gives NFA, convert that NFA to DFA, you will get,

4
4
Thanks all!
0
0
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