wiz-icon
MyQuestionIcon
MyQuestionIcon
1
You visited us 1 times! Enjoying our articles? Unlock Full Access!
Question

Consider the regular grammar:

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


Where S is the starting symbol, the set of terminals is {a} and the set of non-terminals is { S, W, 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
5
No worries! We‘ve got your back. Try BYJU‘S free classes today!
B
4
No worries! We‘ve got your back. Try BYJU‘S free classes today!
C
3
Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
D
2
No worries! We‘ve got your back. Try BYJU‘S free classes today!
Open in App
Solution

The correct option is C 3
The given grammer after substitution of X and Y becomes

SZaaWaa
ZSaϵ
WSa

Which after substituting Z and W is equivalent to
SSaaaaaSaaa

Which is equivalent to
SSaaaaa.

So. L(G) = (aaa)aa

So the language generated by the grammer is the set of strings with a's such that number of a mod 3 is 2. So the number of states required should be 3 to maintain the count of number of a's mod 3.

flag
Suggest Corrections
thumbs-up
1
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Regular Grammars Part - 1
OTHER
Watch in App
Join BYJU'S Learning Program
CrossIcon