Computer Science EngineeringHard

Which of the following languages over {a, b} is NOT regular?

  1. A. a*b*
  2. B. {a^n b^n | n >= 0}
  3. C. (ab)*
  4. D. strings with an even number of a's

Correct answer: B. {a^n b^n | n >= 0}

Matching the count of a's with b's needs unbounded memory, and the pumping lemma rules out regularity.

More Theory of Computation, Compilers & Digital Logic (ISRO CS) questions

Exams that ask this topic