Let B be the language of all palindromes over {0,1} which contains equal numbers of 0s and 1s.
Palindrome is a sequence of digits or anything that are same if we read from starting and ending.
For example {radar, refer, wow, noon}
Here the language given us is containing equal no of 0s and 1s so there the language of palindrome is as follows
B= {001100, 011110, 10011001, 110010011}
Here the pumping lemma is used to find the language is context free or not.
pumping lemma for CFG is defined as,
- Assume B is CFG and there L is 0s and 1s. where Z is belongs to L.
Here atleast 1 is not null.
- Find a suitable k so thatso L is not context free language.
If we equate both z then we get,
Then after that,
Let v or x is a part of -
From there, it is proof that
Therefore, L is not context free language.