GATE Computer ScienceVery hardGATE CS (PYQ pattern)
Let L = { w ∈ {a, b}* : |w| ≥ 3 and the 3rd symbol from the right end equals the last symbol }. How many states does the minimal complete DFA for L have?
- A. 8
- B. 9
- C. 16
- D. 11
Correct answer: D. 11
For |w| ≥ 3 the future depends on the last two symbols (2 × 2 = 4) and acceptance now depends on whether the 3rd-from-right equals the last: 4 × 2 = 8 classes. A length-2 string yz behaves like the non-accepting class with the same last two symbols, so it merges. Add ε, a and b (3 distinct short-string classes): 8 + 3 = 11.
More Theory of Computation questions
- 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…
- 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?