Similar questions 2 more → · asked again: GATE 2008, Q78
Recurrences & Generating Functions

Answer & solution
Official answer: B
Partition valid n-bit strings by their last symbol. Those ending 0 append 0 to any valid (n−1)-bit string. Those ending 1 must end 01 and append 01 to a valid (n−2)-bit string. Hence an=an−1+an−2, B, with a0=1, a1=2.
The two cases must be disjoint and exhaustive. For n≥2, a valid string ends either in 0, or in 01; the latter is forced because a final 1 cannot follow another 1. Removing those suffixes gives arbitrary valid shorter strings and is reversible, so there is neither overcounting nor omission. For example a2=3 corresponds to 00,01,10, matching a1+a0=2+1. Initial values accompany the recurrence even though only the recurrence is requested.