similar problem from Rosen

The Gateway to Computer Science Excellence

First time here? Checkout the FAQ!

x

0 votes

Let $A(n)$ denotes the number of $n$ bit binary strings which have no pair of consecutive $1’s.$ what will be recurrence relation for it and what will be it’s Time Complexity??

0

You can use dynamic programming to get the answer in $O(n)$ , since the recurrence is same as that of the Fibonacci one.

+1

@srestha mam, $a_1=2$ because 0 and 1 are possible strings of size 1 where no consecutive 1 occurs

- All categories
- General Aptitude 1.8k
- Engineering Mathematics 7.3k
- Digital Logic 2.9k
- Programming & DS 4.9k
- Algorithms 4.3k
- Theory of Computation 6k
- Compiler Design 2k
- Databases 4.1k
- CO & Architecture 3.4k
- Computer Networks 4.1k
- Non GATE 1.4k
- Others 1.4k
- Admissions 596
- Exam Queries 577
- Tier 1 Placement Questions 23
- Job Queries 72
- Projects 18

49,532 questions

54,123 answers

187,319 comments

71,044 users