0

Let $\Sigma = \{a, b\}$. Use the Pumping Lemma to show that $\mathcal L = \{ a^pab^q: p < q \}$ is not regular.

Not sure how to apply PL here, if someone can give some direction.

dfeuer
  • 9,369
stackuser
  • 383

2 Answers2

1

According to Wikipedia, the pumping lemma guarantees that if $\mathcal L$ is regular, then for some $n$, any word of length at least $n$ can be broken into three pieces, $xyz$ such that $y$ is nonempty and $xy$ has length at most $n$ so that $xy^nz\in \mathcal L$ for any $n$. Suppose this is the case. By the definition of $\mathcal L$, $a^nab^{n+1}\in \mathcal L$. What, then, can $y$ look like? What contradiction does the pumping lemma imply?

dfeuer
  • 9,369
  • i wanted to make $y=a^{k}$ but wasn't sure – stackuser Oct 13 '13 at 00:23
  • What was the source of your doubt? – dfeuer Oct 13 '13 at 00:28
  • splitting up between the $a$'s seemed not very exact. like there's maybe more than 1 way to do this, because there's $a^n$ and $a$ and since i'm learning PL now, i keep thinking there's maybe some reason to put the $b$ in there. – stackuser Oct 13 '13 at 00:32
  • There is a reason to put the $b$ in there. There is an extraneous piece to this puzzle, but that ain't it. – dfeuer Oct 13 '13 at 00:36
  • @stackuser: If the pumping length is $n$, and you start with $w=a^nab^{n+1}$, the decomposition $w=xyz$ guaranteed by the pumping lemma satisfies $|xy|\le n$, so the string $xy$ consists entirely of $a$’s: we must have $x=a^p$ and $y=a^q$ for some $p,q$ such that $p+q\le n$. Moreover, $y$ is not the empty word, so $q\ge 1$. Thus, $z=a^{n-p-q}ab^{n+1}$. Now what is $xy^kz$? – Brian M. Scott Oct 13 '13 at 10:43
  • @stackuser, I think the extra $a$ is just there to confuse you. – dfeuer Oct 13 '13 at 13:37
0

$$\def\L{\mathcal L}\def\a{\mathtt a}\def\b{\mathtt b}\L = \{ \a^p\a\b^q: p < q \}$$

The pumping lemma goes like this. We claim that $\L$ is nonregular. Our adversary $A$ claims it is. Then we play a game:

  1. $A$ gives us a "pumping constant" $p$ that she claims is an upper bound for the number of states in the smallest finite automaton that will accept $\L$.

  2. We select a string $s$ from $\L$ of length $p$ or more. This is a string that is long enough to make an automaton for $\L$ go through a loop in its states.

  3. $A$ divides $s$ into three parts $u,v,w$ such that $s = uvw, |uv|\le p, |v| > 0$. Here, $v$ is the part of the string that makes the automaton loop. It can't be too far from the front of the string (that's the $|uv|\le p$ condition) and it can't be empty.

  4. We pick a number $n\ge 0$ and consider the string $s' = uv^nw$. We're going to make the automaton go around the loop $n$ times instead of going around once.

  5. If $s'\notin\L$, we win—we showed that $A$'s automaton accepts a different language. If $s'\in\L$, we lose, because we showed nothing.

So how will we win in this case? Let's say that in step 1 $A$ has given us the pumping constant $p$. In step 2, let's choose $s = \a^{p-1}\a\b^p$. This will force $A$ to put the pumpable string $v$, which must be near the front of $s$, into the section of $\a$'s, and we'll be able to pump $v$ up to increase the $\a$'s and make $s'$ have too many $\a$'s.

In step 3, $A$ must choose $u,v,w$, with $v$ nonempty ($|v|>0$) and close to the front of the string (that's $|uv|\le p$). Since $s$ begins with $p$ $\a$'s, $u$ must be of the form $\a^j$ and then $v$ must be of the form $\a^k$ for $j+k\le p$ and $k>0$. $w$ is the rest of the $\a$'s and then all of the $\b$'s; it's $\a^{p-j-k}\b^p$.

Then we just pump the heck out of $v$ in step 4. The only question is how much to pump it to get the $\a$ section of $s'$ to be too long. Say we take $n=p+1$. Then consider the string $s' = uv^pw = \a^j\,\a^{(p+1)k}\,\a^{p-j-k}\b^p = \a^{p(k+1)-1}\a\b^p$. Since $k>0$ and $p\ge1$, certainly $p(k+1)-1 > p$, and this $s'$ is not an element of $\L$, so we win.

MJD
  • 67,568
  • 43
  • 308
  • 617