Let a represent the number of bit strings of length n containing two consecutive s. What is the recurrence relation for ?
View worked solution
Answer: A
To find the recurrence relation for , the number of bit strings of length containing two consecutive s, we can partition the set of valid strings of length based on their starting bits:
-
Case 1: The string starts with
0
The remaining bits must contain two consecutive s.
Number of such strings = -
Case 2: The string starts with
10
The remaining bits must contain two consecutive s.
Number of such strings = -
Case 3: The string starts with
11
Since we already have two consecutive s at the beginning, the remaining bits can be any arbitrary bit string of length .
Number of such strings =
Since these three cases are mutually exclusive and collectively cover all valid strings of length , we sum them up to get the recurrence relation:
This matches Option A.
Free practice · Your answers on this page are not saved.
