If I have say the string $1010010001010101$, which has a length of $16$ and there are $12$ flips. My thoughts are to just count the number of ways I can stick a $10$ in the there so ${n-1 \choose 0.5k}$ but I know that doesn't account for the times the first and last bits aren't the same and $k$ is odd, or what the bits in between the $10$ are, since they could be a run of $1$s or $0$s.
Been out of school for a couple of years and it's kind of depressing how much I've forgotten, so any help would be greatly appreciated, thanks