Skip to content
Official PYQ · 2024

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

Explain with AI

​​​​Which one of the following regular expressions is equivalent to the language accepted by the DFA\text{DFA} given below?

Choose one option
View worked solution

Answer: A

The given DFA consists of two states: q0q_0 (the initial state) and q1q_1 (the only final state), with the following transitions:

  • δ(q0,0)=q0\delta(q_0, 0) = q_0 and δ(q0,1)=q1\delta(q_0, 1) = q_1
  • δ(q1,0)=q1\delta(q_1, 0) = q_1 and δ(q1,1)=q0\delta(q_1, 1) = q_0

To find the equivalent regular expression, we analyze the paths to reach and stay in the final state q1q_1:

  1. Reaching q1q_1 initially: To reach q1q_1 for the first time from the start state q0q_0, the automaton must consume any number of 00s followed by a single 11. This is represented by: 0∗10^* 1
  2. Looping at q1q_1: Once at q1q_1, we can return to q1q_1 in two ways:
    • Directly via the self-loop on 00.
    • By transitioning to q0q_0 on 11, looping on 00 any number of times (0∗0^*), and returning to q1q_1 on 11. This path is 10∗11 0^* 1.
    Any combination of these loops can be repeated zero or more times, which is represented by: (0+10∗1)∗(0 + 1 0^* 1)^*

Combining these two parts, the complete regular expression for the language accepted by the DFA is:

0∗1(0+10∗1)∗0^* 1 (0 + 1 0^* 1)^*

Thus, the correct option is A.

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

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