0

Over the alphabet $\Sigma=\{a,b\}$, we define $$L=\{a^pb^m: p\text{ is prime }, m>0\}+\{a^r:r\geq 0\}.$$

I must show that this laguage is not regular using the pumping lemma. I guess I should apply it to a word of the form $a^pb^m$, and my intuition is that I should come to the contradiction of $p$ not being prime. But I'm not very familiar with the pumping lemma, this is my first try, so I'll appreciate any hint in order to choose a word $x=a^pb^m$ with $p+m\geq n$ ($n$ from the lemma) which yields a contradiction.

Javi
  • 101
  • 2

1 Answers1

0

We know there are infinitely many primes, so we can find strings with arbitrarily long numbers of $a$'s followed by $b$'s.

  • Suppose the language is regular, meaning there exists a pumping length $\lambda$ satisfying the conditions of the pumping lemma.
  • Find a prime $p$ larger than $\lambda$. (For tolerance's sake, you can even suppose it is larger than $2\lambda$.) This is always possible because there are infinitely many primes.
  • Then the string $\sigma\equiv a^pb^p$ is in the language $(p>\lambda$).
  • By the pumping lemma, we must be able to subdivide $\sigma =xyz$ such that $|xy|<\lambda$ and $y\neq \varnothing$ and $xy^nz$ is in the language for all $n\geq 0$.
  • But if $|xy|<\lambda<p$, then $x$ and $y$ must consist entirely of the character $a$. This will cause a problem.
  • For notation, say $x=\mathtt{a}^i$ and $y=\mathtt{a}^j$ and $z=\mathtt{a}^k\mathtt{b}^p$. If our subdivision really satisfies the pumping lemma, then $xy^nz$ must be in the language for any $n$ we choose. But if we pick $n=i+k$, we find that unfortunately $xyz = \mathtt{a}^{(i+k)(j+1)}\mathtt{b}^p$ which is a composite number of $a$s followed by a nonzero number of $b$'s which is therefore not in the language. (Some detail work is required to establish that $(i+k)(j+1)$ is composite and cover the edge cases.)
  • Because the pumping length $\lambda$ was arbitrary, we find that the pumping lemma is not actually satisfiable, so the language is not regular.
user326210
  • 838
  • 5
  • 13