Concatenation of unknown language

29 Views Asked by At

$$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?

1

There are 1 best solutions below

0
On

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.