GATE Computer ScienceVery hardGATE CS (PYQ pattern)
Let L = { binary strings (MSB first, ε accepted) whose value is divisible by 5 }, with a minimal DFA of 5 states. For h(a) = 1 and h(b) = 01, how many states does the minimal DFA for h⁻¹(L) = { w ∈ {a, b}* : h(w) ∈ L } have?
- A. 10
- B. 5
- C. 25
- D. 4
Correct answer: B. 5
On remainders mod 5, a acts as v → 2v + 1 and b as v → 4v + 1; the DFA for h⁻¹(L) keeps L's 5 states and all five remain distinguishable. The state count cannot exceed that of L's DFA.
More Theory of Computation questions
- Let L₁ = { w ∈ {a, b} : |w| ≡ 0 (mod 4) } and L₂ = { w : (na − nb) ≡ 0 (mod 4) }. The minimal complete DFA for L₁ ∪ L₂ has how many…
- Let L₁ = { w ∈ {a, b} : na(w) ≡ 0 (mod 4) } and L₂ = { w : |w| ≡ 0 (mod 6) }. The minimal complete DFA for L₁ ∩ L₂ has how many states?
- Let L₁ = { w ∈ {a, b} : na(w) is even } and L₂ = { w : |w| is even }. The minimal complete DFA for L₁ ∩ L₂ has how many states?
- Over {0, 1} (MSB first, ε counted as 0), L = { w : w is divisible by 5 and w contains 11 as a substring }. How many states does the…
- How many strings of length 6 over {a, b} contain both ab and ba as substrings?
- How many states does the minimal complete DFA for { w ∈ {a, b} : ab occurs EXACTLY twice as a substring } have?