in Combinatory edited by
535 views
1 vote
1 vote

Find a recurrence relation for the number of bit strings of length $n$ that contain the string $01.$




I am getting a recurrence like An = 2^(n-2) + 2A(n-1) - A (N-2) .Answer is not given for this question.Please help and explain your steps.

in Combinatory edited by
by
535 views

2 Answers

2 votes
2 votes

The strings in complement of A(n) can be of the form:  (4 bit strings assumed)

1111

1110

1100

1000

0000

Thus, A'(n) = n + 1

Thus, A(n) = 2n - (n+1)

0 votes
0 votes
In order to construct a bit string of length $n$, which contain $01$

$(1)$ we could start with $1$ and follow with a string length $n-1$ containing $01$

$(2)$ we could start with $0$ and follow with a string length $n-1$ containing $01$

$(3)$ we could start with $01$ and follow by any string length $n-2$

Therefore recurrence relation will be

$a_{n}=2a_{n-1}+2^{n-2}$

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true