1

I'm struggling a bit to understand two of the problems we were given in class. Could someone look over my work and maybe give me a few hints?

State whether the following languages are regular or not and prove your answer. $$\{0^n1^m \mid m \geq 0 \text{ and } n = 2m+1\}$$ $$\{0^a1^b0^c \mid 0 \leq a \leq b \leq c \leq 100\}$$

The first one appears to me as non-regular as $m$ is not finite. Then to prove that it is not regular, I used the pumping lemma method with $0^P1^\frac{P-1}{2}$ as the string.

For the second language, I'm not really sure if it is regular or not. I can't come up with a DFA/NFA/RegExp for it nor can I figure out how to apply the pumping lemma method to it. Is it safe to use $0^P1^P0^P$ as the string and say that if $Y$ where $Y = 0^k, 1 \leq k \leq P$ is appears more than once (i.e. $XYYZ$), the resulting string is not in the language and thus the language is not regular?

Edit: I'm sorry if this question seems elementary. I've already read through most of the posts pertaining to this topic and some things were unclear to me. I was asking for someone to look over my work and make sure I followed the correct procedures. For instance, I'm still confused on the second question. The pumping lemma I used makes it seem like it is not regular but at the same time it is finite. Does that mean I used pumping lemma incorrectly? In what way did I use it incorrectly?

MrDiggles
  • 131
  • 1
  • 5
  • yes both these languages are nonregular, and this can be shown with pumping lemma. – Denis Feb 23 '14 at 02:10
  • Was my usage of pumping lemma correct? – MrDiggles Feb 23 '14 at 03:25
  • Voting to close - this is covered by our reference question. – Yuval Filmus Feb 23 '14 at 04:08
  • 1
    Second language is finite, isn't it? – Karolis Juodelė Feb 23 '14 at 05:51
  • oups yeah didn't see the bound 100, second language is finite hence regular. – Denis Feb 23 '14 at 12:32
  • If the second language is finite and thus regular, then what did I do wrong with the pumping lemma? – MrDiggles Feb 23 '14 at 22:42
  • 1
    @user45894 It's not safe to use $0^p1^p0^p$ as your string because, for large enough $p$ ($p>100$), that string isn't in the language. The pumping lemma says that there exists a $p$ such that every string $w\in L$ with $|w|\ge p$ can be written as [blah]. Every string in your second language has length at most 300 so the pumping lemma is trivially satisfied for $p=301$: there are words $w\in L$ with $|w|\ge301$ so none of them can fail to satisfy the property [blah]. – David Richerby Feb 24 '14 at 00:32
  • @DavidRicherby Oh ok. Thank you for the clarification. – MrDiggles Feb 24 '14 at 02:16
  • The second language is finite (all of $a$, $b$, $c$ are limited), so it is regular. – vonbrand Feb 24 '14 at 14:27
  • For the first part, I'd use $a^{2 p + 1} b^p$ directly. Better use some simple expression, you only need the string to be longer than $p$. – vonbrand Feb 24 '14 at 19:36

0 Answers0