I have these two languages$L_1={\{a^n b^m,nm+5,m>0}\}$ Where $=(a,b)$$L_2={\{a^n b^m,nm+5,m5}\}$ Where $=(a,b)$As you can see that there is only one difference, the condition of m is different. My question is to determine whether these two languages are regular or not, and to prove it.If one or both these languages are non-regular. then how can we prove that using pumping lemma?These two languages have so many conditions, I am just confused that how to solve these kind of Languages.
How to prove that these two languages are regular, or not regular?
formal languages;regular languages;automata;pumping lemma
For problems like this, where there are several constraints, it can be helpful to deal with the constraints separately. In this problem, look at what the languages can be for each value of $m$ and recognize that the original language can be expressed as the union of the languages for each value of $m$.Consider first your $L_2$. For each $0<m\le 5$, consider the languages $$A_m=\{a^nb^m\mid n\ge m+5\}$$So $A_0=\{a^n\mid n\ge 5\}$, $A_1=\{a^nb\mid n\ge 6\}$, and so on. It's easy to see that each $A_m$ is regular. It's also easy to see that $$L_2=A_0\cup A_1\cup A_2\cup A_3\cup A_4\cup A_5$$ and since $L_2$ is the finite union of regular languages, it must be regular, as @babou implied.For $L_1$ we can do the same thing, expressing$$L_1=\bigcup_{m=1}^\infty A_m$$but that doesn't seem to be of much help, since the infinite union of regular languages isn't necessarily regular. We thus guess that $L_1$ is not regular, so we'll try to use the Pumping Lemma to prove that it isn't.Let $L_1=a^{p+5}b^p$ where $p$ is the integer of the pumping lemma. Them we can express $L_1=xyz$ with $|y|>0$ and $|xy|\le p$. This means that $y=a^k$ for some $1\le k\le p$. Now pump down: $xy^0z=a^{p+5-k}b^p$ and since $n=p+5-k<p+5=m+5$ the string $xy^0z\notin L_1$ which is the contradiction we need, so $L_1$ isn't regular.