GATE CS 2024 Set 1 | Question 50

MSQ · 2 marks

Consider the 5-state DFA \(M\) accepting the language \(L(M) \subset (0 + 1)^{*}\) shown below. For any string \(w \in (0 + 1)^{*}\) let \(n_{0}(w)\) be the number of \(0's\) in \(w\) and \(n_{1}(w)\) be the number of \(1's\) in \(w\).

A five-state DFA with states 1 to 5, where state 1 is both the start state and the only accepting state. On inputs 0 and 1 respectively, state 1 goes to 2 and 4, state 2 to 3 and 1, state 3 to 1 and 2, state 4 to 1 and 5, and state 5 to 4 and 1.

Which of the following statements is/are FALSE?

  1. Option A: States 2 and 4 are distinguishable in \(M\)
  2. Option B: States 3 and 4 are distinguishable in \(M\) (correct)
  3. Option C: States 2 and 5 are distinguishable in \(M\) (correct)
  4. Option D: Any string \(w\) with \(n_{0}(w) = n_{1}(w)\) is in \(L(M)\)

Answer

(B), (C)

Explanation

Each state records \(n_{0} - n_{1} \bmod 3\) for the input read so far: a 0 adds 1 and a 1 subtracts 1. State 1 is residue 0, states 2 and 5 are residue 1, and states 3 and 4 are residue 2; every arrow fits (for example, 3 goes to 2 on a 1, and 5 goes to 4 on a 0). So \(L(M)\) is the set of strings with \(n_{0}(w) - n_{1}(w) \equiv 0 \pmod{3}\).

  • (A) is true: the input 1 takes state 2 to the accepting state 1 but takes state 4 to state 5.
  • (B) and (C) are false: 3 and 4 have the same residue, as do 2 and 5, so every suffix leads both states of a pair to the same verdict. They are equivalent, not distinguishable.
  • (D) is true: equal counts give a difference of 0.

Answer: B, C