GateAI
Regular Expressions and Finite Automata

GATE CSE 2012 · Q12

MCQ1 markMedium

Time

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

GATE CSE 2012 Q12 diagram

Select one answerSingle correct

Pick an option to check

Solution

Step-by-step verified solution

Official answer: B) { }

Regular Expressions and Finite Automata

Let us analyze the language accepted by the given NFA:

  1. The start state (leftmost) is not an accepting state.

  2. Reading an 'aa' takes the machine to the middle state, which is the only accepting state.

  3. From the accepting state, an ε\varepsilon-transition goes to the rightmost state, and another ε\varepsilon-transition goes from the rightmost state back to the start state.

  4. From the start state, another 'aa' can be consumed to reach the accepting state again.

Hence, any string with one or more 'aa's can be accepted, i.e., L={a,aa,aaa,… }=a+L = \{a, aa, aaa, \dots\} = a^+.

The empty string ε\varepsilon is not accepted because the start state is not an accepting state and there is no ε\varepsilon-path from the start state to the accepting state.

Since the alphabet is Σ={a}\Sigma = \{a\}, the universal language is Σ∗=a∗={ε,a,aa,aaa,… }\Sigma^* = a^* = \{\varepsilon, a, aa, aaa, \dots\}.

The complement of the language is:

Lc=Σ∗∖L=a∗∖a+={ε}L^c = \Sigma^* \setminus L = a^* \setminus a^+ = \{\varepsilon\}

Thus, the complement is {ε}\{\varepsilon\}, which corresponds to option (B).

Try the question first, then check your work.

Think the official key or this write-up is wrong?

Report error or challenge

Examiner trap

The misconception this question tests

This Regular Expressions and Finite Automata previous year question is Q12 of the GATE CSE 2012 paper. Find more GATE CSE PYQs on Regular Expressions and Finite Automata in Theory of Computation, or browse all GATE CSE PYQs.

Free diagnostic

Where do you stand for GATE?

Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 5 related Regular Expressions and Finite Automata PYQs now with no account.

One GATE CSE PYQ every morning

An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.

Regular Expressions and Finite Automata in GATE CSE

Regular Expressions and Finite Automata has 41 GATE CSE PYQs across 24 papers from 2011 to 2026. 14 of them are 1-mark MCQs like this one, and GATE CSE 2012 has 3.

How GATE tests Regular Expressions and Finite Automata

More from GATE CSE 2012

Share this solution

A plain-text card for WhatsApp or Telegram study groups.

GateAI solution cardGATE CSE 2012 · Q12 · MCQ

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

Topic-wise GATE CS PYQs with verified steps

Independent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.