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
GATE CSE 2012 · Q12
Time

Select one answerSingle correct
Solution
Official answer: B) { }
Regular Expressions and Finite AutomataLet us analyze the language accepted by the given NFA:
The start state (leftmost) is not an accepting state.
Reading an '' takes the machine to the middle state, which is the only accepting state.
From the accepting state, an -transition goes to the rightmost state, and another -transition goes from the rightmost state back to the start state.
From the start state, another '' can be consumed to reach the accepting state again.
Hence, any string with one or more ''s can be accepted, i.e., .
The empty string is not accepted because the start state is not an accepting state and there is no -path from the start state to the accepting state.
Since the alphabet is , the universal language is .
The complement of the language is:
Thus, the complement is , which corresponds to option (B).
Try the question first, then check your work.
Examiner trap
Determine the language recognized by the NFA first, then compute where .
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
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.
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 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 AutomataIndependent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.