Is Shuffling of a regular language regular too?

78 Views Asked by At

If $A$ be regular language, How we can prove that $A^{'}$ is regular too?

$A^{'} = \{a_{2}a_{1}a_{4}a_{3} ... a_{2n}a_{2n-1} \mid a_{1}a_{2}a_{3}...a_{2n} \in A\}$

Is there any way to prove that even/odd part of a regular language is regular?

$W = a_{1}a_{2}a_{3}...a_{2n} \in A$

$even(W) = a_{2}a_{4} ... a_{2n}$

$odd(W) = a_{1}a_{3}...a_{2n-1}$

NOTE: I know the shuffling of two regular language is regular. e.g. if $A$ and $B$ languages are regular then $C$ is regular too:

$A=\{w \mid w = a_{1} a_{2}...a_{k}\}$

$B=\{w \mid w = b_{1} b_{2}...b_{k}\}$

$C=\{w \mid w = a_{1}b_{1} a_{2}b_{2}...a_{k}b_{k}\}$

1

There are 1 best solutions below

0
On

Let $L$ be a regular language on the alphabet $A$ and let $B = A^2$. For instance, if $A = \{a, b\}$, then $B = \{aa, ab, ba, bb\}$. Let $f, g: B^* \to A^*$ be the monoid homomorphisms defined by $f(a_1a_2) = a_1a_2$ and $g(a_1a_2) = a_2a_1$, respectively. I claim that $$ L' = f\bigl(g^{-1}(L \cap (A^2)^*)\bigr) $$ Since regular languages are closed under intersection, homomorphisms and inverse homomorphisms, this shows that $L'$is regular.

To prove the claim, take a word $u$ of $L \cap (A^2)^*$. Then $u$ is a word of even length, say $u = a_1a_2 \dotsm a_{2n-2}a_{2n}$. Now $g^{-1}(u) = [a_2a_1][a_4a_3] \dotsm [a_{2n}a_{2n-1}]$, where each $[a_{2i}a_{2i-1}]$ is a letter of $B$. Finally $f(g^{-1}(u)) = a_2a_1a_4a_3 \dotsm a_{2n}a_{2n-1}$.