$$If \space L_1L_2\space is \space regular, then \space L_2L_1 \space is\space regular$$
Is this statement correct? I can't seem to find any counter example. Besides, what is a good way of tackling this kind of problem?
Asked
Active
Viewed 28 times
1
Louis Kuang
- 293
1 Answers
3
Let $L_1=\{ba^*\}$, $L_2=\{a^nb^nb^* \mid n\geq 0\}$ ($L_2$ is the language such that number of $b$ needs to be larger than number of $a$, so $L_2$ is not regular)
Then $L_1L_2=\{ba^*b^*\}$ is regular and $L_2L_1=\{a^nb^{n+1}b^*a^*\mid n\geq 0\}$ is not regular.
cr001
- 12,598