Open In App

GATE | Gate IT 2005 | Question 39

Like Article
Like
Save
Share
Report

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)

Explanation:

Language produced by the given grammar is : L = { aa, aaaaa, aaaaaaaa, aaaaaaaaaaa, ……} i.e. 

L={w| w belongs to a* and |w|a =2mod3}.
It can also be verified using the concept of converting Grammer to Finite Automata by first converting the left linear grammar to right linear grammar. 
It will not produce strings of lengths 1, 4, 8… 
Hence to implement (m)mod(n) we know that we require n states at minimal DFA. So, the minimum states required to construct automata for the language generated by the above grammar are 3. 
 
Thus, option (B) is correct. 
 
Please comment below if you find anything wrong in the above post. 

Quiz of this Question


Quiz of this Question
Please comment below if you find anything wrong in the above post


Last Updated : 28 Jun, 2021
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads