0

Suppose I have a DFA recognizing a regular language $L$, how do I prove that $$\text{lefthalf}(L)= \{ w_1 \mid \exists w_2 \in \Sigma^* ,w_1w_2 \in L \land \|w_1\| = \|w_2\| \}$$ is also a regular language?

Raphael
  • 73,212
  • 30
  • 182
  • 400
xiamx
  • 221
  • 1
  • 6

2 Answers2

1

Hint: while reading $w_1$, guess $w_2$ and gather enough information so that in the end you can decide whether $w_1 w_2 \in L$.

Yuval Filmus
  • 280,205
  • 27
  • 317
  • 514
1

Hint: while reading $w_1$, guess $w_2$ from the end, and see where you meet in the middle. Thus you can take as the set of states a subset of $Q^2$.

Tpecatte
  • 361
  • 1
  • 7