I saw this question yesterday . Moreover , it has two beautiful answers such that Number of $n$ length word that can be formed using the alphabets $a$, $b$, $c$, $d$ such that $a$ and $b$ never come together.
The question says that
Number of $n$ length word that can be formed using the alphabets $a$, $b$, $c$, $d$ such that $a$ and $b$ never come together.
I tried to solve this question , but i reached to wrong answer because of overcounting. When i tried Goulden-Cluster method , i made very big mistake because i should have calculated the number of $n$ lenght word that does not contain $ab$ or $ba$. You can see my wrong answer for this question such that
"Lets use recursion.
Let say that $n$ length string end up with $a$ and do not have $a$ and $b $ together , so there are $a_{n-1}$ such strings
Let say that $n$ length string end up with $b$ and do not have $a$ and $b $ together , so there are $a_{n-1}$ such strings
Let say that $n$ length string end up with $c$ and do not have $a$ and $b $ together , so there are $a_{n-1}$ such strings
Let say that $n$ length string end up with $d$ and do not have $a$ and $b $ together , so there are $a_{n-1}$ such strings
$\color{blue}{However}$, when it end up with $a$ or $b$ ,the preceding term before the last term may be $b$ for $a$ and $a$ for $b$ , such that $.....ab$ or $......ba$. Hence ,we must $\color{red}{subtract}$ those strings. These strings can be indicated by $a_{n-2}$.
Then $a_n=4a_{n-1}-2a_{n-2}$ where $a_3=48,a_2=14 , a_1=4 , a_0=1$
MORE EXPLANATION= Lets assume that a string ends up with $\color{red}{a}$ , and it does not have any substring containing $a$ and $b$ together.Because of it ends up with $\color{red}{a}$ , the substring that does not contain any $a$ and $b$ together has lenght $a_{n-1}$.However , we can see that this substring that does not contain any $a$ and $b$ together might start with $\color{blue}{b}$ such that $(....\color{blue}{b}-\color{red}{a})$.
Then , we obtain strings such that they contain $a$ and $b$ are together in the beginning but not in the rest of string. So , there are $a_{n-2}$ such strings. Thus ,we must subtract them from $4a_{n-1}$ strings. Moreover, this situation is valid for those string that end up with $\color{blue}{b}$. Hence there are $2a_{n-2}$ such strings.
Moreover, when i check the result by goulden -cluster method , i reached the same answer."
Now , i am looking for the true solution by using $\color{red}{Goulden - Jackson Cluster}$ method for this question.
Firstly , i thought that i should find the generating function for never $ab$ .Then , find it for never $ba$. At last , add them each other and subtract the generating function of never $ab$ and $ba$ at the same time.
However, i did not work .
Thanks in advance...