With this pumping lemma, we were able to show that \(a^nb^n\) is not a regular language.
Suppose a variable repeats, such as: \(A \stackrel{*}{\Rightarrow} vAy\), with \(A \stackrel{*}{\Rightarrow} x\).
The derived string will then contain the substring \(vxy\). There will also be strings in the language that contain substrings \(x, vvxyy, vvvxyyy...\)
A little more complicated because there can be two “pumped” parts (in equal measure of pumped-ness).
There is a CFG \(G\) such that \(L = L(G)\).
Consider the parse tree of a long string in \(L\).
For any long string, some nonterminal \(N\) must appear twice in the path.
<< How does this work for grammar \(S \rightarrow aSb | ab\)? >>
Consider \(L = \{a^nb^nc^n: n\ge 1\}\).
Why would we want to recognize the language \(\{a^nb^nc^n: n\ge 1\}\)?
Recognize underlined words:
\(\underline{word}\) is stored as \(word\beta\beta\beta\beta\ \_\ \_\ \_\ \_\) where \(\beta\) represents a backspace.
Unfortunately, \(L\) is not a CFL.
What if we try to prove that \(L = a^nb^n\) is not context free, by using the pumping lemma?
Pick \(w = a^mb^m\).
Adversary picks \(v = a^k\) and \(y = b^k\).
Of course, this does not prove that \(L\) is context free. Just that we failed to disprove this with the pumping lemma (that is a good thing).
Prove that \(L = \left\{ ww \mid w \in \{a, b\}^* \right\}\) is not a CFL.
Consider the string \(w = a^mb^ma^mb^m\).
Prove that \(L \left\{ a^{n!} \mid n \geq 0 \right\}\) is not a CFL.