The pumping lemma for
The pumping lemma states:
For any context-free language L, there exists an integer n, such that for all
for all
The given rules mean that if two substrings from a string of a CFL are pumped i.e., parts w and y are repeated i number of times, it will still remain a part of the CFL.
The lemma gives a result in the form of a contradiction. We suppose that a given instance (string) of a language is context-free, and we contradict our supposition, as the pumped string will not be a part of the language.
Note: This lemma does not show if a language is context-free.
The following steps are involved in applying lemma:
Given a context-free language, extract a string (instance) from it.
Divide the string into substrings such that
Find a suitable i where the pumped string does not remain a part of the language.
Let
Take
We divide u in such a way that
Taking i = 0:
As the string is not a part of the language, so we can say that our initial supposition is wrong and that the language L is non-context-free.
Let's take another example:
Take
We divide x in such a way that
Taking i = 0:
As the string is not a part of the language, so we can say that our initial supposition is wrong and that the language L is non-context-free.
Free Resources