简体   繁体   中英

Pumping lemma to show that `{a^n b^m | n=km for k in N}` is not regular

How am I supposed to prove that L={a^nb^m | n=km for k in N} L={a^nb^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^nb^m with n=km for some k in N . There are three possible decompositions for w :

  1. a^i * a^j * a^(nij) b^m
  2. a^i * a^(ni) b^j * b^(mj)
  3. a^nb^i * b^j * b^(mij)

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+nij = 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^nb^m | n=km for k in N} {a^nb^m | n=km for k in N} for all x . So for each w we have a decomposition uvz such that uv^iz 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 with k states. Let w be any word in L with length >= k . Then w can be written as uvz with |uv| <=k |uv| <=k , v>0 and uv^iz in L for all i>=0

A perhaps easier way to proof this is first modifying the language.

Since regular languages are closed under complement and the intersection with another regular expression.

This means that you can proof L is not a regular language by proving complement(L) is not a regular language, because if L' is a regular language, L is and vice versa. The same holds for the intersection.

It is sufficient to proof that L' is not regular as well:

L' = intersection(complement(L),a*b*})

Thus

L'={a^nb^m|n != k*m, for any k in N}

Then the proof becomes way easier because you can show for whatever part you use as the pumping lemma, if it has length l , you can pump it enough times to reach a multiple.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM