Given a regular language $L \subseteq \sum^*$ prove that the language

$half(L) = \{w \space | \space ww \space \in \space L \}$

is also a regular language.


Please give a hint or two. Have thought about it a lot already.


While trying to make one for $half(L)$, I came up with a DFA which uses the DFA for $reverse(L)$, but that one, it turns out, accepts a different regular language called $reflect(L) = \{w \space | \space ww^R \in L\}$. The idea was to make a DFA by first making an NFA using the standard "first reverse transitions, add new start state, make previous start state the sole accept state, etc." technique. Then we make a DFA where the states are a pair of the states of the original DFA and this reverse(L) DFA's states. However, I won't digress into that because this doesn't accept $half(L)$.

  • 2
    $\begingroup$ This closure property came already up under another name in a previous question: cs.stackexchange.com/questions/41281/… It has no answer, but one of the comments there links to an answer on math.se $\endgroup$ Commented Jul 14, 2016 at 6:08
  • 1
    $\begingroup$ Oh I see. Thanks. And 'square-root' seems a better name for this language indeed. I was using Jeff Erickson's book where he uses 'half' instead of this. 'half' is perhaps better for the other language he calls 'left'. (I think it all this terminology just stems from using '.' for concatenation of strings as well as multiplication for numbers) $\endgroup$
    – slnsoumik
    Commented Jul 14, 2016 at 7:02