Skip to content
Official PYQ · 2015

GATE CS 2015 Set 2 Q53 — Regular Expressions and Finite Automata

Explain with AI
The number of states in the minimal deterministic finite automaton corresponding to the regular expression (0+1)∗(10)(0+1)^* (10) is _____.
View worked solution

Answer: 3

The given regular expression is (0+1)∗(10)(0+1)^* (10), which represents the language LL of all binary strings over {0,1}\{0, 1\} that end with the substring "1010".

To find the number of states in the minimal DFA, we can define the states based on the longest suffix of the input read so far that matches a prefix of "1010":

  • State AA (Start State): The string read so far does not end with '11' or '1010'.
  • State BB: The string read so far ends with '11'.
  • State CC (Accepting State): The string read so far ends with '1010'.

The transition table for these states is as follows:

State Input 00 Input 11
ightarrowAightarrow A AA BB
BB CC (Accepting) BB
∗C*C AA BB

Minimality Verification:

  • State CC is an accepting state, whereas AA and BB are non-accepting states. Thus, CC is distinguishable from both AA and BB.
  • States AA and BB are distinguishable because on input 00, state BB transitions to the accepting state CC, while state AA transitions to the non-accepting state AA.

Since all 33 states are pairwise distinguishable, the minimal DFA has exactly 33 states.

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

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