Let M be the 5-state NFA with -transitions shown in the diagram below. Which one of the following regular expressions represents the language accepted by M ?
Topic-wise GATE CS PYQs with verified steps
GATE CSE 2024 Set 2 · Q41
Time

Select one answerSingle correct
Solution
Official answer: B) 0* + (1 + 0(00)*)(11)*
Regular Expressions and Finite AutomataTo determine the regular expression for the language accepted by the NFA , we analyze the paths from the start state to each of the accepting states and [1]:
Paths reaching state :
The start state reaches state via an -transition ().
From state , we can alternate between state and state via , which corresponds to the loop .
Thus, the set of strings accepted at state is .
Paths reaching state :
Via state : , giving string . Once at state , there is a loop , giving . The strings reaching state along this path are represented by .
Via state and state : . This produces strings of the form . From state , looping gives , so strings along this path are represented by .
Combining both paths to state , we get .
Total language accepted by :
Hence, the correct regular expression is **, which corresponds to option (B)** [1].
Try the question first, then check your work.
Examiner trap
Identify the two accepting states (2 and 5) and determine all paths from the start state to each of them. Note that even numbers of 0s end in state 2 while odd numbers of 0s can transition via state 3 to state 5.
This Regular Expressions and Finite Automata previous year question is Q41 of the GATE CSE 2024 Set 2 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. 10 of them are 2-mark MCQs like this one, and GATE CSE 2024 Set 2 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.