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.
2026-03-25 10:52:15.1774435935
Union of two non-regular languages.
13.1k Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail At
2
Let $L$ be any non-regular language. Then observe that its complement is also non-regular. Their union is the set of all strings, which is regular.
The two languages you gave also work. Let $L_1=\{a^ib^j|i>j\}$ and $L_2=\{a^ib^j|i<j\}$. Once you've proven that $L_1$ is not regular, it also follows that $L_2$ is not regular: the reason is that regular languages are closed under reversal: if $L$ is regular, so is $\{rev(x)|x \in L\}$. If $L_2$ were regular, then $rev(L_2)$ would be regular and this is just $L_1$ with $a$s and $b$s swapped.