Given below are the transition diagrams for two finite state machines $M_1$ and $M_2$ recognizing languages $L_1$ and $L_2$ respectively.
Display the transition diagram for a machine that recognizes $L_1.L_2$, obtained from transition diagrams for $M_1$ and $M_2$ by adding only $\varepsilon$ transitions and no new states.
Modify the transition diagram obtained in part (a) obtain a transition diagram for a machine that recognizes $(L_1.L_2)^*$ by adding only $\varepsilon$ transitions and no new states.
(Final states are enclosed in double circles).
@yuyutsu That’s correct.
@yuyutsu one small mistake in b part is for state C there must be one self loop for alphabet a.
@yuyutsuin part A in your solution state A wouldn’t be a final state.
We can combine the final state of $M_1$ with the start state of $M_2$ as follows recognizing $L_1L_2$. But before we combine $M_1$ and $M_2$ remove the final state of $M_1$ as the new machine can accept $L_1$ also while it should accept only $L_1.L2$.
~Pic by Praveeen Saini
language L1L2 has a DFA where start of M1 is start, final states of M2 are final states. When we reach to final of M1, it is connect with start of M2.
when we remove ^-transition from it we get the DFA given in part A.
for second part (L1.L2)*
@Spider1896 actually we convert multiple final states into one final state using epsilon transition, and to compute L* for a language L, we use two another epsilon transitions one from start state to final state and second from final state to start state. @Shubhgupta when build DFA for two languages L1 and L2 such as L1.L2 then we make all the final states into non-final of first DFA which accepts L1, and connect epsilon transitions from each final state in DFA1 to initial state of DFA2.
I think there are 4 epsilon- transition of the (L1.L2)*.
AC & AD are 2 way. so total 4
according to protocol what chauhansunil20th said is correct.
here is part b of this question we need to add 3 more e-transition.
C to A, A to D, D to A
@MRINMOY_HALDER Why A to D null transition is required ?
@Arjun, Hi sir, i had a doubt, L2 can also accept epsilon as C is a final state so (L1*L2) = L1 when L2 is epsilon, so the resulting automata should accept only L1 also then why did you make A as a non-final state.
So, both languages contain epsilon,hence L1.L2 will also contain epsilon. I think, in given solution diagram,state-A should also be the final state.
Please varify it @arjun sir and correct me.
Source: https://courses.engr.illinois.edu/cs373/sp2009/lectures/lect_06.pdf (Page-5)
For any integer n ≥ 2, let A be an n-state NFA that accepts a star-free language. Then n + 1 states are sufficient for an NFA to accept the Kleene star of the language of A.
Let L a language accepted by an n-state DFA. Then the minimal DFA for the language L* has at most 3/4·(2^n) states.
Hence the complexity will be linear in case of NFAs, while exponential in case of DFAs.
Source: https://core.ac.uk/download/pdf/82169573.pdf (Page-7)
http://ceur-ws.org/Vol-1003/94.pdf (Page-3)
by adding null transition in answer selected from state D to state AC
@Praveen Saini Sir I don’t think we need to make D--∈-->C, as it’s concatenation (L1.L2)* and not (L1∪L2)*. So the ∈ transitions will be from C->A and D->A i.e. Final states to Initial state. Correct me if I’m wrong.
the regular expression for L2 = { a^n.b.b^n | n >=0 } therefore, smallest possible string that L2 can generate is ‘”b “(not epsilon) and, it is epsilon in case of L1. As, (epsion).(b) = b.
the regular expression for
L2 = { a^n.b.b^n | n >=0 }
therefore, smallest possible string that L2 can generate is ‘”b “(not epsilon)
and, it is epsilon in case of L1.
As, (epsion).(b) = b.
therefore ,, initial state cannot be an accepting state
64.3k questions
77.9k answers
244k comments
80.0k users