GATE Computer ScienceHardGATE CS (PYQ pattern)
Let L = { aⁿ : n² ≡ 1 (mod 8) }. How many states does the minimal DFA for L have?
- A. 8
- B. 4
- C. 3
- D. 2
Correct answer: D. 2
Every odd n satisfies n² ≡ 1 (mod 8) (1, 9, 25, 49 ≡ 1), and every even n gives n² ≡ 0 or 4. So L is simply the odd-length strings: a 2-state parity DFA. Building an 8-state counter is the trap.
More Theory of Computation questions
- Let L = { aⁿ : n ≥ 5 and n ≡ 1 (mod 3) }. How many states does the minimal DFA for the concatenation L·L have?
- Let L = { w ∈ {a, b} : |w| ≥ 5 and the 5th symbol from the LEFT equals the 1st symbol }. How many states does the minimal complete DFA for…
- L = { aⁿbᵐ : n, m ≥ 0 and n ≡ m (mod 3) }. How many states does the minimal complete DFA for L have?
- Occurrences of aa may overlap (aaa contains two). How many states does the minimal complete DFA for { w ∈ {a, b} : w contains EXACTLY two…
- L = { w ∈ {a, b} : (na(w) − nb(w)) is divisible by 3 and w contains no bb }. Its minimal complete DFA has 7 states. How many of them are…
- Consider L = { w ∈ {a, b} : every a in w is immediately followed by a b }. The minimal complete DFA for L has how many states?