233k views
1 vote
Using the pumping lemma for context-free languages, prove

that the following are not context-free languages.
(a) Li {abm: n=2m}.
(b) L2 = {a"b"c: n≤k}
(c) L3-{w: wЄ {a, b, c}* and na(w) < nь(w) < nc(w)}

User Jasamer
by
7.6k points

1 Answer

5 votes

Final answer:

Using the pumping lemma for context-free languages, we can prove that L1, L2, and L3 are not context-free languages.

Therefore, L3 is not context-free.

Step-by-step explanation:

The pumping lemma is a technique used to prove that a language is not context-free. Let's analyze each language:

(a) For the language L1 = {abm: n=2m}, where n is the number of 'a's and m is the number of 'b's, we can use the pumping lemma to show that it is not context-free. Suppose we have a string w = ab^2k, where k is a positive integer. By pumping up the number of 'a's, we get a string that is not in the language.

(b) For the language L2 = {a"b"c: n≤k}, where n is the number of 'a's and k is a positive integer, we can use the pumping lemma to show that it is not context-free. Let's consider the string w = a^kb^kc. By pumping down the number of 'a's, we get a string that is not in the language.

(c) For the language L3 = {w: wЄ {a, b, c}* and na(w) < nь(w) < nc(w)}, let's analyze the string w = a^nb^n. By pumping down the number of 'b's, we get a string that is not in the language. Therefore, L3 is not context-free.

User Chimerical
by
8.5k points