GATE Computer ScienceVery hardGATE CS (PYQ pattern)
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 complete DFA for L have?
- A. 6
- B. 4
- C. 8
- D. 12
Correct answer: A. 6
The minimal DFA has 12 states (ε, a, b, aa, ab, ba, bb, aaa, aba, aaaa, aaab, abaa as representatives). A class accepts iff its representative is in L: ba, bb (2nd from right b), aba (2nd from right b) and aaaa, aaab, abaa (4th from right a). So 6 accepting states.
More Theory of Computation questions
- 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…
- How many strings of length 10 over {a, b} have an even number of occurrences of ab AND an even number of occurrences of ba?