GATE / CS ARCHIVE

GATE CSE 1996 / QUESTION 12(a)

Concatenate two finite automata

Theory of Computation · Finite Automata · Full GATE CSE 1996 paper

GATE 1996, Q12(a) Descriptive
Report issue

Finite Automata

Question 12(a), GATE 1996: M1 has states A(start,final),B(nonfinal), with A→B and B→A on either 0 or 1. M2 has C(start,final),D(final),E(nonfinal): C loops on a, C→D on b, D loops on b, D→E on a, and E loops on a,b. Construct an ε-NFA recognizing L1L2 using no new states and only added ε-transitions.
Question 12(a), GATE 1996: M1 has states A(start,final),B(nonfinal), with A→B and B→A on either 0 or 1. M2 has C(start,final),D(final),E(nonfinal): C loops on a, C→D on b, D loops on b, D→E on a, and E loops on a,b. Construct an ε-NFA recognizing L1L2 using no new states and only added ε-transitions.
Question 12(a), GATE 1996: M1 has states A(start,final),B(nonfinal), with A→B and B→A on either 0 or 1. M2 has C(start,final),D(final),E(nonfinal): C loops on a, C→D on b, D loops on b, D→E on a, and E loops on a,b. Construct an ε-NFA recognizing L1L2 using no new states and only added ε-transitions.
Question 12(a), GATE 1996: M1 has states A(start,final),B(nonfinal), with A→B and B→A on either 0 or 1. M2 has C(start,final),D(final),E(nonfinal): C loops on a, C→D on b, D loops on b, D→E on a, and E loops on a,b. Construct an ε-NFA recognizing L1L2 using no new states and only added ε-transitions.
Tap to enlarge
Answer & solution

Answer: Use start A, final states C,D; add A→C on ε, retaining every original transition. (no official key was published)

M1 accepts binary strings of even length: each 0 or 1 toggles A and B, and A is accepting. M2 accepts a*b*: it stays at C through a's, moves to D at the first b, and a later a leads to rejecting sink E. Both languages contain ε.

For concatenation, retain all original symbol-labelled edges and add A→C on ε, because A is the only accepting state of M1 and C is the initial state of M2. The combined machine has just one initial state, A. Its accepting states are C and D, the former accepting states of M2. A is no longer designated accepting, although ε is still accepted via the new ε-edge to C. B and E remain nonaccepting.

Any accepting run first follows a run of M1 ending at A, then uses the ε-edge and follows an accepting run in M2. The consumed string therefore factors as uv with u∈L1 and v∈L2. Conversely every such factorization gives an accepting run. This proves equivalence rather than just providing a diagram recipe.

Text diagram addition: A --ε--> C. Initial/final annotations must be updated as stated; “only add ε-transitions” refers to edges and state count, not to keeping two independent initial-state markings. No new states or symbol transitions are required.

Original paper, page 8