UGC NET CS 2022Theory of Computation and Compilers › Context Free LanguageVerified
UGC NET CS 2022 PYQ: The reduced grammar equivalent to the grammar, whose production rules are given below, is $\begin{array}{l}…
The reduced grammar equivalent to the grammar, whose production rules are given below, is
$\begin{array}{l}
\mathrm{S} \rightarrow \mathrm{AB} \mid \mathrm{CA} \\
\mathrm{B} \rightarrow \mathrm{BC} \mid \mathrm{AB} \\
\mathrm{A} \rightarrow \mathrm{a} \\
\mathrm{C} \rightarrow \mathrm{a} \mathrm{B} \mid \mathrm{b}
\end{array}$
- A$\text {S} \rightarrow \mathrm{CA}, \mathrm{A} \rightarrow \mathrm{a}, \mathrm{C} \rightarrow \mathrm{b}$Correct answer
- B$\mathrm{S} \rightarrow \mathrm{CA}|\mathrm{B}, \mathrm{B} \rightarrow \mathrm{BC}| \mathrm{B}, \mathrm{A} \rightarrow \mathrm{a}, \mathrm{C} \rightarrow \mathrm{aB} \mid \mathrm{b}$
- C$\text {S} \rightarrow \mathrm{CA}|\mathrm{B}, \mathrm{B} \rightarrow \mathrm{BC}, \mathrm{A} \rightarrow \mathrm{a}, \mathrm{C} \rightarrow \mathrm{aB}| \mathrm{b}$
- D$\text {S} \rightarrow \mathrm{AB}|\mathrm{AC}, \mathrm{B} \rightarrow \mathrm{BC}| \mathrm{BA}, \mathrm{A} \rightarrow \mathrm{a}, \mathrm{C} \rightarrow \mathrm{aB} \mid \mathrm{b}$
Answer
(A) $\text {S} \rightarrow \mathrm{CA}, \mathrm{A} \rightarrow \mathrm{a}, \mathrm{C} \rightarrow \mathrm{b}$
Approach
Remove non-generating symbols, then unreachable ones.
Reviewed by UGC IQ Editorial Team.