2,985 views

2 Answers

3 votes
3 votes

A grammar is either left linear (any non-terminal in production comes at the left end) or right linear (any non-terminal in production comes at the right end) is regular.

$S\to Sa \mid a$ is left-linear so it is regular grammar.

$S\to aS \mid  a$ is right-linear, so it is regular grammar.

$S\to SaS \mid a$ is neither left linear nor right linear and hence it is not regular grammar.

Now check all options who satisfy the definition of regular grammar. Here both option (A)and (B)are satisfying the definition of regular grammar.

edited by
0 votes
0 votes
Reason behind not counting A option as regular, as far as I think is that if you consider s start symbol, nothing can be generated from it. Am I correct...

Related questions

0 votes
0 votes
1 answer
3
saurabh rai asked Mar 27, 2018
401 views
What will be regular grammar for given regular expression$r=(ab^*+b)^*ab$