Prove that injection of 0 or 1 in strings of regular lang > regular lang

74 Views Asked by At

Let $Σ = \{0, 1\}$. For a language $L$ over $Σ$, consider the language $$\text{INS}(L) = \{u0v \mid uv \in L\} \cup \{u1v \mid uv ∈ L\}.$$ For example, if $L = \{1, 01, 0010\}$ then $\text{INS}(L)$ contains, for example $01010$, which can be obtained using $u = 0$ and $v = 010$, and so on. Show that if $L$ is a regular language then $\text{INS}(L)$ is also regular.

I've been stuck on this for quite a while.

1

There are 1 best solutions below

1
On

Well, take an accepting automaton A for the language $L$.

Then the accepting automaton $A'$ for the language $L'=INS(L)$ is given as follows:

1) Take the automaton $A$ and the starting state of $A$ is the starting state of $A'$.

2) Take the ending states of $A$ in $A'$ and extend the ending states by the transitions $\stackrel{0}{\rightarrow}$ and $\stackrel{1}{\rightarrow}$ and connect them to the starting state of another copy of $A$.

3) The ending states of the second copy of $A$ are the ending states of $A'$.

So the automaton $A'$ looks as follows

$$\rightarrow A \stackrel{0/1}{\rightarrow} A.$$