I was trying to solve this problem: Count the number of bit-strings of length 8 with 3 consecutive zeros or 4 consecutive ones. and I thought I could use binomial coefficient. Number of bit strings with 3 consecutive zeros or 4 consecutive 1s
I figured since 3 consecutive 0s could be treated as one, I could find the number of strings via:
$C(6,1) + C(6,2) + C(6,3) + C(6,4) + C(6,5) + C(6,6)$
$$\frac{6!}{1!5!}+\frac{6!}{2!4!}+ \frac{6!}{3!3!}+ \frac{6!}{4!2!}+\frac{6!}{1!5!}+\frac{6!}{0!6!}$$ $$6 + 15+20+15+6+1 = 63$$
But I was expecting this to be 107?
Note, if three consecutive $0$'s are collapsed to one $0$, the resulting strings are not always uniquely obtained from a string of length $8$. For instance \begin{align*} 0001010,\qquad 0100010,\qquad 0101000 \quad\rightarrow\quad 01010 \end{align*} which explains that $63$ does not give all wanted strings.
According to the paper (p.7) the generating function $f(s)$ is \begin{align*} f(s)=\frac{1}{1-ds-\text{weight}(\mathcal{C})}\tag{1} \end{align*} with $d=|\mathcal{V}|=2$, the size of the alphabet and $\mathcal{C}$ the weight-numerator of bad words with \begin{align*} \text{weight}(\mathcal{C})=\text{weight}(\mathcal{C}[000])+\text{weight}(\mathcal{C}[1111])\tag{2} \end{align*}
The $\color{blue}{147}$ valid words are: $$ \begin{array}{cccccc} 00000000&00000001&00000010&00000011&00000100&00000101\\ 00000110&00000111&00001000&00001001&00001010&00001011\\ 00001100&00001101&00001110&00001111&00010000&00010001\\ 00010010&00010011&00010100&00010101&00010110&00010111\\ 00011000&00011001&00011010&00011011&00011100&00011101\\ 00011110&00011111&00100000&00100001&00100010&00100011\\ 00101000&00101111&00110000&00110001&00111000&00111100\\ 00111101&00111110&00111111&01000000&01000001&01000010\\ 01000011&01000100&01000101&01000110&01000111&01001000\\ 01001111&01010000&01010001&01011000&01011110&01011111\\ 01100000&01100001&01100010&01100011&01101000&01101111\\ 01110000&01110001&01111000&01111001&01111010&01111011\\ 01111100&01111101&01111110&01111111&10000000&10000001\\ 10000010&10000011&10000100&10000101&10000110&10000111\\ 10001000&10001001&10001010&10001011&10001100&10001101\\ 10001110&10001111&10010000&10010001&10011000&10011110\\ 10011111&10100000&10100001&10100010&10100011&10101000\\ 10101111&10110000&10110001&10111000&10111100&10111101\\ 10111110&10111111&11000000&11000001&11000010&11000011\\ 11000100&11000101&11000110&11000111&11001000&11001111\\ 11010000&11010001&11011000&11011110&11011111&11100000\\ 11100001&11100010&11100011&11101000&11101111&11110000\\ 11110001&11110010&11110011&11110100&11110101&11110110\\ 11110111&11111000&11111001&11111010&11111011&11111100\\ 11111101&11111110&11111111\\ \end{array} $$