GATE Computer ScienceModerateIBPS SO · GATE CSE

How many strings of length 7 over {a, b} belong to the language of the regular expression (a + bb)*(b + ε)?

  1. A. 38
  2. B. 31
  3. C. 34
  4. D. 43

Correct answer: C. 34

Count strings that parse into blocks a / bb followed by at most one extra b (this extra b is only usable at the end); enumeration of all 128 strings gives 34.

More Theory of Computation questions

Exams that ask this topic