Let L be the language represented by the regular expression * 0011 * where = {0, 1}. What is the minimum number of states in a DFA that recognizes L (complement of L)?
Topic-wise GATE CS PYQs with verified steps
GATE CSE 2015 Set 3 · Q18
Time
Select one answerSingle correct
Solution
Official answer: B) 5
Regular Expressions and Finite AutomataThe language consists of all binary strings that contain the substring .
The minimal complete DFA for language requires states corresponding to the length of the longest prefix of matched so far:
State : matched (start state)
State : matched
State : matched
State : matched
State : matched (accepting/dead state for )
To construct the minimal DFA for the complement language :
We keep the exact same state set and transition function of the minimal complete DFA for , and invert the final states (non-accepting states become accepting, and accepting states become non-accepting).
Since complementing the accepting states in a minimal complete DFA results in a minimal DFA for the complement language, the number of states remains unchanged.
Hence, the correct option is (B).
Try the question first, then check your work.
Examiner trap
Construct the minimal complete DFA recognizing strings with substring , then consider how DFA state count changes under complementation.
This Regular Expressions and Finite Automata previous year question is Q18 of the GATE CSE 2015 Set 3 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 it is the only one in GATE CSE 2015 Set 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.