GATE Computer ScienceModerateGATE CS (PYQ pattern)
How many states does the minimal complete DFA have for { w ∈ {a, b}* : |w| is divisible by 3 and the second-last symbol of w is a }?
- A. 6
- B. 4
- C. 7
- D. 5
Correct answer: D. 5
Only the symbol read at a length ≡ 2 (mod 3) position matters. States: length ≡ 0 non-accepting (start), ≡ 1, ≡ 2 with last symbol a, ≡ 2 with last symbol b, and ≡ 0 accepting. The two ≡ 0 states differ only on ε. 5 states, not 3 × 2 = 6.
More Theory of Computation questions
- How many states does the minimal complete DFA for { w ∈ {a, b} : w begins with a } have?
- Let L = { w ∈ {a, b} : the 3rd symbol from the right is a } (minimal DFA: 8 states) and Lᴿ its reversal (the 3rd symbol from the LEFT is…
- Let L = { w ∈ {a, b} : na(w) = 2·nb(w) }. The prefix language Pref(L) = { x : xy ∈ L for some y }. How many states does the minimal…
- Let L = (a + b)abb. The right quotient L / b = { w : wb ∈ L } has a minimal complete DFA with how many states?
- Let L = (a + b)abb. The left quotient a⁻¹L = { w : aw ∈ L } has a minimal complete DFA with how many states?
- Let L be the set of binary strings (MSB first, ε counted as 0 and accepted) whose value is divisible by 3; its minimal DFA has 3 states…