how to prove that a language is regular?
Both mentioned languages are irregular
This can be easily shown for both languages using the pumping lemma
First consider L = {w | w has more as than bs}
Let p be the pumping length then clearly  b^p a^(p+1) is in L and it cannot be pumped
We know that |xy| ≤ p ,and thus x and y will have only bs , then pumping the string for i &gt; 1 , xy^i z will give you a string with bs equal to (for i=2) or more than ( for i &gt;2)  as, since this string cannot be pumped L is irregular
In a similar manner the language with the number of as equal to bs can be shown to be non-regular , consider a^p b^p clearly it has equal number of as and bs , using the same argument as above x and y will have only as and thus pumping the string gives more as than bs and thus this language is also non-regular
Intuitively we know both are irregular since we need to keep count of the number of as and bs to compare them something , and the number of as and bs is not a finite specified number .