Correct application of the CFL Pumping Lemma

I came across this question about showing that the language $ L = \{w \epsilon \{a, b, c\}^*: n_a(w) + n_b(w) = n_c(w)\}$ is context-free but not linear in the book by Peter Linz. That is easily doable by the separate pumping lemma for linear languages (as given in Linz’s book), but my question is different.

Evidently this is a CFL, and a pushdown automaton can be constructed for it. But if I apply the pumping lemma for CFLs, I find that I’m able to pump strings that don’t belong to the language, which would mean that the language is not a CFL. Clearly I’m doing something wrong.

Going by the "game-like" format given in Linz, say you pick $ w = a^mb^mc^{2m}$ , $ |w| \ge m$ . The adversary can choose a number of decompositions $ w = uvxyz$ , they can look like -:

  • $ v = a^k, y = a^l$ : The case where $ |vxy|$ is contained within the $ a$ ‘s of the string. Pump $ i = 0$ , and then $ w_0 = a^{m – (k + l)}b^mc^{2m}$ cannot be in the language since the equality no longer holds.
  • $ v = a^k, y = b^l$ : The case where $ v$ is in the $ a$ section, $ x$ spans across the $ a$ ‘s and $ b$ ‘s, and $ y$ is in the $ b$ section. Again, pump $ i = 0$ . $ w_0 = a^{m – k}b^{m – l}c^{2m}$ cannot be in the language.

There are more cases like these. Where am I going wrong in the application of the CFL PL?

Use of pumping lemma for not regular languages. (Proof Verification)

$ L=\{w \in \{0,1,a\}^* | \#_0(w) = \#_1(w) \}$

We show that L is not regular by pumping lemma.

We choose w=$ 0^p 1^p a$

|w| = 2p+1

Now |xy| has to be $ \leq p$

So x and y could only contain zeros. And $ z=1^p a$

$ xy^iz= 0^p 1^p a$

Now let i = 0

$ xy^0z=0^{p-|y|} 1^p a$

Now hence $ p-|y| \neq p$ this choice of i would lead to a word that is not in L. So we can not pump y and stay in the language.

So L is not regular.

I’m trying to learn the usage of the pumping lemma. Is my proof correct?

Any suggestions are welcome. Thanks!

validation of a pumping lemma proof for regular languages

i have the following regular expression:

image of the regular expression

of course i could think of a world like w=a^(m+2)b^(m+2)c^(2m+3) and continue with the proof BUT i was just wondering, because L is made up of a union of two expressions, is it valid to split L into L1=a^(i)b^(j)c^(2j-1)| i<=j & i,j>0 L2=a^(i)b^(j)c^(2j-1)| i>=2j-1 & i,j>0

show for each L1 and L2 that the pummping lemma does not work on them (so for l1 i just show that for lets say each k i is not smaller or equal to j, and for l2 i show that i is not always bigger or equal to 2j-1 for each k)

by that i show that l1 and l2 are not regular which means that the union of the two will also be not regular.. is this corrent?

thank you.

Pumping Lemma for CFL – $ \{ 0^{i} 1^{j} 0^{k} 1^{l} \hspace{0.2cm}| \hspace{0.2cm} i = l \hspace{0.2cm} \land j = k \} $

I was making exercices about the Pumping Lemma for CFL, and I stumbled up on this language:

$ $ \{ 0^{i} 1^{j} 0^{k} 1^{l} \hspace{0.2cm}| \hspace{0.2cm} i = l \hspace{0.2cm} \land j = k \} $ $

I quickly made a CFG that represents that language (or so I believe):

$ $ S \to 0S1 \hspace{0.2cm} | \hspace{0.2cm} A \ A \to 1A0 \hspace{0.2cm} | \hspace{0.2cm} \epsilon $ $

The problem is that I began to think if the Pumping Lemma would hold (it should since I have a CFG for the Language, so it must be a CFL).

(Having the Pumping Lemma in mind) I chose a word, w = $ 0^{n}1^{n}0^{n}1^{n} $ . I immediately stopped because this word will not pass the Pumping Lemma (it can be used to demonstrate that $ \{ ww \hspace{0.2cm}| \hspace{0.2cm} w \in \{0,1\}^{*}\}$ , the language of duplicated words, is not a CFL, I have done it before)

Now I’m stuck with a Pumping Lemma that fails, and a CFG that produces the language and don’t now what to do. I tried to come up with a word that the grammar couldn’t produce and failed, I tried to invalidate the PL but failed (there are no restrictions that tells that the word cannot have all segments of the same size, so $ w$ is in the language).

As far as I know If the PL holds, the language doesn’t have to be a CFL, but if it fails is absolutely unquestionable that the Language is not a CFL.

What I’m I missing?

Minimum pumping length of (01)*

Michael Sipser offers the definition:

The pumping lemma says that every regular language has a pumping length p, such that every string in the language can be pumped if it has length p or more. If p is a pumping length for language A, so is any length p′ ≥ p. The minimum pumping length for A is the smallest p that is a pumping length for A.

Now, (01)* in set notation is {€, 01,0101,010101….} Taking minimum pumping length = 1, according to the definition, we have the statement if a string in the language has length 1 or more, it can be pumped.

This statement is true for all elements of the above mentioned set, so can the minimum pumping length be 1?

p.s. the minimum pumping length for (01)* has been asked here before but it doesn’t answer my doubt that since the condition holds for minimum pumping length = 1, why is it not the answer?

Minimum pumping length of concatenation of two languages

there’s this small part of my homework that I just can’t figure out.

Let us denote $ p(L)$ as the minimum pumping length of some language $ L$ . I’m supposed to find two regular languages $ A,B$ so that

$ $ p(AB)=p(A)+p(B) $ $

But whatever I try, I can only find languages so that

$ $ p(AB) < p(A)+p(B) $ $

I’ve been sitting at this the whole day and I’m just going in circles. Can someone please give me a hint?