Pumping lemma for 0^f1^g2^g?

86 Views Asked by At

I am trying to prove that the language $$\{0^g1^h2^j|h\ne j,g\ge2\}$$ is not regular. So far I have $x=0^m,y=0^f,z=0^{p-m-f}1^p2^{p+1}$. I don't know where to go from here, all of the examples I can find only have two different characters in the language not three.

1

There are 1 best solutions below

0
On BEST ANSWER

$$ L = \{0^g1^h2^j \ |\ g\ge2, h\neq j\} $$

Edited:

Assume $L$ to be regular. Let $n$ be the pumping lemma constant. Then, any $w\in L$ with $|w|\ge n$ can be written as $xyz, y\neq\epsilon, |xy|\le n$.

The proof must work for any split $x,y,z$ of some string (this string can be chosen by us).

Choose $w=0^21^n2^{n+n!}$. Clearly, $w\in L$ and $|w|\ge n$. Now, the following cases are possible

  • $|xy|\le 2$. That is, $xy$ contains only $0$s. Then, $xy^0z\notin L$.
  • $y$ contains only $1$s (this case arises only if $n>2$). Then, $xy^kz=0^21^{n+(k-1)|y|}2^{n+n!}$. This is because $|xy|\le n$. Then, for $k=1+\frac{n!}{|y|}$, $xy^kz\notin L$.
  • $y$ contains both $0$s and $1$s (this case arises only if $n>2$). Then, $xy^2z\notin L$.
  • $y$ cannot contain $2$s, since $|xy|\le n$.

So, we conclude that $L$ is not regular.


The following is an incorrect approach, since it works for specific splits only. This doesn't prove anything.

Consider the following cases:

  • $g>2$. Use $x=\epsilon, y=0^g, z=1^h2^j$
  • $g=2, h>j$. Use $x=0^g1^j, y=1^{h-j}, z=2^j$
  • $g=2, h<j$. Use $x=0^g1^h2^h, y=2^{j-h}, z=\epsilon$

For each case, finding $k\ge0$ such that $xy^kz\notin L$ is relatively easy.