0

I have these two languages

$L_1={\{a^n b^m,n≥m+5,m>0}\}$ Where $∑=(a,b)$

$L_2={\{a^n b^m,n≥m+5,m≤5}\}$ 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.

Rick Decker
  • 15,016
  • 5
  • 43
  • 54
Aniq
  • 129
  • 3

2 Answers2

1

Hints:

One of the two languages is not regular. It is the one that forces you to count beyond 10 to decide whether some strings are in the language. Regular languages are not very good at counting without bound.

However, the use of the pumping lemma to prove it requires that you start from a string in the language where $n$ is as close to $m$ as permitted by the definition of the language, and that you pump out rather than in, i.e. remove the only $w$ of the $xwy$ decomposition of the string, rather than inserting more copies of $w$.

Alternatively, you can prove that the reverse of the language is not regular, if you know about closure properties.

babou
  • 19,645
  • 43
  • 77
1

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.

Rick Decker
  • 15,016
  • 5
  • 43
  • 54