GATE | Gate IT 2005 | Question 39

Consider the regular grammar:

S → Xa | Ya
X → Za
Z → Sa | ϵ
Y → Wa
W → Sa

where S is the starting symbol, the set of terminals is {a} and the set of non-terminals is {S, W, X, Y, Z}.
We wish to construct a deterministic finite automaton (DFA) to recognize the same language. What is the minimum number of states required for the DFA?
(A) 2
(B) 3
(C) 4
(D) 5

Answer: (B)

Language produced by the given grammar is :
L = { aa, aaa, aaaaa, aaaaaa, aaaaaaa, aaaaaaaaa ……}

It will not produce strings of length 1, 4, 8 ….

Thus, the minimum string is ‘aa’.
So, minimum states required to construct automata for this language are 3.

Thus, option (B) is correct.

Please comment below if you find anything wrong in the above post.

Quiz of this Question

My Personal Notes arrow_drop_up
Article Tags :

Be the First to upvote.

Please write to us at to report any issue with the above content.