GATE Computer ScienceHardGATE CS (PYQ pattern)
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 Myhill–Nerode relation of L (no suffix z puts exactly one of them in L)?
- A. aab and bab
- B. abb and babb
- C. bba and aabba
- D. aaba and aab
Correct answer: B. abb and babb
abb and babb both contain bb, not aa, and end in b: every suffix behaves the same, so they are equivalent. aab vs bab: z = bb puts aabbb in L but not babbb. bba vs aabba: z = ε (aabba ∈ L). aaba vs aab: z = b gives aabab ∉ L but aabb ∈ L.
More Theory of Computation questions
- 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?
- How many strings of length 8 over {a, b} begin with b and contain no aa as a substring?
- Over Σ = {a, b, c}, how many strings of length 6 have an even number of a's and do not contain cc?
- Let L = { aⁿ : n = 1, or n ≥ 3 and (n ≡ 2 (mod 4) or n ≡ 3 (mod 6)) }. How many states does the minimal DFA for this unary language have?