1
$\begingroup$

Given the following language:

$L = \{ a^ib^j \mid \lvert i - j \rvert \le 2 \} $

I am trying to prove that it is not regular. On the one hand my intuition tells me that the language is non-regular as there is no way of tracking $a^{i's}$ and $b^{j's}$.

However, when I try to prove that it is irregular using the pumping lemma I have trouble finding which word I should use to arrive at a contradiction.

Any suggestions?

$\endgroup$
2
  • $\begingroup$ You can take the word $a^pb^p$, where $p$ is the constant promised by the pumping lemma. $\endgroup$ May 2, 2021 at 18:08
  • $\begingroup$ @YuvalFilmus Thanks! I just proved it with your word :) $\endgroup$ May 2, 2021 at 19:07

1 Answer 1

1
$\begingroup$

You can use the word $a^pb^p$, where $p$ is the constant promised by the pumping lemma.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.