Search the courses, subjects, tracks, games and features, or jump straight to a page.
2 cards from this section. Quick, good the night before a test.
What is C(1)?
Consider the valid strings of length 1.
List the valid bit strings of length 2.
Remember that two consecutive zeros are not allowed.
What is C(2)?
Count the valid strings of two bits.
C(n) is defined as?
Remember what our function counts.
Using the recurrence relation, calculate C(6) and validate your answer.
Don’t forget to use the previous two values you computed.
Create a program that generates all possible n-bit strings and filters out those containing consecutive 0's. Verify its output for n = 5.
Try using recursive functions for bit generation.
5 more questions in this section. Enroll free to practise them all.
Enroll free