Let L1 and L2 be the regular languages over the alphabet {a,b}. We define the language L3 as follows:
L3 = {pqr | pr ∈ L1, q ∈ L2}
L3 is obtained by inserting a string from L2 inside a string from L1. Is language L3 is still regular or not?
I am trying to solve this problem. Is it possible to prove this using string substitution property or homomorphism of regular language? Is there any better and easier way to prove this?
Here is a high-level description of a construction to show there is an NFA accepting L3.
Let M1 and M2 be minimal DFAs such that L(M1) = L1 and L(M2) = L2. Copy M1 so there are two copies, M1[1] and M1[2]. Copy M2 so there are |Q1| copies M2[1], M2[2], …, M2[|Q1|]. Also, number the states q1, q2, …, q|Q1| of M1. Now construct an NFA for M3 as follows:
This NFA reads some input and then nondeterministically jumps to an instance of M2. It then reads a string in M2 and jumps back to where it left off in the next copy of M1 where it can accept. This NFA has a number of states equal to 2|Q1| + |Q1| * |Q2|.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With