GATE Computer ScienceVery hardGATE CS (PYQ pattern)
L = { w ∈ {a, b}* : the 5th symbol from the right is a AND the 3rd symbol from the right is b } (so |w| ≥ 5). How many states does the minimal complete DFA for L have?
- A. 32
- B. 20
- C. 15
- D. 16
Correct answer: C. 15
Only windows consistent with the pattern a?b?? need to be told apart. Track the longest suffix that can still lead to a match: the Myhill–Nerode classes are ε, a, aa, ab, aab, abb, aaba, aabb, abbb and the six accepting windows aabaa, aabab, aabba, aabbb, abbba, abbbb — 15 states (32 would track all 5-windows; 20 is the OR version).
More Theory of Computation questions
- L = { w ∈ {a, b} : the 4th symbol from the right is a, OR the 2nd symbol from the right is b }. How many ACCEPTING states does the minimal…
- How many states does the minimal complete DFA have for the set of ODD-length strings over {a, b} that contain neither aba nor bab as a…
- The minimal complete DFA for { w ∈ {a, b} : abab is a substring of w } has how many states?
- Let L = { w ∈ {a, b} : w contains aa as a substring and w contains bb as a substring }. Which pair of strings is equivalent under the…
- L = { w ∈ {a, b} : |w| mod 4 = 1 AND w ends with bb }. How many states does the minimal complete DFA for L have?
- L = { w ∈ {a, b} : the substring ab occurs an odd number of times AND the substring ba occurs an odd number of times }. How many states…