GATE Computer ScienceVery hardGATE CS (PYQ pattern)

For a language L, the derivative u⁻¹L is { w : uw ∈ L }. Let L be the language of the regular expression (a + b)*a(a + b)(a + b). Which expression denotes (ab)⁻¹L?

  1. A. (a + b)*a(a + b)(a + b)
  2. B. (a + b)*a(a + b)(a + b) + a + b
  3. C. (a + b)*a(a + b)(a + b) + a + b + ε
  4. D. (a + b)(a + b)

Correct answer: B. (a + b)*a(a + b)(a + b) + a + b

abw has its 3rd symbol from the right equal to a when w is a single symbol (then the a of 'ab' is third from the end), and for |w| ≥ 3 w must itself be in L. Hence L + a + b; ε is not included because ab is too short.

More Theory of Computation questions

Exams that ask this topic