# Number of permutations of six letters with two restrictions

How many permutations of the first six letters of the alphabet are there so that A and C are not adjacent and so that B is not between A and C?

Solution

According to the Complement Principle, the number of such permutations is the difference between 6!and the number of permutations in which A and C are adjacent or so that B is between A and C. The number of permutations in which A and C are together is

\begin{equation*} 5(2!)(4!) = 240 . \end{equation*}

The number of permutations in which only B is between A and C is

\begin{equation*} 4(2!)(3!) = 48 . \end{equation*}

The number of permutations in which B and one other letter are between A and C is

\begin{equation*} 3(2!)\left[\binom{3}{1}(2!)\right](2!) = 72 . \end{equation*}

The number of permutations in which B and two other letters are between A and C is

\begin{equation*} 2(2!)\left[\binom{3}{2}(3!)\right](1!) = 72 . \end{equation*}

The number of permutations in which all the remaining letters are between A and C is

\begin{equation*} (2!)(4!) = 48 . \end{equation*}

So,the number of permutations in which either A and C are together or B is between A and C is

\begin{equation*} 240 + 48 + 72 + 72 + 48 = 480 . \end{equation*}

Equivalently, the number permutations in which A and C are not adjacent and in which B is not between A and C is

\begin{equation*} 6! - 480 = 240 . \end{equation*}

• What exactly is the question??? – barak manos Dec 8 '15 at 13:05
• @barak manos Other letters can be between A and C when "counting the complement." In the permutation ABFCDE, B is between A and C. – user74973 Dec 8 '15 at 13:05
• So whats the answer – Archis Welankar Dec 8 '15 at 13:24

Total ways are $6!=720$ now here we take number of ways where A and C are together by considering them as 1 block so its $(1+4)!.2!=240$ now only B is between so $(1+3)!.2!=48$ Consider ABC as a block,$3$ indicates the three letters besides A,B,C. $2!$ indicates positions for A and C can be interchanged in $2!$ ways . same logic goes for previous and next calculations. Then B,x letter so $(1+2)!.2!.{3\choose 1}.2!=72$ consider A,b,x,C as a block then B,x,y letters so $(1+1)!.2!.{3\choose 2}.3!=72$ same for all letters between A and C so $(1+0)!.2!.4!$ thus number of ways not abiding by condition=$6!-480=240$

• I am looking at your third "sentence," I guess. What is "x"? Does it represent any of D, E, and F? What do each of the factors in "$(1+2)(2!)\tbinom{3}{1}(2!)$" represent? – user74973 Dec 8 '15 at 14:19
• ya any of the three letters chosen – Archis Welankar Dec 8 '15 at 14:23
• @user74973 i have edited – Archis Welankar Dec 8 '15 at 14:25
• Yep, I see that this is analogous to my argument. It is nice to see a slightly different perspective. Your argument could be more lucid by saying "in the case that B and one other letter is between A and C" instead of "A, B, X, C." Actually, by writing "A, B, X, C," you are insisting on a particular order. – user74973 Dec 8 '15 at 15:21
• OK. Since you answered first and you want the credit, I will mark your answer as the accepted answer. – user74973 Dec 8 '15 at 15:21

Indeed.   We must count ways to arrange $A,C$, select $1$ to $3$ letters from $D,E,F$ and arrange them between $A,C$, then arrange that whole block and the remaining letters (including $B$).

$2! (\binom{3}{1}1!4!+\binom{3}{2}2!3!+\binom{3}{3}3!2!)\\ = 2! \cdot 3!\cdot ( 4!/2!+3!/1!+2!/0!)\\ = 240$

• Your first answer was wrong @ graham so i posted it – Archis Welankar Dec 8 '15 at 13:38