Finding Recurrence Relation for Bit Strings with Consecutive Zeros

Click For Summary
SUMMARY

The discussion focuses on deriving a recurrence relation for counting bit strings of length n that contain consecutive zeros. The variable ak represents the number of bit strings of length k with a pair of consecutive zeros. The final recurrence relation is established as an = 2(an-1) - (an-2) + 2n-2, simplifying the analysis by considering three mutually exclusive cases instead of accounting for overlaps. The cases are categorized based on the starting bits of the strings, leading to a structured approach for calculating the total count.

PREREQUISITES
  • Understanding of recurrence relations in combinatorial mathematics
  • Familiarity with bit strings and binary representations
  • Basic knowledge of mathematical induction
  • Experience with analyzing overlapping cases in combinatorial problems
NEXT STEPS
  • Study combinatorial techniques for deriving recurrence relations
  • Learn about the principle of inclusion-exclusion in combinatorial counting
  • Explore advanced topics in binary string enumeration
  • Investigate applications of recurrence relations in algorithm design
USEFUL FOR

Mathematicians, computer scientists, and students studying combinatorial algorithms or recurrence relations, particularly those interested in binary string analysis and optimization techniques.

Miike012
Messages
1,009
Reaction score
0
I am having difficulty knowing which "cases" include in the recurrence equation.

My solution to problem in paint document.

Cases 1 - 6:
All cases contain strings of length n
Let ak represent number of bit string of length k with a pair of consecutive 0s.

For cases 1 and 2.
an-1, k = n-1.

1. Start with 0
0_ _ ... _
2. Start with 1
1_ _ ... _

For cases 3 - 5
an-2, k = n-2.

3. Start with 1 0
1 0 _ ... _
4. Start with 1 1
1 1 _ ... _
5. Start with 0 1
0 1 _ ... _

Case 6
an-2 = 2n-2

6. Start with 0 0
0 0 _ ... _

Therefore
An = (sum of ak from case 1 and 2) + (sum of ak from case 3,4, and 5) + (ak from case 6) =
2(an-1) + 3(an-2) + 2n-2

Cases that "overlap"
1 and 5: if second term of case 1 is 1
1 and 6: if second term of case 1 is 0

2 and 3: if second term of case 2 is 0
2 and 4: if second term of case 2 is 1

Therefore
an = 2(an-1) - (an-2) + 2n-2 = An - 4(an-2)
 

Attachments

  • QQQQ.jpg
    QQQQ.jpg
    4.6 KB · Views: 463
Last edited:
Physics news on Phys.org
I couldn't follow how you got your final equation from the various cases.
But it's much simpler if you just consider three mutually exclusive cases instead of having to subtract out overlaps. What are the three cases?
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 19 ·
Replies
19
Views
4K
Replies
9
Views
3K
Replies
12
Views
4K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 11 ·
Replies
11
Views
4K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 16 ·
Replies
16
Views
3K