Can the union of two non-regular languages be regular?? I have $L_1 = \{a^i b^j \mid i > j\}$ and $L_2 = \{a^i b^j \mid i < j\}$. I am using Pumping lemma with $s = a^{p+1} b^p$ for $L_1$ and $s = a^p b^{p-1}$ for $L_2$ and the two are non-regular but I am
not sure that is correct.
[Math] Union of two non-regular languages.
pumping-lemmaregular-language
Related Question
- [Math] Pumping Lemma proof and the union/intersection of regular and non-regular languages
- [Math] DCFL are closed under Intersection with Regular Languages
- [Math] $L_1$ is a regular language, $L_2$ is a non-regular language, the intersection $L_1 \cap L_2$ is finite language
- Automata – Pumping Lemma for Union of Regular Languages
Best Answer
Union of two non-regular languages may or may not be non-regular. It may be regular.
Let us assume two Non-regular languages $L_1 = \{a^ib^j|i>=j\}$ and $L_2 = \{a^ib^j|i<j\}$ where $ i,j\ge 0$. But their union is $L = L_1 \cup L_2 = \{a^*b^*\}$, which is regular.