GATE Computer ScienceVery hardGATE CS (PYQ pattern)
Let L₁ = { w ∈ {a, b}* : |w| ≡ 0 (mod 4) } and L₂ = { w : (n_a − n_b) ≡ 0 (mod 4) }. The minimal complete DFA for L₁ ∪ L₂ has how many states, and how many of them are accepting?
- A. 16 states, 7 accepting
- B. 8 states, 4 accepting
- C. 8 states, 3 accepting
- D. 16 states, 4 accepting
Correct answer: C. 8 states, 3 accepting
Track (|w| mod 4, (n_a − n_b) mod 4). Since |w| ≡ n_a − n_b (mod 2), only pairs of equal parity occur: 8 of the 16. All 8 are distinguishable. Accepting pairs have a 0 coordinate: (0,0), (0,2), (2,0) — 3 states.
More Theory of Computation questions
- 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?
- L = { w ∈ {a, b} : #ab(w) ≡ #ba(w) (mod 3) }, where #ab and #ba count occurrences of these substrings. How many states does the minimal…