How many ways are there to arrange the letters $a, b, c,$ and $d$ such that $a$ is not followed immediately by $b?$
I am getting $6$ answer, but real answer is $18$
How many ways are there to arrange the letters $a, b, c,$ and $d$ such that $a$ is not followed immediately by $b?$
I am getting $6$ answer, but real answer is $18$
Just subtract ways in which $a$ is followed by $b$ from total number of cases. $24-6=18$
I know that other answers give you a brief idea how it is happening but I hope you will also take a look here.
Since there are objects $a,b,c,d$, so the total ways of arranging them is $4!$. Now, we want the number of ways in which $a$ is not followed by $b$. So just take the cases when $a$ is followed by b and subtract them from total number of cases.
i.e., Fix $ab$ and you will see total arrangement in which $a$ is followed by $b$ is $3!$, (remember you cannot arrange $a$ and $b$).
So, Total ways become $4!-3!=24-6=18$
The total number of permutations is $= 4!$
The total number of permutations in which $a$ is followed by $b$ is $=3!$
The total number of ways in which $a$ is not followed by $b$ is $$= 4!-3!$$ $$=24-6$$ $$=18$$