Regular Expressions & Languages

Answer & solution
Official answer: D
Method: use the actual pumping-lemma conditions. For every word s with |s|≥p, find s=xyz with |xy|≤p, |y|≥1, and xyiz∈L for every integer i≥0.
1. Reject p=3, 5, or 9 using s=b10, which has length at least each candidate. Any nonempty y in such a decomposition consists only of b's and has length r with 1≤r≤p≤9.
2. Pumping up once more, i=2, produces length 10+r. For this all-b word to remain in L, r would have to be a multiple of 12. No r from 1 through 9 qualifies. Thus each of those three candidates fails.
3. Now take p=24. If s=am∈L and m≥24, set x=ε and y=a³. Pumping changes m by a multiple of 3, preserving m≡2 mod 3. Even at i=0, m−3≥21, and the permitted residue makes the remaining exponent an admitted nonnegative case.
4. If s=bm∈L and m≥24, set x=ε and y=b12. The first eligible such m is 34. Pumping changes m by multiples of 12; removing one block leaves at least 22, still an admitted length 10+12k.
5. Both constructions have nonempty y and |xy| equal to 3 or 12, at most 24. They therefore satisfy all requirements for every sufficiently long word in either branch.
Result: D, 24. A pumping length is an upper threshold at which suitable repetition is guaranteed; it does not have to equal a shortest accepted word or the least possible threshold.