Question

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

Official answer and solution
Official answer
3
From
Official GATE 2015 answer key

Solution

Construct the minimal DFA that recognizes all binary strings ending in the suffix 10.

The language L=(0+1)∗10L = (0 + 1)^* 10 consists of all binary strings ending in 1010.

Define the state states based on the longest matching suffix of 1010 seen so far:

  • State AA (start): Last symbol is not 1 (matched suffix ϵ\epsilon).
  • State BB: Last symbol seen is 1 (matched suffix 1).
  • State CC (accepting): Last two symbols seen are 10 (matched suffix 10).

Transitions:

  • From AA: on 0→A0 \to A, on 1→B1 \to B.
  • From BB: on 1→B1 \to B, on 0→C0 \to C.
  • From CC: on 0→A0 \to A, on 1→B1 \to B.

All 3 states are reachable and pairwise distinguishable by the Myhill-Nerode theorem:

  • ϵ\epsilon separates CC (accepting) from AA and BB.
  • Input string 0 sends BB to CC (accept) but keeps AA in AA (reject).

Hence, the minimal DFA requires exactly 3 states.

Final answer

3

Common trap

Adding redundant states or failing to combine equivalent non-matching prefix states.

The answer is the one in the official GATE answer key. The solution is this site's own explanation.

Source

Paper
GATE 2015 Computer Science and Information Technology (CS) Session 2
Question
63 of 65, printed as CS Q.53
Section
Computer Science and Information Technology

Report an error in this question

GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.