pumping lemma division cases

718 Views Asked by At

If I got a language that I want to classify as "nonregular" using pumping lemma

the problem that I'm facing with this algorithm is the following:

when you divide the string S that you choose(that is greater or equal than the pumping length p) to three parts x, y and z, you shouldn't do that multiple times with say 3 cases or 4 cases,

because if I got only one case of dividing them that satisfies the division criteria of the theory and I got a contradiction that's enough right ??

for example here in the picture, we only need the first case, why? well the division criteria of the theorem has been met, what do I mean by criteria ?? well 1- the length of y>0 2- the length of xy>0 if that happens (even in one case) and I got a string that don't belong to the original language then I should stop right ??

enter image description here

1

There are 1 best solutions below

0
On

Start by assuming that $L$ is regular. In that case it has a pumping length $p$, and the pumping lemma says that if $w\in L$, there is some way to decompose $w$ as $w=xyz$ such that $|y|\ge 1$, $|xy|\le p$, and $xy^kz\in L$ for each $k\ge 0$. To get a contradiction, thereby showing that $L$ cannot in fact be regular, we’ll find a word $w\in L$ such that no matter how we divide it as $w=xyz$ with $|y|\ge 1$ and $|xy|\le p$, there will be some $k\ge 0$, such that $xy^kz$ is not in $L$.

One word that does the trick is $w=a^pb^p$. Suppose that $a^pb^p=xyz$, where $|y|\ge 1$ and $|xy|\le p$. Then $xy$ is at most the first $p$ characters of $w$, so it consists entirely of $a$s. Thus, there are non-negative integers $r$ and $s$ such that $x=a^r$, $y=a^s$, $r+s\le p$, and $s\ge 1$. That means that $z$ must be all the rest of $w$, so $z=a^{p-r-s}b^p$, and $w=xyz=a^ra^sa^{p-r-s}b^p$.

The pumping lemma says that if $L$ really is regular, $xy^kz\in L$ for each $k\ge 0$, so let’s see what $xy^kz$ actually is:

$$xy^kz=a^r(a^s)^ka^{p-r-s}b^p=a^{r+ks+p-r-s}b^p=a^{p+(k-1)s}b^p\,.$$

This is in $L$ if and only if $p+(k-1)s=p$, and this is the case if and only if $k=1$. If we take $k=0$, for instance, we have $a^{p-s}b^p$, and since $s\ge 1$, $p-s\ne p$, and this word is not in $L$. If we take $k=2$, we get $a^{p+s}b^p$, and again this is not in $L$, since $p+s>p$.

Note that I didn’t choose any specific decomposition of $w$: what I did applies equally to every decomposition $a^pb^p=xyz$ that meets the two fundamental requirements that $|y|\ge 1$ (so that pumping actually changes the word) and $|xy|\le p$.