We have 5 monkeys $a,b,c,d,e$ and we are interested in the number of ways to have them stand in a row without $a$ and $b$ being next to each other.
The part that I struggle with most is that I don't fully understand how to solve this when the 5 are different. It's not the same as for example coloring 5 segments either blue or red without any two neighboring segments being red.
This is how I tried to solve this but I'm certain that there's something wrong. I would really appreciate it if you could also critique my approach.
Idea:
Let $f_{k}$ be the number of ways we can have the $5$ monkeys in a row without $a$ and $b$ being next to each other. We try to do this recursively:
case 1 : the last monkey is not $a$ or $b$: then we have $f_{k-1}$ possibilities for the rest of the k-1 monkeys.
case 2 : the last monkey is either $a$ or $b$: Here the second to last has to be one of $\{c,d,e\}$. So we have $3$ possibilities for the second to last spot and $2$ possibilities for the last. A total of $2*3 = 6$ and $f_{k-2}$ for the remaining spots.
The recursive equation I get is: $f_{k} = 6 + f_{k-1} + f_{k-2}$
$f_{1} = 5$
$f_{2} = 10$
$f_{3} = 21$
$f_{4} = 37$
$f_{5} = 64$
I'm not sure about my solution.
Thanks in advance