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.
Asked
Active
Viewed 1,230 times
-3
-
4The second link is for the different language where $m$ and $n$ are restricted to be unequal, so it doesn't apply here. – Daniel Schepler Jan 05 '18 at 23:33
-
Could you also help me see why adding that restriction stops it from being a regular language, I have intuition, that if you take y = 0, and pump that you might have a case where the number of 0s and 1s will be same in the string. Thanks. – Swapnil Raj Jan 05 '18 at 23:37
-
5Isn't $0^1^$ trivially a regular expression? – Jack D'Aurizio Jan 05 '18 at 23:43
1 Answers
2
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.
ml0105
- 15,062