# How many length n binary numbers have no consecutive zeroes ?Why we get a Fibonacci pattern? [duplicate]

Possible Duplicate:
How many $N$ digits binary numbers can be formed where $0$ is not repeated

I am really embarrassed to ask this as it seems like a textbook question.But it is not, and I am at a complete loss how to get a grip on it.It is mentioned in the first lecture of a 24 lecture series on Discrete Mathematics by the popular Mr.Arthur Benjamin(Discrete Mathematics-The Great Courses),which I am following.He only fleetingly mentions that we use combinatorics to solve this and starting with n=1 (1 bit number), the answer follows the Fibonacci pattern 2,3,5,8......So please answer this for me lest I get discouraged from the start of the subject itself.

i)If we are asked to find the number of n-length binary numbers with no consecutive zeroes,then how do we go about it?I have a fair idea about combinatorics,binary coefficients,permutations, yet I just can't figure how to start.So what is the logic we use?

ii)Why does it follow a Fibonacci pattern for n,n+1,n+2 and so on?This further bewilders me.Why on earth is a Fibonacci pattern generated?There must be an explanation...

Your clear and easy-to-understand answers will go a long way in motivating me further into the subject.Thanks!

-

## marked as duplicate by Austin Mohr, Davide Giraudo, Hagen von Eitzen, 5PM, TMMJan 20 '13 at 19:23

Set up a recurrence relation and show that it is exactly identical to that of Fibonacci. – Calvin Lin Jan 20 '13 at 18:01
@AustinMohr I checked that.It was helpful but still doesn't clear the confusion I am facing, especially about the Fibonacci pattern.Is it OK if I let the question stay? – Ivy Mike Jan 20 '13 at 18:02
@Ivy: If you know about that question, you should a) link to it and b) explain specifically what it is about the answer there that you don't understand. Otherwise people will just give duplicate answers to the duplicate question and it would be pure luck if they clear up the part that you didn't understand in the other answer. – joriki Jan 20 '13 at 18:09
I disagree with closing this as a duplicate. This question also asks about "Fibonacci pattern" – Thomas Jan 20 '13 at 18:35
@IvyMike The Fibonacci pattern arises because the recurrence and initial conditions happen to be the same. This is mentioned in the accepted answer to the question I linked. Is there a more specific doubt you are having? – Austin Mohr Jan 20 '13 at 21:00

Consider the length $n$ binary strings with no repeated zeros (BSWNRZ).

BSWNRZ must end in a $0$ or a $1$. The number of BSWNRZ of length $n$ that end in a $0$ is equal to the number of BSWNRZ of length $n-2$ (with $10$ appended). The number of BSWNRZ of length $n$ that end in a $1$ is equal to the number of BSWNRZ of length $n-1$ (with $1$ appended).

That is, any length $n$ BSWNRZ falls into one of the following two cases

$$\overbrace{?????????????????}^{\text{any length }n-2\text{ BSWNRZ}}\color{#00A000}{1}\color{#C00000}{0}\\ \underbrace{??????????????????}_{\text{any length }n-1\text{ BSWNRZ}}\color{#C00000}{1}$$

Therefore, the number of BSWNRZ of length $n$ is equal to the number of BSWNRZ of length $n-1$ plus the number of BSWNRZ of length $n-2$. Thus, the Fibonacci pattern. $$F_n=F_{n-1}+F_{n-2}$$

-