Search the courses, subjects, tracks, games and features, or jump straight to a page.
Learn it your way
A short class with Sarah and her students. The other ways are under More.
Sign up free to listen. Transcripts are free to read.
Today we're going to talk about bad strings, specifically those that don't contain the substring '000'. Can anyone tell me what a bad string is?
A bad string is one that includes '000'?
Close! A bad string actually does not include '000'. Now, why do you think we need to study these bad strings?
Because counting them helps us understand patterns in binary sequences?
Exactly! Counting helps us define relationships and derive formulas, which leads us to . . .
Now let's discuss how we can create a recurrence relation for these bad strings. Who can tell me what a recurrence relation is?
I think it's an equation that defines a sequence based on previous terms.
That's correct! In our case, we want to express in terms of previous string counts. Any guesses?
Could it be ?
Yes! Fantastic job! Now let’s break down why that is. For strings starting with '1', they’re valid if the next bits match any valid sequence of length .
Now let’s categorize bad strings. We have a few types: starting with '1', '01', and '00'. Can anyone explain what happens with '00'?
'00' can’t follow with another '0' because that would create '000'!
Exactly! So if we follow '00', the next character must be '1'. And can you guess what that means for counting?
We subtract one from the length, looking at the previous string counts!
Before we compute further, we need initial conditions. What do you think should be?
That should be 2 since we can have '0' and '1'.
Correct! And for ?
That would be 4: '00', '01', '10', '11'.
Very good! What about for ?
'000' is not allowed, so it’s '001', '010', '011', '100', '101', '110', '111'. That's 7!
Let’s summarize what we’ve discussed today.
We learned about bad strings and established a recurrence relation to count them.
Plus, we discussed the categories of bad strings and their initial conditions!
Great job! Understanding these concepts allows us to efficiently compute various string configurations without enumerating every possibility.
Bad strings avoid '000,', Count them well, that's how you know.
Imagine strings as subway cars that refuse to stop at '000' stations, choosing different routes instead.
To remember, B.S.R. - Bad Strings Recurrence.
RIB: Recurrence, Initial Conditions, Bad strings.
Term
What is a bad string?
Click to flip
Term
Define recurrence relation.
Click to flip
Term
Initial Condition examples.
Click to flip
This section discusses the categorization and recurrence relations of bad strings, particularly those that do not contain the substring '000'.
The section explains how to derive recurrence relations for the number of bit strings of a given length that exclude specific substrings like '000'. It provides detailed examples of categorizing valid sequences of bits and developing relationships between these categories, illustrating how to count valid configurations through structural analysis.
In this section, we explore the notion of bad strings—specifically, binary strings that do not contain the substring '000'. The focus lies in developing a recurrence relation for the number of such strings, denoted as .
Definition of Bad Strings: A bad string does not include '000' as a substring. We need to count the number of possible strings of length that adhere to this restriction.
Recurrence Relation: Instead of counting strings that do not contain '000' directly, a more efficient approach is to formulate the count in terms of other simpler categories.
Categorization:
Through summation of these categories, the recurrence relation can be expressed as follows:
Thus, we can compute any based on previously computed values using the established recurrence relation.