Question

Consider the finite automaton in the following figure.

Non-deterministic finite automaton with four states q0, q1, q2, and q3

What is the set of reachable states for the input string 0011?

Choose one option
Official answer and solution
Official answer
A
From
Official GATE 2014 answer key

Solution

Trace the execution of the NFA for the input string '0011' step by step, tracking the set of reachable states.

The initial state is {q0}\{q_0\}.

  1. Input symbol '0':

    • From q0q_0, on '0' there is only a self-loop back to q0q_0.
    • Set of reachable states: {q0}\{q_0\}.
  2. Input symbol '0':

    • From q0q_0, on '0' self-loop stays at q0q_0.
    • Set of reachable states: {q0}\{q_0\}.
  3. Input symbol '1':

    • From q0q_0, on '1' the automaton can take the self-loop back to q0q_0, or take the transition to q1q_1.
    • Set of reachable states: {q0,q1}\{q_0, q_1\}.
  4. Input symbol '1':

    • From q0q_0, on '1' can go to q0q_0 (self-loop) or q1q_1 (transition).
    • From q1q_1, on '1' transitions to q2q_2.
    • Union of reachable states: {q0,q1,q2}\{q_0, q_1, q_2\}.

Note that q3q_3 is not reachable because reaching q3q_3 from q2q_2 requires an input transition after being in q2q_2.

Thus, the set of reachable states is {q0,q1,q2}\{q_0, q_1, q_2\}.

Final answer

A

Common trap

Assuming the transition from q2q_2 to q3q_3 occurs immediately on the same symbol that reached q2q_2.

The answer is the one in the official GATE answer key. The solution is this site's own explanation.

Source

Paper
GATE 2014 Computer Science and Information Technology (CS) Session 1
Question
26 of 65, printed as CS Q.16
Section
Computer Science and Information Technology

Report an error in this question

GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.