Constructing sequences given restrictions I wish to construct a sequence given certain restrictions. First however, I will introduce some needed terminology.
Let $B_n$ denote the $n$'th block of zeroes so that we have $$\cdots 1B_{-3}1B_{-2}1B_{-1}1B_{0}1B_{1}1B_{2}1\cdots$$
A block of zeroes may be empty (no zeroes).
A $\textit{chain}$ is a sequence of adjacent blocks. For example, $B_{-1}B_{0}$ is a $2$-chain since it is made up of $2$ blocks of zeroes. $B_{-1}B_{2}$ is not a chain because $B_{-1}$ and $B_{2}$ are not adjacent.
Consider only a finite sequence which begins and ends with $1$'s. With three $0$'s and five $1$'s (as a finite case example), I wish to construct a sequence such that two equally sized chains have a difference of total number of zeroes of at most $1$.
The sequence $$10101011$$ is valid because given any two chains of equal length, the difference in the total number of zeroes for each chain will be at most $1$. 
How many ways are there to construct a valid sequence given three $0$'s
 and five $1$'s (the sequence begins and ends with $1$'s)? I want to construct an argument for the general case, but do not know how to do that just yet so this finite case will hopefully help.

I know how to calculate the total number of ways to create such a finite sequence, but I do not know how to handle the restriction aside from manually counting the invalid sequences. I wish to know this for the general case.
 A: A start: Given five ones and three zeros, you have four possible places to put three zeros. Clearly no blocks of size two are possible, since there has to be at least one block of size zero. All the arrangements with blocks of size one seem to work, so you have $\binom{4}{3}=4$ choices.
Suppose you want $n$ ones and $m$ zeros. If you think of all the ones lined up, your task is now to choose a place for the zeros. This is equivalent to choosing a placement of $m$ indistinguishable balls in $n-1$ distinguishable boxes, the stars and bars problem, or equivalently, choosing a function from $\{1, \dotsc, m\} \to \{1, \dotsc, n-1 \}$, up to permutation of the domain. There are $\left( \binom{n-1}{m} \right)=\binom{n+m-2}{n-2}$ of these.
A nice case is when $n-1$ is greater than $m$; then there must be at least one block with size zero, and then by your restriction we can never have two consecutive zeros. This means we are choosing the placement of $m$ balls in $n-1$ boxes, without repetition. There are $\binom{n-1}{m}$ ways to do this. A nice place to start is to ask when such a choice satisfies your restriction or not. From here on out let me use the ball/box formulation for convenience.
Consider the restriction you give on $k$ chains, with $k$ considered one at a time. 


*

*The condition on $1$ chains is always satisfied (since we're considering only $n-1>m$ for the moment).

*The condition on $2$ chains says that there cannot two adjacent boxes with a ball and two adjacent boxes with no ball.

*Consider the possible differences in three chains. I claim a difference of $3$ between three chains is disqualified by the condition on two chains above. So we need to rule out the cases where three chains differ by exactly two. 


n. I suspect as we move forward, the case of a difference of three or more will always be taken care of by the previous condition, and you only need figure out how many possibilities there are where $n$ chains differ by exactly two.
This may set you up for some kind of induction argument where you can count in the general case.
