Chapter 13: Q28SE (page 901)
There is a result for context-free languages analogous to the pumping lemma for regular sets. Suppose that \(L(G)\) is the language recognized by a context-free language \(G\). This result states that there is a constant N such that if z is a word in \(L(G)\) with \(l(z) \ge N\), then z can be written as u v w x y, where \(l(vwx) \le N,l(vx) \ge 1\), and \({\bf{u}}{{\bf{v}}^{\bf{i}}}{\bf{w}}{{\bf{x}}^{\bf{i}}}{\bf{y}}\) belongs to \(L(G)\) for \({\bf{i = 0,1,2, \ldots }}\).Use this result to show that there is no context-free grammar \(G\) with \(L(G) = \left\{ {{0^n}{1^n}{2^n}\mid n = 0,1,2, \ldots } \right\}\).
Short Answer
By using a proof by contradiction, it shown that there is no exist a context-free grammar \(G\) with \(L{\rm{(}}G{\rm{)}} = \left\{ {{0^n}{1^n}{2^n}\mid n = 0,1,2, \ldots } \right\}\).