Is the language L regular?

78 Views Asked by At

Could you tell me if the language $L=\{a^ib^j:i+j=k, k \geq 2 \}$ is regular? Do I have to find a regular expression for this language? Or what can I do to check if $L$ is regular or not?

1

There are 1 best solutions below

3
On BEST ANSWER

$L$ is almost $a^*b^*$, except that $\epsilon$, $a$ and $b$ aren't in it. Regular languages are closed under difference, so $L$ must be regular.

Regular expressions don't have complement or difference, so you have to enumerate the options that are available. Luckily, all words of length $2$ are fine so you only need to think about the first two characters. They can only be $aa$, $ab$ or $bb$, so the expression is $aaa^*b^*|abb^*|bbb^*$.