## Related questions with answers

If $\alpha$ is a bit string, let $C(\alpha)$ be the maximum number of consecutive 0’s in $\alpha$. [Examples: $C(10010) = 2, C(00110001) = 3$.] Let $S_n$ be the number of n-bit strings $\alpha$ with $C(\alpha) \leq 2$. Develop a recurrence relation for $S_1, S_2, . . . .$

Solution

VerifiedGiven:

$\alpha$ is a bit string

$C(\alpha)$=maximum number of consecutive 0's in $\alpha$

$S_n$ number of $n$-bit strings $\alpha$ with $C(\alpha)\leq 2$

When $\alpha$ is an $n$-bit string with at most 2 consecutive zeros and $n\geq 3$, then $\alpha$ either ends with 1 or with 10 or with 100 (as $\alpha$ has at most two consecutive zeros).

When $\alpha$ ends with 1, then there are $S_{n-1}$ possible strings for the remaining $n-1$ digits and thus there are $S_{n-1}$ strings $\alpha$ that end with 1.

When $\alpha$ ends with 10, then there are $S_{n-2}$ possible strings for the remaining $n-2$ digits and thus there are $S_{n-2}$ strings $\alpha$ that end with 10.

When $\alpha$ ends with 100, then there are $S_{n-3}$ possible strings for the remaining $n-3$ digits and thus there are $S_{n-3}$ strings $\alpha$ that end with 100.

In total, there are thus $S_{n-1}+S_{n-2}+S_{n-3}$ $n$-bit strings with at most two consecutive zeros (when $n\geq 3$).

$S_n=S_{n-1}+S_{n-2}+S_{n-3}$

There are 2 1-bit strings that contain at most 2 consecutive zeros: 0 and 1.

$S_1=1$

There are 4 2-bit strings that contain at most 2 consecutive zeros: 00, 01, 10, 11.

$S_2=4$

There are 7 3-bit strings that contain at most 2 consecutive zeros: 001, 010, 011, 100, 101, 110, 111.

$S_3=7$

## Create a free account to view solutions

## Create a free account to view solutions

## Recommended textbook solutions

#### Discrete Mathematics and Its Applications

7th Edition•ISBN: 9780073383095 (8 more)Kenneth Rosen#### Discrete Mathematics and Its Applications

8th Edition•ISBN: 9781259676512 (3 more)Kenneth Rosen## More related questions

1/4

1/7