If one were to have a ternary string with no repetition of consecutive $0$'s or $1$'s how would you define the recursive relation?
The first way I tried to solve was to assume $2$ was the last digit where we could have $a_{n-1}$ possible combinations due to no restrictions. For $1$ we can only have $01$ or $02$ and likewise for $0$ we can have $10$ or $20$ so the total strings possible for both is $4a_{n-2}$. I thought we would add it up to get $a_n= a_{n-1}+ 4a_{n-2}$.
This is the wrong answer and the other way I thought of solving it was to take into account that there can be any two possible last digit numbers for this to work for any possible $a_{n-1}$ string scenarios not including the $22$ combo which would be $a_{n-2}$. This gives the correct answer to be $a_n= 2a_{n-1}+a_{n-2}$. I was just wondering why my first reasoning doesn't match the second one. Thanks for your time Varun G.
Where you went wrong is that (for example) if your string ends in 0 you can indeed have the last two digits 10 or 20, and indeed 20 gives an unrestricted $n-1$ string before it, but for the 10 case you have a restriction on the $n-1$ string before it, namely that that substring can't end in 1. So you don't have $4 a_{n-2}$.