Try the fastest way to create flashcards
Question

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

Solution

Verified
Step 1
1 of 2

Given:

α\alpha is a bit string

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

SnS_n number of nn-bit strings α\alpha with C(α)2C(\alpha)\leq 2

When α\alpha is an nn-bit string with at most 2 consecutive zeros and n3n\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 Sn1S_{n-1} possible strings for the remaining n1n-1 digits and thus there are Sn1S_{n-1} strings α\alpha that end with 1.

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

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

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

Sn=Sn1+Sn2+Sn3S_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.

S1=1S_1=1

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

S2=4S_2=4

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

S3=7S_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 by Kenneth Rosen

Discrete Mathematics and Its Applications

7th EditionISBN: 9780073383095 (8 more)Kenneth Rosen
4,283 solutions
Discrete Mathematics 8th Edition by Richard Johnsonbaugh

Discrete Mathematics

8th EditionISBN: 9780321964687Richard Johnsonbaugh
4,246 solutions
Discrete Mathematics and Its Applications 8th Edition by Kenneth Rosen

Discrete Mathematics and Its Applications

8th EditionISBN: 9781259676512 (3 more)Kenneth Rosen
4,397 solutions
Discrete Mathematics with Applications 5th Edition by Susanna S. Epp

Discrete Mathematics with Applications

5th EditionISBN: 9781337694193Susanna S. Epp
2,641 solutions

More related questions

1/4

1/7