All mock tests are FREE till 31 December — register to save your progress
Unit 8 · Theory of Computation and Compilers Paper 2 CS · September 2022

Consider L = {ab, aa, baa}. Which of the following strings is NOT in L*?

Pick an option to check yourself, or open the answer below.

Show answer & explanation

Correct answer: A. baaaaabaaaaa

Explanation

B = ab·aa·baa·ab·aa, C = aa·aa·baa·aa, D = baa·aa·ab·aa. In A, the b at position 7 must start 'baa' (leaving 'aaa' before it) or end 'ab' (leaving five a's after it). Either way an odd run of a's remains, so A ∉ L*.

More Theory of Computation and Compilers questions