If $f$ is a function of integers, define $f(L)$ to be $$ \{w \mid \text{for some $x$, with $|x| = f(|w|)$, we have $wx$ in $L$}\}. $$
Show that if $L$ is a regular language, then so if $f(L)$, if $f$ is one of the following functions:
- $f(n)=n^2$ (i.e., the amount we take has length equal to the square root of what we do not take)
- $f(n)=2^n$
This is a question from John Hopcroft's Introduction to Automata Theory, that is, Exercise 4.2.9. And I find it hard to construct a automata like what we do in this question.