# Prove by contradiction that the language with unequal number of a's and b's is not regular

Consider the language $$L = \{w \mid w \text{ has an unequal number of a’s and b’s}\}$$ where Σ = {a, b}. Prove that L is not regular. Hint: Try proof by contradiction.

Would this be the right Answer:

L = {a^m b^n | m < n} U {a^m b^n | m > n}

Looking at this we can tell that a is more than b or a is less than b. They depend on each other. Thus we can tell that language L is not regular, because we can conclude dependency. Dependency needs a stack to compare to one another. Finite automata does not have a stack.

• These two $L$s are not equivalent. For instance $aba$ is in the first one but not the second one. Try to consider closure properties to tackle this question. Apr 24 at 10:25

Anyways, try to think of $$L^c$$ (the complement of $$L$$). Is this language regular? What is the connection between $$L^c$$ and $$L$$ in those terms?