GATE Computer ScienceVery hardGATE CSE
Over {a, b}, L = { w : the number of a's in w is ≡ 1 (mod 4) and |w| ≡ 3 (mod 6) }. How many states does the minimal DFA of L have?
- A. 12
- B. 24
- C. 20
- D. 27
Correct answer: B. 24
The pair (a mod 4, |w| mod 6) gives 24 reachable states, and the length counter separates every residue because a b-only extension changes only the length; Moore refinement confirms all 24 pairs are pairwise distinguishable, so no merging is possible.
More Theory of Computation questions
- A DFA over {0,1} has states p0 (start), p1, p2, A (accepting), D. Transitions: p0 –0,1→ p1; p1 –0,1→ p2; p2 –1→ A; p2 –0→ D; A –0,1→ A; D…
- How many strings of length 12 over {a, b} contain neither aba nor bbb as a substring?
- Consider the grammar S → aSbS | bS | ε over {a, b}. How many strings of length exactly 9 does it generate?
- The grammar S → SS | aS | a is used to parse the string a⁶ (six a's). How many different parse trees does a⁶ have?
- A Turing machine (blank B, halts when no rule applies or in state acc) has rules: q0: a→(q1,B,R), b→(q2,B,R), B→(acc,B,S); q1 and q2…
- Which regular expression (+ denotes union) denotes exactly the set of non-empty strings over {a, b} that start with a, end with a and…