All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Numbers > Sequences
2Z out (Posted on 2018-10-05) Difficulty: 3 of 5
Provide a formula for number of binary sequences of length n that have no consecutive 0's.

No Solution Yet Submitted by Ady TZIDON    
Rating: 5.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution Answer Comment 2 of 2 |
Let f(n) be the number of n-digit sequences with no 2 consecutive 0's. There are 2 1-digit sequences with no consecutive 0's. They are 0 and 1. Therefore, f(1)=2. There are 3 2-digit sequences with no consecutive 0's. They are 01, 10, and 11. Therefore, f(2)=3. Take any n>3. If an n-digit sequence starts with 1, then any n-1-digit sequence with no consecutive 0's can be the last n-1 digits. If an n-digit sequence starts with 0, then the next digit must be 1 to avoid 2 consecutive 0's. Then, any n-2-digit sequence with no consecutive 0's can be the last n-2 digits. Therefore, f(n)=f(n-1)+f(n-2). Then, f(n)=Fibonacci(n+2).

Edited on October 6, 2018, 9:09 am
  Posted by Math Man on 2018-10-06 09:03:20

Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (0)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information