Is $0^m1^n$ a regular language?

1k Views Asked by At

A language is defined as $w = \{ 0^m1^n \mid m, n \in \Bbb N \}$. Is this a regular language? I have seen people proving for both the sides.

Thread saying it is regular

Proof for it being non-regular

1

There are 1 best solutions below

0
On

The language $L = \{ 0^{m}1^{n} : m, n \in \mathbb{N} \}$ is given by the regular expression $0^{*}1^{*}$, which Jack D'Aurizio pointed out.

Now the language $L^{\prime} = \{0^{m}1^{n} : m \neq n \}$ is not regular. To see this, we use the fact that regular languages are closed under the set difference operation. Suppose to the contrary that $L^{\prime}$ is regular. Then: $$0^*1^* \setminus L^{\prime} = \{ 0^{n}1^{n} : n \in \mathbb{N} \}$$

Is also regular. However, we know that $\{0^{n}1^{n} : n \in \mathbb{N} \}$ is not regular, a contradiction. So $L^{\prime}$ is not regular.