Question

Let δ\delta denote the transition function and δ^\hat{\delta} denote the extended transition function of the ϵ\epsilon-NFA whose transition table is given below:

δ\delta ϵ\epsilon aa bb
→q0\to q_0 {q2}\{q_2\} {q1}\{q_1\} {q0}\{q_0\}
q1q_1 {q2}\{q_2\} {q2}\{q_2\} {q3}\{q_3\}
q2q_2 {q0}\{q_0\} ∅\emptyset ∅\emptyset
q3q_3 ∅\emptyset ∅\emptyset {q2}\{q_2\}

Then δ^(q2,aba)\hat{\delta}(q_2, aba) is

Choose one option
Official answer and solution
Official answer
C
From
Official GATE 2017 answer key

Solution

Compute the extended transition function δ^(q2,aba)\hat{\delta}(q_2, aba) by computing ϵ\epsilon-closures at each step.

First, compute ϵ-closure\epsilon\text{-closure} of the starting state q2q_2:

  • q2→ϵq0q_2 \xrightarrow{\epsilon} q_0
  • q0→ϵq2q_0 \xrightarrow{\epsilon} q_2
    Thus, ϵ-closure(q2)={q0,q2}\epsilon\text{-closure}(q_2) = \{q_0, q_2\}.

Now trace the string abaaba symbol by symbol:

  1. Read first symbol 'aa':
    • δ(q0,a)={q1}\delta(q_0, a) = \{q_1\}
    • δ(q2,a)=∅\delta(q_2, a) = \emptyset
      Union of transitions: {q1}\{q_1\}.
      Now compute ϵ-closure({q1})\epsilon\text{-closure}(\{q_1\}):
    • q1→ϵq2→ϵq0q_1 \xrightarrow{\epsilon} q_2 \xrightarrow{\epsilon} q_0
      So ϵ-closure({q1})={q0,q1,q2}\epsilon\text{-closure}(\{q_1\}) = \{q_0, q_1, q_2\}.
  2. Read second symbol 'bb' from {q0,q1,q2}\{q_0, q_1, q_2\}:
    • δ(q0,b)={q0}\delta(q_0, b) = \{q_0\}
    • δ(q1,b)={q3}\delta(q_1, b) = \{q_3\}
    • δ(q2,b)=∅\delta(q_2, b) = \emptyset
      Union of transitions: {q0,q3}\{q_0, q_3\}.
      Now compute ϵ-closure({q0,q3})\epsilon\text{-closure}(\{q_0, q_3\}):
    • ϵ-closure(q0)={q0,q2}\epsilon\text{-closure}(q_0) = \{q_0, q_2\}
    • ϵ-closure(q3)={q3}\epsilon\text{-closure}(q_3) = \{q_3\}
      So current states after 'abab' are {q0,q2,q3}\{q_0, q_2, q_3\}.
  3. Read third symbol 'aa' from {q0,q2,q3}\{q_0, q_2, q_3\}:
    • δ(q0,a)={q1}\delta(q_0, a) = \{q_1\}
    • δ(q2,a)=∅\delta(q_2, a) = \emptyset
    • δ(q3,a)=∅\delta(q_3, a) = \emptyset
      Union of transitions: {q1}\{q_1\}.
      Now compute ϵ-closure({q1})={q0,q1,q2}\epsilon\text{-closure}(\{q_1\}) = \{q_0, q_1, q_2\}.

Therefore, δ^(q2,aba)={q0,q1,q2}\hat{\delta}(q_2, aba) = \{q_0, q_1, q_2\}, matching option C.

Final answer

C

Common trap

Forgetting the initial ϵ\epsilon-closure of state q2q_2 before reading the first input symbol 'aa'.

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

Source

Paper
GATE 2017 Computer Science and Information Technology (CS) Session 2
Question
39 of 65, printed as CS Q.39
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.