I read the $L$ is a Regular language. Define $L'$ as following:
$$L'=\{a_2a_1a_4a_3\ldots a_{2n}a_{2n-1}\mid a_1a_2\ldots a_{2n} \in L\}.$$
why $L'$ is Regular?
any hint or idea would be highly appriciated.
I read the $L$ is a Regular language. Define $L'$ as following:
$$L'=\{a_2a_1a_4a_3\ldots a_{2n}a_{2n-1}\mid a_1a_2\ldots a_{2n} \in L\}.$$
why $L'$ is Regular?
any hint or idea would be highly appriciated.
Copyright © 2021 JogjaFile Inc.
Let $A$ be the alphabet and let $B = \{[a_1a_2] \mid a_1, a_2 \in A \} $. Let $\alpha, \beta: B^* \to A^*$ be the monoid homomorphisms defined by $\alpha([a_1a_2]) = a_1a_2$ and $\beta([a_1a_2]) = a_2a_1$, for each letter $[a_1a_2]$ of $B$. Now $L' = \beta(\alpha^{-1}(L))$. Since regular languages are closed under homomorphisms and inverses of homomorphisms, $L'$ is regular.
Note. The same proof shows that if $L$ is context-free, then $L'$ is context-free.