Skip to content
Official PYQ · 2024

GATE CS 2024 Set 2 Q31 — Regular Expressions and Finite Automata

Explain with AI

​​Let M\text{M} be the 55-state NFA\text{NFA} with ϵ\epsilon-transitions shown in the diagram below.


Which one of the following regular expressions represents the language accepted by M\text{M}?

Choose one option
View worked solution

Answer: B

By analyzing the paths from the start state q0q_0 in the given NFA\text{NFA}, we can identify three distinct branches of accepted strings:

  1. Only 00s: The automaton can transition to a loop that accepts any number of 00s, including the empty string ϵ\epsilon. This corresponds to the regular expression 0∗0^*.
  2. Odd number of 00s followed by an even number of 11s: This path accepts strings of the form 0(00)∗(11)∗0(00)^*(11)^*.
  3. Odd number of 11s: This path accepts strings consisting of an odd number of 11s, represented by 1(11)∗1(11)^*.

Combining these three independent paths, the complete language accepted by the NFA\text{NFA} is represented by the union of their regular expressions:

L=0∗+0(00)∗(11)∗+1(11)∗L = 0^* + 0(00)^*(11)^* + 1(11)^*

By factoring out (11)∗(11)^* from the last two terms, we get:

L=0∗+(1+0(00)∗)(11)∗L = 0^* + \left(1 + 0(00)^*\right)(11)^*

This matches Option B.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Regular Expressions and Finite Automata questions