Regular Expressions & Languages

Answer & solution
Official answer: C
The blocks ab, aa and baa have distinct forced beginnings: at a, the next character decides ab versus aa; at b, only baa is possible. String 1 factors as ab·aa·baa·ab·aa; string 2 as aa·aa·baa·aa; and string 4 as baa·aa·ab·aa. For string 3, baaaaabaaaab, the forced parse is baa·aa·ab·aa·aa followed by a lone b, which is not a block. Its reachable complete-block prefix lengths are 0, 3, 5, 7, 9, 11, but its full length is 12. Thus exactly strings 1, 2, 4 belong to L*, C.
Check: Because no listed block is a prefix of another listed block, greedy block recognition cannot discard an alternative valid segmentation. This prefix-code property makes the forced parse failure of string 3 decisive rather than just one unsuccessful guess.