edited by
530 views

2 Answers

0 votes
0 votes

There are three cases need to be dealt with here. First, from each string of length $n-1$ string, string of length $n$ can be created be appending $1$ (It will be $a'_{n}=a_{n-1}$). Second, from each string of length $n-2$, strings of length $n$ can be created by appending either $00$ or $10$  (it will be $a''_{n}=2a_{n-2}$). Finally, you can add $00$ to each string of length $n-2$ that are bereft of consecutive $0s$ (It will be $a'''_n = 2^{n-2}-a_{n-2}$)... Another.

$a_n = a'_n + a''_n + a'''_n$ is your answer.

edited by
0 votes
0 votes
You can solve it by formulating the recurrence-

Let T(N) be the recurrence relation for n length such strings

For n =1 we have  nothing

For n=2 we have 00

For n=3 we have  T(1)1  (Appending 1 to length n -1 strings which means Strings ending with 1 ) + 00(1) (Strings ending with 00)

For n=4 we have  T(3)1 (Strings ending with 1) + (2^(2)-T(2))00 ( This means length n -2 strings which do not have consecutive zeroes.)

For n=5= we have T(4)1 + (2^3-T(3))00

So for n=n We have T(n)=T(n-1)+ (2^(n-2)) - T(n-2)

Related questions

420
views
1 answers
0 votes
aditi19 asked Dec 10, 2018
420 views
this is an example taken from Rosen. but I’m unable to understand to understand the solution given therecan someone pls explain me in details
275
views
0 answers
0 votes
admin asked May 5, 2020
275 views
Consider the nonhomogeneous linear recurrence relation $a_{n} = 3a_{n-1} + 2^{n}.$Show that $a_{n} = -2^{n+1}$ is a solution of this recurrence ... to find all solutions of this recurrence relation.Find the solution with $a_{0} = 1.$
6.9k
views
1 answers
0 votes
Sandy Sharma asked Jul 28, 2018
6,872 views
Show that the sequence {an} is a solution of the recurrence relation an = -3an-1 + 4an-2 ifa) an = 0b) an = 1c) an = (-4)nd) an = 2(-4)n + 3In the question What is sequence {an} ??And how to solve this kind of question?
1.4k
views
1 answers
0 votes
Abhinavg asked Mar 31, 2018
1,435 views
Find a recurrence relation for Cn the number of ways to parenthesize the product of n+1 numbers , x0*x1*x2.......*xn , to specify the order of ... ways to parenthesize x0*x1*x2*.....*xn to determine the order of multiplication.