patternMinor
Prove if $L = \{0^m1^n \mid m \neq n\}$ is regular or not
Viewed 0 times
midneqregularprovenot
Problem
I am trying to show whether this language is regular or not:
$$L = \{0^m1^n \mid m \neq n\}$$
Since I cannot create or think of an automaton that recognizes $L$, I am suspecting that $L$ is not regular. From the book I am using, it seems I can use the pumping lemma, I have done this:
Let $p$ be the pumping lemma constant, and let $w=0^p1^{p+1}$
In this case
$$|w|=2p + 1\geq p$$
We can divide $w$ into $xyz$, where $x=0^{p-1}$, $y=0$, $z=^{p+1}$, then $|y|\geq 1$
If L was regular, then $\forall k \geq 0, xy^kz \in L$. Let choose $k=2$, then:
$$xyyz=0^{p-1}001^{p+1}=0^{p+1}1^{p+1}$$
Here is where I am stuck, how do I prove that $L$ is not regular?
Another question, pumping lemma applies only to infinite languages?
$$L = \{0^m1^n \mid m \neq n\}$$
Since I cannot create or think of an automaton that recognizes $L$, I am suspecting that $L$ is not regular. From the book I am using, it seems I can use the pumping lemma, I have done this:
Let $p$ be the pumping lemma constant, and let $w=0^p1^{p+1}$
In this case
$$|w|=2p + 1\geq p$$
We can divide $w$ into $xyz$, where $x=0^{p-1}$, $y=0$, $z=^{p+1}$, then $|y|\geq 1$
If L was regular, then $\forall k \geq 0, xy^kz \in L$. Let choose $k=2$, then:
$$xyyz=0^{p-1}001^{p+1}=0^{p+1}1^{p+1}$$
Here is where I am stuck, how do I prove that $L$ is not regular?
Another question, pumping lemma applies only to infinite languages?
Solution
You don't need to invoke the PL directly here. Instead, we'll do a proof by contradiction. Suppose $L$ was regular, then, since regular languages are closed under complement, $\overline{L}$ is regular (where the overbar represents complement), and since regular languages are closed under intersection, $\overline{L}\cap 0^1^$ would be regular (where the regular expression denotes the language $0^1^=\{0^n1^m\mid n,m\ge 0\}$), but $\overline{L}\cap0^1^=\{0^n1^n\mid n\ge 0\}$, which you likely know is not regular, establishing the contradiction we needed. Thus your language isn't regular.
In answer to your other question, the PL generally applies only to infinite languages since you don't know what the PL integer $p$ is, so absent other information, you need an infinite language to be sure that there is some string of length $\ge p$ in the language, regardless of how large $p$ is.
In answer to your other question, the PL generally applies only to infinite languages since you don't know what the PL integer $p$ is, so absent other information, you need an infinite language to be sure that there is some string of length $\ge p$ in the language, regardless of how large $p$ is.
Context
StackExchange Computer Science Q#64056, answer score: 7
Revisions (0)
No revisions yet.