# Why are these languages not regular? [duplicate]

Show that the following languages are not regular:

$(1)\ L=\left\{a^nb^mc^k\mid n>k \land n,m,k>0\right\}$

$(2)\ L=\left\{a^nb^mc^k\mid m>k \land n,m,k>0\right\}$

I've difficulties showing that these two languages are not regular by using the Pumping Lemma. Any suggestions?

• Try using the closure of regular languages under reversal and under intersection. Alternatively, you can use Nerode's criterion. – Yuval Filmus Aug 8 '17 at 17:54
• What have you tried? Where did you get stuck? We do not want to just hand you the solution; we want you to gain understanding. However, as it is we do not know what your underlying problem is, so we can not begin to help. See here for tips on asking questions about exercise problems. If you are uncertain how to improve your question, why not ask around in Computer Science Chat? – Raphael Aug 8 '17 at 18:01
• @YuvalFilmus for the first language I wanted to try with the first method but honestly I don't know how to proceed exactly. – PCNF Aug 8 '17 at 18:03
• @fade2black The question as posted is not suited for this site; see e.g. here. Closing as duplicate of the reference question is the most helpful thing to do at this point, and it certainly answers the question "any suggestions?". If you disagree with this long-standing policy, feel free to open a post no Computer Science Meta. – Raphael Aug 8 '17 at 19:05
• Regarding your critique, all reference questions reps. their answers strive to exhibit generally applicable techniques. Of course, every proof is different; however, there are similarities and patterns. "Every problem requires individual approach." -- this is definitely a wrong statement, at least the way I understand it. If it were true, experience would not help you answering such problem statements, but it clearly does. – Raphael Aug 8 '17 at 19:08

I think it is easier to prove if you first note note $$L' = \{a^nb^mc^k|n\leq k \land n,m,k>0\} = \{a^nb^mc^k | n,m,k \geq 1 \} - \{a^nb^mc^k|n>k \land n,m,k>0\}$$ So if $\{a^nb^mc^k|n>k \land n,m,k>0 \}$ is regular then so is $\{a^nb^mc^k|n\leq k \land n,m,k>0\}$ since $\{a^nb^mc^k | n,m,k \geq 1 \}$ is regular and the difference of regular sets is a regular set.

But $L'$ is not regular, a contradiction. If you are NOT convinced that $L'$ is not regular then see the following proof using the Pumping lemma.

So, let's prove that $L' = \{a^nb^mc^k|n\leq k \land n,m,k>0\}$ is not regular using the Pumping lemma in order to obtain contradiction.

The Pumping Lemma:

Let $L$ be a regular set. Then there is a constant $n$ such that if $z$ is any word in $L$, and $|z| \geq n$ we may write $z = uvw$ in such a way that $|uv| \leq n$, $|v| \geq 1$, and for all $i \geq 0$, $uv^iw \in L$.

How to prove

1) Select the language you wish to to prove irregular.

2) The "adversary" picks $n$, the constant mentioned in the Pumping lemma. Once it has been picked, it may not be changed (fix it).

3) Select a string $z$ in $L$. Your choice may depend implicitly on the value of $n$.

We choose $z = a^nb^nc^{n+1}$ (since $n < n+1$, $z \in L$).

4) The "adversary" breaks $z$ into $u$, $v$, and $w$, subject to the constraints that $|uv| \leq n$ and $|v|$.

5) You achieve a contradiction to the pumping lemma by showing that there exists $i$ such that $uv^iw \notin L$.

Since $z = a^nb^nc^{n+1} = uvw$ and $|uv| \leq n$, $uv$ is a string consisting of only $a$s, and so is $v$. If we choose $i=n+2$ then we get $uvvw$ such that $uv^{n+2}w$ has at least $n+2$ $a$s which is greater than $n+1$ $c$s which does not belong to $L'$. But this contradicts to the Pumping lemma.

You may try to prove the second language yourself.