3 3 votes Consider the following context-free grammar $G$, where $S, X$, and $Y$ are the variables (nonterminals), $a, b$, and $c$ are the terminal symbols, $S$ is the start variable, and the rules of $G$ are described as:$$\begin{aligned}& S \rightarrow a X \mid Y c \\& X \rightarrow a X b \mid a b \\& Y \rightarrow b Y c \mid b c\end{aligned}$$Which ONE of the following languages $L(G)$ is generated by $G$ ?$L(G)=\left\{a^n b^n \mid n \geq 1\right\} \cup\left\{b^n c^n \mid n \geq 1\right\}$ $L(G)=\left\{a^{n+1} b^n \mid n \geq 1\right\} \cup\left\{b^n c^{n+1} \mid n \geq 1\right\}$ $L(G)=\left\{a^n b^{n+1} \mid n \geq 1\right\} \cup\left\{b^{n+1} c^n \mid n \geq 1\right\}$ $L(G)=\left\{a^n b^n c \mid n \geq 1\right\} \cup\left\{a b^n c^n \mid n \geq 1\right\}$ Theory of Computation goclasses theory-of-computation goclasses-cs-dpp goclasses-cs-dpp-day-109 goclasses-toc-practice-questions + – GO Classes 204 views answer comment Share Follow Print 0 reply Please log in or register to add a comment.
1 1 vote Correct Option - B SAMRIDHII09 answered Nov 1, 2025 SAMRIDHII09 comment Share Follow 0 reply Please log in or register to add a comment.