Consider this function:
Faro(x,z) that assume value: z if x = ε and a.faro(z,y) if x = ay
So is a recursive function, and for instance we have as result of faro(00110, 0101) = 000110110
I have to demonstrate that if L and M are regular language on the same alphabet we have that faro(L,M) = {faro(x,z) | x is on L and z is on M} is regular.
I'm not sure which is the best method to demonstrate the result. I'm now studying this type of problem for the first time.
Is more convenient to create a DFA or use the pumping lemma?
It looks like what's going on here is that the faro function takes two strings and interleaves them: faro(a1a2a3...an, b1b2b3...bm) = a1b1a2b2a3b3...anbn...bm (assuming w.l.o.g. m >= n).
If you can demonstrate that semantic fact about the faro function to your and others' satisfaction, then producing a NFA that does the same thing seems to be within reach:
When you see symbol a in state (q, q', L), then go to states (w, q', M) and (w, q', L'), where L's DFA transitions from q to w on a. This means we can either accept the next interleaved symbol of the string from M, or we can just read the rest of the string from L without a possibility of taking any more of the string from M
When you see symbol a in state (q, q', M), go to states (q, w', L) and (q, w', M'), similar to above
When you see symbol a in state (q, q', L'), go to state (w, q', L'); remember, L' means we gave up on reading interleaved symbols from the string in M
When you see symbol a in state (q, q', M'), go to the state (q, w', M'), similar to the above
This is an NFA so if at least one path through accepts, the string is accepted. This is as it should be since if a string can be interpreted as some result of faro(x, y) for x in L and y in M, our NFA should accept it. Our NFA works by keeping track of:
I think the next steps are probably doing a couple of simple examples to see whether this construction works and, if so, then proceeding to prove that this NFA's language is the one desired (a proof by induction would be a good idea here). Once you prove there's an NFA for your language, you're done.