This is a GRE practice question.
Which of the following regular expressions generate(s) no string with two consecutive 1’s? (Note that ε denotes the empty string.)
I. (1 + ε)(01 + 0)*
II. (01+10)*
III. (0+1)*(0+ε)
(A) I only
(B) II only
(C) III only
(D) I and II only
(E) II and III only
My understanding is that neither I nor III generates strings with 11
. In I, a string containing 1
is either 1
or 1
surrounded by 0
's. In III, all 1
's are preceded by 0
's. But the correct answer is A, so III must generate a string with 11
somehow. Please explain. Thanks!