GATE Computer ScienceHardGATE CS (PYQ pattern)
How many states does the minimal complete DFA have for { w ∈ {a, b}* : w contains exactly two a's OR exactly two b's }?
- A. 16
- B. 7
- C. 8
- D. 15
Correct answer: A. 16
Each condition alone needs counts 0, 1, 2, ≥3 (4 states). In the product every pair (i, j), i, j ∈ {0, 1, 2, ≥3}, is a distinct class: they differ in how many more a's or b's lead to acceptance, and (≥3, ≥3) is the single dead state. So 4 × 4 = 16; nothing merges.
More Theory of Computation questions
- 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 }?
- 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?