GATE / CS ARCHIVE

SIMILAR QUESTIONS / THEORY OF COMPUTATION

Trace a word through nondeterministic reachable sets

2 questions solved the same way, newest first. Back to Theory of Computation

How these are solved

Start from the initial state set, take epsilon closure where present, and advance all reachable states for each symbol before testing acceptance.

2 marks · MCQ
Report issue

Finite Automata

Question 39, GATE 2017: An ε-NFA has transition table (ε,a,b): q0→({q2},{q1},{q0}); q1→({q2},{q2},{q3}); q2→({q0},∅,∅); q3→(∅,∅,{q2}). Compute the extended transition from q2 on aba. A:∅. B:{q0,q1,q3}. C:{q0,q1,q2}. D:{q0,q2,q3}.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

Step through it (4 steps)

1. Begin with ε-closure({q2}), not just {q2}. The ε edge reaches q0, whose ε edge returns to q2, so the starting set is {q0,q2}.

2. Read the first a: only q0 has an a transition, to q1. The ε-closure of q1 adds q2 and q0, giving {q0,q1,q2}. Read b next: q0 goes to q0 and q1 to q3; q2 has no b move. Closing {q0,q3} under ε adds q2, giving {q0,q2,q3}.

3. Read the final a: only q0 contributes q1. Its ε-closure is again {q0,q1,q2}, option C. Applying ε-closure both before input and after every consumed symbol is essential; ε transitions do not consume letters of aba.

Original paper, page 15 · Answer key

1 mark · MCQ
Report issue

Finite Automata

Question 16, GATE 2014: An NFA starts at q₀ and has accepting state q₃. Its transitions are q₀→q₀ on 0 or 1; q₀→q₁ on 1; q₁→q₂ on 0 or 1; q₂→q₂ on 1; q₂→q₃ on 0 or 1. There are no other transitions. Which states are reachable after reading 0011? A: {q₀,q₁,q₂}. B: {q₀,q₁}. C: {q₀,q₁,q₂,q₃}. D: {q₃}.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

1. Method and setup. Track a set of active states after each symbol; an NFA can follow several transitions at once. Each update uses only the states active before that symbol, so a newly reached q₂ cannot immediately take another transition on the very same input symbol. Acceptance is separate from the requested reachable-state set.

2. Work through the result and its assumptions. Starting at{q0}, the two zeros leave{q0}. The first 1 yields{q0, q1}; the second 1 yields{q0, q1, q2}. No q2 was reached early enough to enter q3. Thus A.

Original paper, page 11 · Answer key