I've been watching lectures from Coderisland on YouTube about finite state machines, DFAs and NFAs, and in one discussion he talks about how to use the pumping lemma to show how a language is not regular. I don't know quite how to apply the lemma and want to understand if I'm doing it right. If I had something like:
w = {anbk, n =/= k}
am I correct in that I can say that:
h = {anbn + r, r > 0} is a subset of w, and thus if I show by the lemma that h is not regular, that w must not be regular since h is a subset of w.
The way I would show this is as follows:
- h = xyz
- |xy| <= n
- x = an-r
- y = ar
- z = bn + r
- xyz = an-rarbn + r
- xy2z = an-ra2rbn + r = an + rbn + r
Thus h cannot be regular since an + rbn + r is not of the form {anbn + r, r > 0}, and since h is not regular w must not be regular, since h is an element of w.
Have I applied it correctly? I understand how to apply it for an easy language like {anbn}, because I can apply the lemma directly to this language, but the only way I could think of for my language was to create a subset that belongs to my language, and apply the lemma to that.
If I haven't applied it correctly, is there a way to show that my language is not regular (or regular), using another lemma, or perhaps with closure properties?
This is a really awesome topic, even if I don't understand the pumping lemma fully, I'm excited to explore it further!