1

Show if $L = \{a^mb^nc^n \mid m,n \geq 0\} \cup \{b,c\}^*$ is regular or not.

My attempt:

I think the Pumping lemma won't work in that constellation, so I'm working with "The intersection of regular languages is regular".

Assuming $L$ is regular. I already know that $S=\{ab^* c^*\}$ is regular. I'll now look at the intersection $L \cap S$.

$$(\{a^mb^nc^n \mid m,n \geq 0\}\cap \{ab^* c^*\}) \cup (\{b,c\}^*\cap \{ab^* c^*\})$$ $$\{ab^nc^n \mid n \geq 0\} \cup \emptyset = \{ab^nc^n \mid n \geq 0\}$$

Which is not regular according to Pumping lemma. Is this idea correct?

Quotenbanane
  • 157
  • 7
  • 1
    Yes your idea is correct and is a good way to go. Just a detail: $S$ should be defined as $S = ab^c^$, not $S = {ab^c^}$ (or maybe $S = {a}{b}^{c}^$ if you want to show the difference between regular expression and language). – Nathaniel Mar 20 '21 at 19:34
  • @Nathaniel yes, I should better write like you suggested. Thank you. (If you had an answer I'd tick it) – Quotenbanane Mar 20 '21 at 22:10
  • 1
    I just confirmed your thoughts, it's okay if I don't get an upvote :-) – Nathaniel Mar 21 '21 at 00:29
  • We discourage "Please check whether my answer is correct" questions, as they are unlikely to be useful to others in the future. – D.W. Mar 21 '21 at 02:31
  • @D.W. But if I don't include my own work, people will tell me to do so or say something like "If you don't include your own work, it looks like you're looking for someone to do your homework" – Quotenbanane Mar 21 '21 at 12:04
  • That's true too! Neither of those is a great fit for this site. Part of our mission is to build up an archive of high-quality questions and answers that will be useful not only to you but also to others in the future. Neither "what's the solution to this one exercise?" nor "is my solution to this one exercise correct?" fit that goal very well. Exercises exist to help you get practice and spot whether there are concepts you are unclear on. – D.W. Mar 21 '21 at 17:09
  • One pattern that works well here is to ask about a specific conceptual issue you're uncertain about. As a rule of thumb, a good conceptual question should be useful even to someone who isn't looking at the problem you happen to be working on. One could ask an unending stream of questions of the form "prove this language is not regular"; we've already described the general techniques at https://cs.stackexchange.com/q/1031/755, and I'm not sure there's a lot of use to ask one question about every possible instantiation of that general pattern. – D.W. Mar 21 '21 at 17:10
  • @D.W. OK thanks, I'll remember that. – Quotenbanane Mar 28 '21 at 18:05

2 Answers2

0

Pumping lemma works easily. Somewhere it says "if the language is regular then for every string in the language..." Just check the pumping lemma for strings that start with exactly one a.

gnasher729
  • 29,996
  • 34
  • 54
0

There are stronger versions of the pumping lemma that do apply directly to your language. For example, Wikipedia describes the following pumping lemma:

If $L$ is regular then there is a constant $p$ such that any word $uwv \in L$, where $|w| \geq p$, can be decomposed as $uxyzv$ so that (i) $|xy| \leq p$, (ii) $y \neq \epsilon$, (iii) $uxy^tzv \in L$ for all $t \geq 0$.

Using this, let us prove that your language is not regular. Let $p$ be the constant promised by the lemma. Take the word $ab^pc^p$, where $u = a$, $w = b^p$, $v = c^p$. According to the lemma, we can decompose $w = xyz$ in such a way that $y \neq \epsilon$ and $uxy^tzv \in L$ for all $t \geq 0$. However, if $y = b^q$ then $uxy^0zv = ab^{p-q}c^p \notin L$, since $q \neq \epsilon$.

There should be an even stronger pumping lemma along the lines of Ogden's lemma, which is a strong analog of the pumping lemma for context-free languages. You can formulate and prove it, if you wish.

Yuval Filmus
  • 276,994
  • 27
  • 311
  • 503