GATE Computer ScienceVery hardGATE CS (PYQ pattern)

Consider the language L of strings over {a, b} that contain both abab and bb as substrings, have n_a ≡ 1 (mod 3) and have an even number of b's. What is the length of the shortest string in L?

  1. A. 8
  2. B. 7
  3. C. 9
  4. D. 5

Correct answer: A. 8

The shortest witness found by exhaustive search is aaababbb: it contains aba, has 4 a's and 4 b's.

More Theory of Computation questions

Exams that ask this topic