A counting problem involving some cyclic structure Let $a_i\in \{0,1\}$, and $a_i'=1-a_i$, $i=1,2,\ldots,m$. 
We want to obtain an explicit formula of counting from $2^m$ possible $(a_1,a_2,\ldots,a_m)$'s, how many satisfy
$$
\# \{i: a_i=a_{i-1}'=1\}=r,
$$
where $a_0'$ is understood as $a_m'$, $0\le r\le m/2$. It is easy to see that $r=\#\{i: a_i=a_{i-1}'=0\}$.
For example in the following table
$$
a_i \quad 1 \quad 0 \quad 1\quad 1 \quad 0\\
a_i'\quad 0 \quad 1\quad 0 \quad 0 \quad 1
$$
$r=2$.
If $r=0$, there are also only 2.
I have tried to think about placing the $r$ of $a_i=a_{i-1}'=1$'s first, which has$\frac{m(m-2)\ldots(m-2r+2)}{r!}$ ways. But then I found that the placing of $a_i=a_{i-1}'=0$'s depends on your placing of $a_i=a_{i-1}'=1$'s. 
For example, when $m=6$ and $r=2$, 
if I place  $a_i=a_{i-1}'=1$'s in the following way:
$$
a_i \quad X \quad X \quad 1\quad X \quad 1 \quad X\\
a_i'\quad X \quad 1\quad X \quad 1 \quad X \quad X
$$
then in the middle diagonal $X$'s there has to be an  $a_4=a_{3}'=0$.
But if I place $a_i=a_{i-1}'=1$'s in the following way:
$$
a_i \quad X \quad 1 \quad X\quad X \quad 1 \quad X\\
a_i'\quad 1\quad X\quad X \quad 1 \quad X \quad X
$$
one $a_i=a_{i-1}'=0$ can be $a_3=a_{2}'=0$ or  $a_4=a_{3}'=0$, which has more choices.
 A: This seems to be the number of changes from $1$ to $0$ in the sequence with looping at the end of the sequence.
Consider the sequence to be made of alternating blocks of $0$s and $1$s of length $b_1,\dots,b_k$, $b_1 + \dots + b_k = m$. If $k$ is even, there will be $\frac{k}{2}$ changes and if $k$ is odd there will be $\frac{k-1}{2}$ changes.
Let now $r$ be given. When $k=2r$ there are ${m - 1 \choose k - 1} = {m - 1 \choose 2r - 1}$ ways to choose the lengths of the $b_i$ and $2$ ways to choose whether $b_1$ consists of $0$s or $1$s. Similarly when $k=2r+1$, we get ${m - 1 \choose 2r}$ ways to choose the lengths of the $b_i$.
In total there will then be
$$2{m-1 \choose 2r - 1} + 2{m-1 \choose 2r} = 2 {m \choose 2r} $$
sequences with exactly $r$ changes.
A: You get the property your looking for every time a 0 preceeds a 1 in the original string, and considering the string to be circular. So for example if i had m=8 and r=3 i would have either three occurrences of a 0 followed by a 1 or two ocurrences of a 0 followed by a 1, and 0 at the end of the string and 1 at the start (considering the string to be circular). 
So imagine i have the first case $\{0,1\},\{0,1\},\{0,1\}.$ Now you can fill the spaces between these to form a string like you suggested with 2 more digits, these can be two 1's, two 0's or a 1 and a 0. You must only make sure you don't distribute them together in the latter case. 
A: I get the same answer with a slightly different approach but i think the general thinking is  along the same lines. 
Take $m$ empty spaces and $k$ markers. Place $k$ markers at random numbered $1$ to $k$ (there are $\binom{m}{k}$ ways in total to do this.) Start at marker one and place either a $1$ or a $0$ in it's place, wlog assume a $1$. Now moving from left to right keep placing $1$'s until we hit marker $2$ in the space occupied by marker $2$ place a $0$. Then keep placing $0$'s until we hit marker 3, and repeat this process cyclically. Now every odd marker contains a $1$ and every even marker contains a $0$. Thus in order to have exactly $r$ occurrences of $0$ followed by a $1$ we require $k=2r$. Finally there are two ways to place the initial marker giving us a total of $2\binom{m}{2r}$ possible ways. 
In addition to this there is the task of proving every that every string with $r$ occurrences of $0$ followed by a $1$ can be represented by placing $2r$ markers. This should not be too difficult.     
