Question

# a) Find a recurrence relation for the number of bit strings of length n that contain three consecutive 0s. b) What are the initial conditions? c) How many bit strings of length seven contain three consecutive 0s?

Solution

Verified
Step 1
1 of 4

(a) Let $a_n$ represent the number of bit strings of length $n$ that contain three consecutive 0's.

$\textbf{First case}$ The bit string is a sequence ending in $1$, then the bit string of length $n-1$ (ignore the last 1) has $a_{n-1}$ possible strings that contain a pair of consecutive 0's.

$\textbf{Second case}$ The bit string is a sequence ending in $10$, then the bit string of length $n-2$ (ignore the last two digits 10) has $a_{n-2}$ possible strings that contain a pair of consecutive 0's.

$\textbf{Third case}$ The bit string is a sequence ending in $100$, then the bit string of length $n-3$ (ignore the three two digits 100) has $a_{n-3}$ possible strings that contain a pair of consecutive 0's.

$\textbf{Fourth case}$ The bit string is a sequence ending in $000$. There are $2^{n-3}$ bit strings of length $n-3$ and thus there are $2^{n-3}$ bit strings of length $n-3$ followed by 00.

Adding the number of sequences of all three cases, we then obtain:

$a_n=a_{n-1}+a_{n-2}+a_{n-3}+2^{n-3}$

## Recommended textbook solutions #### Discrete Mathematics and Its Applications

7th EditionISBN: 9780073383095 (1 more)Kenneth Rosen
4,285 solutions #### Discrete Mathematics

8th EditionISBN: 9780321964687 (1 more)Richard Johnsonbaugh
4,246 solutions #### Advanced Mathematics: Precalculus with Discrete Mathematics and Data Analysis

ISBN: 9780395551899Brown
4,887 solutions #### Discrete Mathematics and Its Applications

8th EditionISBN: 9781259676512 (4 more)Kenneth Rosen
4,399 solutions