1

I need to prove the following language is not regular, I think I need to use the pumping lemma. The trouble I am having is that there is multiple variables and I am not used to that. Could someone tell me if the pumping lemma is the correct proof by contradiction of $$L = \{a^iba^j|i\ge2j\ge0\}$$

I took $xyz = a^{2p+1}ba^p $ so $|xy| = 2p+2$ which is greater than $p$ and must be false. Is this solution correct?

Raphael
  • 72,336
  • 29
  • 179
  • 389
  • 1
    Welcome! We discourage "please check whether my answer is correct" questions, as only "yes/no" answers are possible, which won't help you or future visitors. See here and here. Can you edit your post to ask about a specific conceptual issue you're uncertain about? As a rule of thumb, a good conceptual question should be useful even to someone who isn't looking at the problem you happen to be working on. If you just need someone to check your work, you might seek out a friend, classmate, or teacher. – D.W. Oct 14 '16 at 04:33
  • 4
    No, this is not a correct proof. Just saying that $xyz=\dots$ in no way implies that $xy$ has any particular length. And the pumping lemma doesn't work by deriving a contradiction about the length of $xy$. I suggest you check what the pumping lemma actually says, and check the examples of its use that you've already been given and that can be found around the web. Also, look at our reference question. – David Richerby Oct 14 '16 at 06:55
  • The misunderstanding that $|xy| = 2p+2$ is a very common one; there is a tendency to think that since $x$ and $y$ are the first parts of the string $s$, then since $s$ is of some particular form, then $x$ and $y$ must somehow follow the structure of that – that $x$ is the first $2p+1$ $a$'s and $y$ is the following $b$. But there is no such "magic partition principle". Moreover, since the condition $|xy| \leq p$ must apply, then we know that we cannot have $|xy| = 2p+2$. If you choose $s = a^{2p+1}ba^p$, then $x$ and $y$ are found within the first $p$ characters, i.e. consist of $a$'s only. – Hans Hüttel Oct 14 '16 at 19:58

1 Answers1

0

As noted, you need to be careful making assertions about $xy$. Recall that the pumping lemma says that if $L$ is a regular language, then there is a positive integer $p$ such that any string $s\in L$ can be written as $s=xyz$ where

  1. $|xy| \le p$,
  2. $|y| > 0$,
  3. $xy^iz\in L$ for all $i=0,1,\dotsc$.

so in your example all you know is that $|xy|\le p$. You certainly can't assert that $|xy|=2p+2$.

All is not lost, though. If you assume that $L$ is regular and let $s=a^{2p}ba^p$ (notice that I chose a different string to pump), then since $|xy|\le p$, you know that $xy$ "lives" among the first group of $a$'s, and so $xy=a^k$, for some $k\le p$. Hence $y=a^t$ for some $0<t\le p$ and so the PL assures us that $xy^iz\in L$ and we have $xy^iz=a^{2p+(i-1)t}ba^p$. [Do you see why?] Now all you have to do is pick some $i$ so that $xy^iz\notin L$ to establish a contradiction and thus show that $L$ isn't regular.

I'll leave the rest for you: what $i$ can you use to show that $xy^iz\notin L$?

Rick Decker
  • 14,826
  • 5
  • 42
  • 54