Question
home / study / engineering / computer science / computer science questions and answers / let f(n) be the number of bit strings of length
home / study / engineering / computer science / computer science questions and answers / let f(n) be the number of bit strings of length n that contain three consecutive 0's. note: ...
Question: Let f(n) be the number of bit strings of length n that contain three consecutive 0's. Note: a str...
Let f(n) be the number of bit strings of length n that contain three consecutive 0's. Note: a string that contains four or more consecutive 0's is also considered to contain three consecutive 0's. We want to define f(n) recursively. we consider n >= 5. We want to express f(n) recursively in terms of f(n-1); f(n-2),......
Here are some hints:
(Step 1) If x is a bit string of length n-1 that contains three consecutive 0's, then extending it by a bit 0 or bit 1 will give rise to a string of length n that again contains three consecutive 0's. (Step 2) Consider a bit string x of length n that contains three consecutive 0's, but is not derived by Step 1. Next, answers the following two questions about such string x.
Q1.Compute f(16). verify that the f(16) that you computed is correct by writing a java program to enumerate all 216 = 65536 bit strings of length 16, and count the strings that contain three consecutive 0's.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started