# prove $a^nb^m; n<3m + 2$ is not regular by the pumping lemma

I want to prove this language $$a^nb^m; 0 \leq n< 3m+2$$ to be not regular by the pumping lemma. This is my attempt, is this a correct way of doing it?

Let's suppose $$L$$ is regular. Let $$s = a^{3k+1}b^{k}$$ such that $$k \geq 0$$ as a pumping length. So we have $$s \in L$$ and $$|s| \geq k$$.

Then, by the pumping lemma, $$\exists s = xyz$$ such that

1. $$|xy| \leq k$$,

2. $$|y| > 0$$,

3. $$\forall i \in \mathbb{N}, xy^iz \in L$$

Since $$|xy| \leq k$$ and $$|y| > 0$$, then $$x = a^\alpha$$, $$y = a^\beta (\beta \in \mathbb{N}^*)$$, $$z = a^{3k+1 - \alpha - \beta}b^{k}$$, so $$xy^iz = a^{3k +1 + i \beta - \beta}b^{k}$$

Now, $$xy^iz \in L \iff 3k +1 + i \beta - \beta < 3 k + 2\iff \beta(i-1) < 1$$, and so $$xy^iz \notin L \iff \beta(i-1) \geq 1$$, which is true for $$i = 2$$. Thus, as this is in contradiction with the third assumption of the pumping lemma, $$L$$ is not regular.

• We discourage "please check whether my answer is correct" questions, as only "yes/no" answers are possible, which won't help you or future visitors. See here and here. Can you edit your post to ask about a specific conceptual issue you're uncertain about? As a rule of thumb, a good conceptual question should be useful even to someone who isn't looking at the problem you happen to be working on. If you just need someone to check your work, you might seek out a friend, classmate, or teacher. Dec 21, 2022 at 13:55