Topic: Theory of Computation
Consider the right-linear grammar $G=(V,T,S,P)$ with $V=\{S,A\}, T=\{a, b\}$, and productions: $S \rightarrow aA \mid bS \mid \lambda$, $A \rightarrow bS$. What is the regular expression corresponding to L(G)?
- A. (b+ab)*
- B. (a+b)*ab
- C. b*a(ba)*
- D. (ab+ba)*
Answer: A. (b+ab)*
Explanation: From the productions, substituting $A \rightarrow bS$ directly into the $S$ rule $S \rightarrow aA$, we obtain $S \rightarrow abS \mid bS \mid \lambda$. This can be factored and rewritten as $S \rightarrow (b + ab)S \mid \lambda$. By applying Arden's Theorem (which states that $R = Q + RP \implies R = Q^* P$), the solution is $S = (b + ab)^* \lambda = (b + ab)^*$.