I know this isn't directly related to programming, but I was wondering if anyone know how to apply the pumping lemma to the following proof:
Show that L={(a^n)(b^n)(c^m) : n!=m} is not a context free language
I'm pretty confident with applying pumping lemmas, but this one is really irking me. What do you think?
Pumping lemma for context free language (CFL) is used to prove that a language is not a Context free language. Assume L is context free language. Then there is a pumping length n such that any string w εL of length>=n can be written as follows − |w|>=n. We can break w into 5 strings, w=uvxyz, such as the ones given ...
In the theory of formal languages, the pumping lemma for regular languages is a lemma that describes an essential property of all regular languages.
E = {ww | w ∈ {0,1}∗} is not a CFL.
Edit: I was totally leading you down the wrong track. That's what happens when I try to help out when I haven't completely solved the problem myself.
Suppose L is context free. By Ogden's lemma, there exists an integer p that has the following properties:
Given a string w in L at least p symbols long, where at least p of those symbols are "marked", w can be represented as uvxyz, which satisfy:
That's Ogden's lemma. Now, let q be an integer divisible by every positive integer no greater than p. Let w = ap+q bp+q cp. Mark every c. By #2, u or v must contain at least one c. If either u or v contains any other symbol, then #4 fails, so u and v must contain only c. But then #4 fails when i = q/|uv|. We know q is divisible by |uv| because p > |uv| > 0, and q is divisible by all positive integers less than p.
Note that Ogden's lemma turns into the pumping lemma when you mark all symbols.
Suppose L is context free. By the pumping lemma, there is a length p (not necessarily the same p as above) such that any string w in L can be represented as uvxyz, where
Given a string w in L, either m > n or m < n. Suppose p = 2.
Suppose that m > n. (Note that Λ denotes the empty string.)
Suppose that n > m.
This demonstrates that no string from L provides a counterexample using the pumping lemma to the supposition that L is a context free language (even though it is context sensitive).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With