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

Let L= {ab, aa, baa}. Which of the following strings are not in L*?

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

Show answer & explanation

Correct answer: C. baaaaabaaaab

Explanation

After 'baa', the string 'baaaaabaaaab' leaves 'aaabaaaab'. Any split ends with a lone b or a lone a (the final 'aaaab' block cannot be covered by aa/ab), so it is not in L*. The other three strings split into ab, aa and baa pieces.

More Theory of Computation and Compilers questions