edited by
546 views
8 votes
8 votes

Which of the following is the regular grammar for the following finite automata? (Mark all the appropriate choices)
 

  1. $S \rightarrow a \mid aA \mid bB \mid \varepsilon $
    $A \rightarrow aA \mid aS $
    $B \rightarrow cS \mid \varepsilon$
  2. $S \rightarrow a \mid b \mid aA \mid bB $
    $A \rightarrow a \mid aA \mid aS$
    $B \rightarrow c \mid cS\mid \varepsilon$
  3. $S \rightarrow a \mid aA \mid bB $
    $A \rightarrow aA \mid aS$
    $B \rightarrow cS \mid \varepsilon$
  4. $S \rightarrow a \mid b \mid aA \mid bB $
    $A \rightarrow a \mid aA \mid aS$
    $B \rightarrow a \mid cS \mid \varepsilon$
edited by

1 Answer

Best answer
10 votes
10 votes
The easiest way to solve these kind of questions is to find the strings accepted by the given automata and not generated by the grammar in options or vice versa.

Option A: Generating empty string which is not accepted by the given automata.

Option C: Not generating $"bc"$ which is accepted by the given automata.

Option D: Generating $"ba"$ which is not accepted by the given automata.

Option B is the answer.
selected by
Answer:

Related questions

4 votes
4 votes
1 answer
3