Question

What is the complement of the language accepted by the NFA shown below?
Assume Σ={a}\Sigma = \{a\} and ε\varepsilon is the empty string.

NFA with three states: the start state goes to the middle state on a; the middle state is the only accepting state; the middle state goes to the third (non-accepting) state on epsilon, and the third state returns to the start state on epsilon.
Choose one option
Official answer and solution
Official answer
B
From
Official GATE 2012 answer key

Solution

Determine the language accepted by the NFA by tracing paths from start state to final state, then take its complement over the alphabet.

Let us trace the given NFA (states named q0q_0, q1q_1, q2q_2 from left to right):

  • Start state is q0q_0.
  • There is a transition q0→aq1q_0 \xrightarrow{a} q_1.
  • State q1q_1 is the only accepting (double circle) state.
  • There is an ε\varepsilon-transition q1→εq2q_1 \xrightarrow{\varepsilon} q_2.
  • There is a backward ε\varepsilon-transition q2→εq0q_2 \xrightarrow{\varepsilon} q_0.
  1. Language accepted by the NFA:

    • To reach the accepting state q1q_1 from q0q_0, a path must consume at least one 'aa' via q0→aq1q_0 \xrightarrow{a} q_1.
    • Because q0q_0 is not an accepting state and the only way to reach q1q_1 is by reading an 'aa', the empty string ε\varepsilon is not accepted.
    • From q1q_1 the automaton can return to q0q_0 via q1→εq2→εq0q_1 \xrightarrow{\varepsilon} q_2 \xrightarrow{\varepsilon} q_0, allowing another 'aa' to be consumed.
    • Thus, any string containing one or more 'aa's is accepted:
      L={a,aa,aaa,… }=a+L = \{a, aa, aaa, \dots\} = a^+
  2. Complement of LL:
    The alphabet is Σ={a}\Sigma = \{a\}. The universal language is Σ∗=a∗\Sigma^* = a^*.
    The complement of LL is:

    L‾=Σ∗−L=a∗−a+={ε}\overline{L} = \Sigma^* - L = a^* - a^+ = \{\varepsilon\}

This matches option (B).

Final answer

B

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

Source

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