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)?

  1. A. aab and bab
  2. B. abb and babb
  3. C. bba and aabba
  4. 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

Exams that ask this topic