Skip to content
Official PYQ · 2007

GATE CS 2007 Q29 — Regular Expressions and Finite Automata

Explain with AI

A minimum state deterministic finite automaton accepting the language

L={w∣w∈{0,1}∗,L=\{w\mid w \in \{0, 1\}^*, number of 00s and 11s in ww are divisible by 33 and 55, respectively }\}   has

Choose one option
View worked solution

Answer: A

To find the number of states in the minimum state DFA, we can analyze the requirements for tracking the number of 00s and 11s in any input string ww:

  1. Condition on 00s: The number of 00s must be divisible by 33. To track n0(w)(mod3)n_0(w) \pmod 3, we need 33 states corresponding to remainders {0,1,2}\{0, 1, 2\}.
  2. Condition on 11s: The number of 11s must be divisible by 55. To track n1(w)(mod5)n_1(w) \pmod 5, we need 55 states corresponding to remainders {0,1,2,3,4}\{0, 1, 2, 3, 4\}.

Since the count of 00s and 11s are independent of each other, we construct a product automaton. The states of this DFA are represented as ordered pairs (r0,r1)(r_0, r_1), where:

r0=n0(w)(mod3)andr1=n1(w)(mod5)r_0 = n_0(w) \pmod 3 \quad \text{and} \quad r_1 = n_1(w) \pmod 5

The total number of states in this product automaton is:

3×5=15 states3 \times 5 = 15 \text{ states}

Distinguishability:

  • The start state is (0,0)(0, 0), which is also the only accepting state (since both remainders must be 00).
  • All 1515 states are reachable from the start state.
  • For any two distinct states (i1,j1)(i_1, j_1) and (i2,j2)(i_2, j_2), we can always find a string that drives one to the accepting state (0,0)(0,0) and the other to a non-accepting state. Thus, all 1515 states are pairwise distinguishable.

Therefore, the minimum state DFA has exactly 1515 states.

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

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