Let denote the number of binary strings of length that contain no consecutive s.
Which of the following recurrences does satisfy?
View worked solution
Answer: D
To find the recurrence relation for , the number of binary strings of length containing no consecutive s, we can analyze the structure of any valid string of length based on its ending character:
- Case 1: The string ends with '1'
If the last character is '1', the preceding characters can be any valid binary string of length with no consecutive s.
The number of such strings is . - Case 2: The string ends with '0'
Since the string cannot contain consecutive s, the character immediately preceding the last '0' must be '1' (for ). Thus, the string must end with '10'.
The remaining prefix of length can be any valid binary string of length with no consecutive s.
The number of such strings is .
Since these two cases are mutually exclusive and exhaustive, we sum them to get the total count:
Verification with small values:
- For : Valid strings are
0,1. - For : Valid strings are
01,10,11. - For : Valid strings are
010,011,101,110,111.
Using the recurrence relation: , which perfectly matches the manual count.
Therefore, the correct option is D.
Free practice · Your answers on this page are not saved.
