[Recurrence Relation]three conscutive 0's in bit string

  • Thread starter Thread starter master cherundo
  • Start date Start date
  • Tags Tags
    Bit String
Click For Summary

Homework Help Overview

The problem involves finding a recurrence relation for the number of bit strings of length n that contain three consecutive 0s. Participants are exploring how to categorize these bit strings based on their properties.

Discussion Character

  • Exploratory, Mathematical reasoning, Problem interpretation

Approaches and Questions Raised

  • The original poster attempts to divide bit strings into those that contain three consecutive 0s and those that do not, proposing a recurrence relation based on this division. Other participants discuss different approaches and the importance of specifying base cases. There is also mention of sanity checking the proposed relation by computing initial values.

Discussion Status

Some participants express agreement with the original poster's recurrence relation, while others note the need for base cases and sanity checks. Multiple approaches are being explored, with at least one participant indicating that different methods yield the same output for specific values.

Contextual Notes

There is a noted absence of base cases in the original poster's recurrence relation, and the assignment has been submitted, indicating a potential deadline constraint. Participants are also reflecting on different methods of defining sequences related to the problem.

master cherundo
Messages
13
Reaction score
0

Homework Statement


Find a recurrence relation for the number of bit strings of length n that contain three consecutive 0s.



The Attempt at a Solution


Divide the bit strings into two condition: one that have three consecutive 0s, another that does not. Let x_i denote the bit strings of length n that fulfill that condition. Then, we can get x_i by adding a 0 or a 1 to x_{i-1}. But, there is another bit strings that included in x_i. That is by adding 1000 string to bit strings of length n-3 that does not have three consecutive 0s. This is can be write by 2^{n-4}-x_{n-4}. So, we get x_n=2x_{n-1}-x_{n-4}+2^{n-4}.
Is my recurrence relation right?
Examples i ever seen is just discuss about bit strings of length n that does not have k bit strings..

Thank you

master cherundo
 
Last edited:
Physics news on Phys.org
I believe this is right.
 
Examples i ever seen is just discuss about bit strings of length n that does not have k bit strings.
Well, there's an easy relationship between this kind of question and the one you are solving here. BTW, you forgot to specify the base case for your recursion. Incidentally, did you do any sanity checking? (e.g. compute the first few values of x directly)
 
My friends has different approach in solving this, but actually these two relation produce same output for x_7
The base case is questioned after this problem. :wink:
The assignment has been submitted.
 
master cherundo said:
My friends has different approach in solving this, but actually these two relation produce same output for x_7
The base case is questioned after this problem. :wink:
The assignment has been submitted.

I had a different way too. I checked up to x(8), and I agree with yours as well. I'm used to recursively defining several sequences in parallel:

A sequence counting how many sequences do not have 000, and end in 1.
A sequence counting how many sequences do not have 000, and end in 10.
A sequence counting how many sequences do not have 000, and end in 100.
A sequence counting how many sequences have 000.

It's more tedious, but it does have the advantage of being formulaic, and you can always do some linear algebra / difference equation solving to simplify it, if you want.
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
Replies
3
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
Replies
5
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 24 ·
Replies
24
Views
4K