Skip to content
Official PYQ · 2009

GATE CS 2009 Q41 — Regular Expressions and Finite Automata

Explain with AI

The above DFA accepts the set of all strings over {0,1}\{0,1\} that 

Choose one option
View worked solution

Answer: C

Let the states of the given DFA be q0q_0 (start state), q1q_1, and q2q_2 (accepting state). The transitions are as follows:

  • From q0q_0: on input 11 it loops to q0q_0, and on 00 it transitions to q1q_1.
  • From q1q_1: on input 11 it goes back to q0q_0, and on 00 it transitions to the accepting state q2q_2.
  • From q2q_2: on input 00 it loops to q2q_2, and on 11 it goes back to q0q_0.

Let us analyze the behavior of this DFA:

  • State q0q_0: Represents the state where the string processed so far does not end with 00.
  • State q1q_1: Represents the state where the string processed so far ends with a single 00 (i.e., suffix is 00 but not 0000).
  • State q2q_2 (Accepting): Represents the state where the string processed so far ends with at least two 00s (i.e., suffix is 0000).

Whenever a 11 is encountered, the suffix condition is broken, and the DFA resets to q0q_0. Thus, the DFA reaches the accepting state q2q_2 if and only if the string ends with 0000.

Eliminating other options:

  • Option A: The string 00 begins with 00 but is not accepted (ends in q1q_1).
  • Option B: The string 00 ends with 00 but is not accepted.
  • Option D: The string 001001 contains the substring 0000, but processing it leads to q0q_0 (non-accepting), so it is rejected.

Therefore, the DFA accepts the set of all strings that end with 0000.

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

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