How many binary strings of length are there such that there are no consecutive zeros and an even number of ones?
This problem is shared by Muhammad A.
Details and assumptions
A binary string is a sequence of integers that are or . The length of a string refers to the number of integers in it.
As an explicit example, the binary string of length are , .
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
First, we observe that if there are 4 or fewer ones, then two zeroes must be next to each other.
If there are 6 ones, then the 4 zeroes can go in 7 possible positions, and there are ( 4 7 ) ways to do this. If there are 8 ones, then the remaining 2 zeros can go in 9 possible positions, giving ( 2 9 ) ways. If there are 1 0 ones, there are no zeros to be placed. Thus, the answer is ( 4 7 ) + ( 2 9 ) + 1 = 7 2 .