This question already has an answer here:

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)$.


marked as duplicate by Raphael Jul 14 '16 at 6:11

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 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$ – Hendrik Jan Jul 14 '16 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 Jul 14 '16 at 7:02