HiveBrain v1.2.0
Get Started
← Back to all entries
patternMinor

Prove that the language of unary not-prime numbers satisfies the Pumping Lemma

Submitted by: @import:stackexchange-cs··
0
Viewed 0 times
theprimenumbersunarylanguageprovepumpingthatlemmanot

Problem

Here is a question from Daniel I. A. Cohen's book Introduction to Computer Theory:


Consider the language:


$\quad \mathrm{PRIME}' = \{ a^n \mid n \text{ is not a prime} \} = \{ \varepsilon, a, aaaa, aaaaaa, aaaaaaaa, \ldots \}$



  • Prove that $\mathrm{PRIME}'$ is non-regular.



  • Prove, however, that $\mathrm{PRIME}'$ does satisfy the pumping lemma.




Part 1. is really easy to prove. I start my proof of part 2. like this:

  • We pick $m$ s.t. $m \geq 4$.



  • The opponent picks $w = a^{n^2}$, where $n$ is any prime number greater than m.



Now I don't know how to decompose $w$ into $xyz$. Any help would be appreciated.

Update: According to the answers below, $\mathrm{PRIME}'$ doesn't satisfy the Pumping Lemma we commonly talk about (requiring $|xy| \leq m$). I have checked the book at the library and found there are two versions of the Pumping Lemma in it. The weaker one, which clearly this question refers to, doesn't require a fixed pumping length.

Solution

Let $w \in \mathrm{PRIME}'$ with $|w| \geq 5$. Distinguish two cases.

-
$|w|$ is even -- in that case, choose $x = \varepsilon$, $y = aa$ and $z = a^{|w|-2}$. Then, for all $i\geq 0$, we have $|xy^iz|$ is even and greater than two, as $|z| \geq 3$, and therefore not prime; $xy^iz \in \mathrm{PRIME}'$.

-
$|w|$ is odd -- in this case, we can not verify the pumping property. This can be seen as follows.

We have

$\quad \forall m \geq 1.\, \exists n \geq m.\, \forall 1 m$ non-prime so that $n$ has no prime factor $\leq m$, e.g. $n = p^2$ for $p\geq m$ prime. Assume there was a $1

Context

StackExchange Computer Science Q#9104, answer score: 4

Revisions (0)

No revisions yet.