GATE Computer ScienceHardGATE CS
Let L = { w ∈ {a, b}* : w contains at most 3 a's and at least 2 b's }. How many states does the minimal complete DFA for L have?
- A. 13
- B. 20
- C. 15
- D. 12
Correct answer: A. 13
Track (a-count 0..3, b-count capped at 2): 4 × 3 = 12 live states, all distinguishable. A fourth a kills the string for good, so one extra dead state gives 13; the naive 5 × 3 = 15 forgets that every state with a-count 4 is the same dead state.
More Theory of Computation questions
- Let #ab(w) and #ba(w) be the numbers of occurrences of the substrings ab and ba in w ∈ {a, b}. Which one of the following languages is…
- Let L = { w ∈ {a, b} : w begins with aba, or (w ends with b and na(w) ≡ 0 (mod 3)) }. The minimal complete DFAs for L and for its reversal…
- Consider the following claims about an arbitrary regular language L over Σ. I. { w : ww ∈ L } is regular. II. { w : w wᴿ ∈ L } is regular…
- Let D be a DFA and G a context-free grammar over the same alphabet. Consider the problems: I. Is L(D) ⊆ L(G)? II. Is L(G) ⊆ L(D)? III. Is…
- A single-tape Turing machine has blank B and starts in q0 on the leftmost cell of a binary numeral (MSB at the left). Rules: δ(q0,0) =…
- For a Turing machine M (given by its encoding ⟨M⟩) consider these sets: I. { ⟨M⟩ : M has at least 481 states } II. { ⟨M⟩ : L(M) contains…