grammarlanguage-theory

Is the language of all strings over the alphabet "a,b,c" with the same number of substrings "ab" & "ba" regular?


Is the language of all strings over the alphabet "a,b,c" with the same number of substrings "ab" & "ba" regular?

I believe the answer is NO, but it is hard to make a formal demonstration of it, even a NON formal demonstration.

Any ideas on how to approach this?


Solution

  • It's clearly not regular. How is an FA going to recognize (abc)^n c (cba)^n. Strings like this are in your language, right? The argument is a simple one based on the fact that there are infinitely many equivalence classes under the indistinguishability relation I_l.