Showing that language $L^{'}$ is regular given $L$ is regular

45 Views Asked by At

Say $L \subseteq \{a,b\}^*$ is a regular language with words whose length is divisible by 3. Each word $w \in L$ has the form $w=xyz$ with $|x|=|y|=|z|$, where $y$ is then called the middle third of $w$.

I want to show that the language

$$L^{'}=\{y \in \{a,b\}^*:y \text{ is the middle third of a word } w \in L\}$$

is regular.

I could think of a description of language $L$ with the regular expression $((a+b)(a+b)(a+b))^*$. Would this be correct?

Unfortunately, I have no idea how to start to show that $L^{'}$ is regular. Could you please give me some hints to get started? I'd like to know how to solve this problem using an automaton, e.g. a NFA.

Thank you very much in advance.