How am I supposed to prove that L={a^n b^m | n=km for k in N}
is not a regular language using the pumping lemma?
I started with taking a word w
in L
, w=a^n b^m
with n=km
for some k
in N
.
There are three possible decompositions for w
:
a^i * a^j * a^(n-i-j) b^m
a^i * a^(n-i) b^j * b^(m-j)
a^n b^i * b^j * b^(m-i-j)
Pumping the middle part in point 2) will result in a mixed up word, which is clearly not in L
, but I can't figure out why 1) can't give you a good decomposition:
Let's say you pump a^j
x
times. Then the amount of a's in the new word will be i+xj+n-i-j = n+(x-1)j
. We know n=km
for some m
. We have to show that there exists an x
such that the new word is not in L
. But let's assume j=m
(This is certainly possible, since n=km
there is always a sufficient amount of a's, except when k=0
, but then we get a trivial case). Then n+(x-1)j = km+(x-1)m = m(n+x-1)
which is of the form {a^n b^m | n=km for k in N}
for all x
. So for each w
we have a decomposition uvz
such that u v^i z
is in L
for all i
. Thus, by the pumping lemma, L
is regular.
What am I missing?
EDIT: The formulation of the Pumping lemma given:
Let
L
be a regular language accepted by a DFA withk
states. Letw
be any word inL
with length>= k
. Thenw
can be written asu v z
with|uv| <=k
,v>0
andu v^i z
inL
for alli>=0