edited by
226 views
1 votes
1 votes

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

  1. $S_{1} \rightarrow aS_{2} \\
    S_{2} \rightarrow a S_{2} \mid bS_{2}$
  2. $S_{1} \rightarrow aS_{2} \\
    S_{2} \rightarrow a S_{2} \mid bS_{2} \mid \varepsilon$
  3. $S_{1} \rightarrow S_{2} a \\
    S_{2} \rightarrow S_{2} a \mid S_{2} b \mid \varepsilon$
  4. $S_{1} \rightarrow S_{1} a \mid S_{1} b \mid S_{2} a \\
    S_{2} \rightarrow \varepsilon$
edited by

1 Answer

2 votes
2 votes
Option $(B)$ is right linear grammar and option $(D)$ is left linear grammar.

$\textbf{PS1:}\; \underbrace{FA}_{L} \rightarrow \underbrace{RLG}_{L} \overset{R}{\rightarrow} \underbrace{LLG}_{L^{R}}$

$\textbf{PS2:}\; \underbrace{FA}_{L} \overset{R}\rightarrow \underbrace{FA}_{L^{R}} \rightarrow \underbrace{RLG}_{L^{R}} \overset{R}{\rightarrow} \underbrace{LLG}_{(L^{R})^{R} = L}$

Option A is wrong as the production is not terminating. Option C is not generating any string ending in $"b".$

So, the correct answer is $B;D.$
edited by
Answer:

Related questions