Enrol to start learning
Reading is open to everyone. Enrolling is free, and it is what unlocks the audio lessons, practice tests and progress tracking.
16.2.1. Counting Bad Strings
This section
Practice test
10 questions on this section. Wrong answers show you what to read again.
Sign up to take itWhole chapter
Revision test
Mixed questions from across the chapter. Your answers get marked.
Sign up to take itQuick
Flashcard drill
2 cards from this lesson. Good the night before a test.
Try these first
- 1.
What is a bad binary string?
Hint
Think about the definition of bad strings.
- 2.
How many binary strings are there of length 1?
Hint
Count the combinations.
- 3.
What defines a bad string?
- Contains '000'
- Starts with 1
- Ends with 0
Hint
Consider the definition.
- 4.
Is g(n) defined as the count of good strings?
- True
- False
Hint
Recall the definitions.
- 5.
Prove that f(n) is equal to 2^n - g(n) for n > 2.
Hint
Start with base cases like n=3 and n=4.
- 6.
Calculate the number of bad strings for n=5.
Hint
Remember to sum prior g(n) values and recalculate 2^5.
Exercises
Total Questions
2
Estimated Time
4 min
Passing Score
70%
Instructions
- Read each question carefully
- You can use hints if you need help
- Complete all questions before submitting
4 more questions available
Enrol freeQuiz
Total Questions
2
Estimated Time
4 min
Passing Score
70%
Instructions
- Read each question carefully
- You can use hints if you need help
- Complete all questions before submitting
Get your answers marked and your progress tracked
Enrol freeChallenge Problems
Total Questions
2
Estimated Time
4 min
Passing Score
70%
Instructions
- Read each question carefully
- You can use hints if you need help
- Complete all questions before submitting