GATE / CS ARCHIVE

GATE CSE 2003 / QUESTION 55

Flipping final states in an NFA

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

GATE 2003, Q55 2 marks · MCQ
Report issue

Finite Automata

Question 55, GATE 2003: An NFA M over {0,1} has states p (start), q and r (only final). Transitions are p→q on 0 or 1; q→p on 0; q→q on 0 or 1; p→r on 1; q→r on 0; r→q on 0. There are no other transitions. Let L=L(M). M1 is obtained by making r nonfinal and p,q final, and L1=L(M1). Which statement is true?
A. L1={0,1}*−L
B. L1={0,1}*
C. L1⊆L
D. L1=L
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

1. Since p is final in M1, ε is accepted.
2. For any nonempty word, choose p→q on its first symbol. Then choose the 0/1 loop at q for every remaining symbol. This accepting run exists for every word.
3. Therefore L1 is the universal binary language, B. In particular ε∈L1 but ε∉L, ruling out C and D. Since 1∈L as well as L1, they are not complements, ruling out A. NFA acceptance is existential over runs, which is why simply flipping finals fails as a complement construction.

Solution: After the flip, the initial left state and the upper-right state are accepting. The empty string is accepted at the initial state. For every nonempty binary string, choose the transition from the initial state to the upper-right state on its first symbol and then use that state’s 0/1 loop for the suffix. Therefore the new language is all of {0,1}*, option B. Flipping final states complements a complete DFA, not a general NFA.

Original paper, page 8