Solution Found!
Give a context-free grammar that generates the languageA =
Chapter , Problem 2.9(choose chapter or problem)
QUESTION:
Give a context-free grammar that generates the language
\(A=\left\{\mathrm{a}^{i} \mathrm{~b}^{j} \mathrm{c}^{k} \mid i=j \text { or } j=k \text { where } i, j, k \geq 0\right\}\)
Is your grammar ambiguous? Why or why not?
Questions & Answers
QUESTION:
Give a context-free grammar that generates the language
\(A=\left\{\mathrm{a}^{i} \mathrm{~b}^{j} \mathrm{c}^{k} \mid i=j \text { or } j=k \text { where } i, j, k \geq 0\right\}\)
Is your grammar ambiguous? Why or why not?
ANSWER:Step 1 of 4
CFG for \(i=j\)
\(S_{i=j} \rightarrow S_{1} S_{2}\)
\(S_{1} \rightarrow a S_{1} b \mid \varepsilon\)
\(S_{2} \rightarrow c S_{2} \mid \varepsilon\)