Automata - Prefix

130 Views Asked by At

Assume we have $L=\{ab\}$, then is it correct to say that $\mathbb{prefix}(L)=\{\epsilon,a,b,ab\}$ ?

I mean - is epsilon included in every prefix?

If I have $L=\{a^*a\}$, then in this case $\mathbb{prefix}(L)=\{a^*,a^*a\}$ ?

Thanks a lot!

1

There are 1 best solutions below

0
On

The first part is incorrect since $b$ is not a prefix of $ab$. The correct answer is $\{\varepsilon, a, ab\}$.

For the second part, your writing $L = \{a^*a\}$ does not make sense. It should be $L = a^*a$ and $\text{prefix}(L) = a^*$.