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.
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.
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?
$$\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:
$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$.
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.
$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.
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.
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.