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.4. Ternary Strings with Occurrences
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 are examples of valid ternary strings?
Hint
Think of combinations using 0, 1 and 2.
- 2.
Define a ternary string?
Hint
Consider how binary strings only use two characters.
- 3.
What characters are used in ternary strings?
- 0
- 1
- 2
- 0
- 1
- 0
- 2
- 1
- 2
Hint
Recall the definition of ternary.
- 4.
Are all sequences of length n valid if they contain '00'?
- True
- False
Hint
Consider what makes a sequence valid.
- 5.
Prove the count of valid ternary strings of length n including at least one occurrence of '11'.
Hint
Analyze smaller lengths and use their counts.
- 6.
Construct a ternary string generator that validates occurrences while respecting string properties.
Hint
Use data structures that efficiently manage counts.
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