Shuffling Four Kinds of Each Two Cards So That None of Them Remains in the Same Place

74 Views Asked by At

I am asking for your help with solving the problem.

I encountered this problem in a blog post about derangements. The author of the blog stated the answer is $297$.

I solved by tree diagram for $1$, $2$, and $3$ kinds. ($0$, $1$, $10$ ways) Then I proceeded to solve in the same method. But there were too many branches. So, the tree diagram doesn't seem to be the right idea. How should I proceed?

1

There are 1 best solutions below

0
On BEST ANSWER

My interpretation: how many ways are there to permute the string "AABBCCDD" in such a way that no letter A will stand on first or second place, no letter B not third or fourth spot, no letter C on fifth or sixth spot and no letter D on one of the last two spots.

Number the spots with $1,2,3,4,5,6,7,8$.

For $i=1,2$ let $A_i$ denote the set of permutations such that on spot $i$ a letter A is placed.

For $i=3,4$ let $B_i$ denote the set of permutations such that on spot $i$ a letter B is placed.

For $i=5,6$ let $C_i$ denote the set of permutations such that on spot $i$ a letter C is placed.

For $i=7,8$ let $D_i$ denote the set of permutations such that on spot $i$ a letter D is placed.

Then to be found is:$$\frac{8}{2!2!2!2!}-|A_1\cup A_2\cup B_3\cup B_4\cup C_5\cup C_6\cup D_7\cup D_8|$$

Working this out with the principle of inclusion/exclusion and symmetry we find:

$$2520-8\left|A_{1}\right|+4\left|A_{1}A_{2}\right|+24\left|A_{1}B_{3}\right|-24\left|A_{1}A_{2}B_{3}\right|-32\left|A_{1}B_{3}C_{5}\right|$$$$+6\left|A_{1}A_{2}B_{3}B_{4}\right|+48\left|A_{1}A_{2}B_{3}C_{5}\right|+16\left|A_{1}B_{3}C_{5}D_{7}\right|$$$$-24\left|A_{1}A_{2}B_{3}B_{4}C_{5}\right|-32\left|A_{1}A_{2}B_{3}C_{5}D_{7}\right|+4\left|A_{1}A_{2}B_{3}B_{4}C_{5}C_{6}\right|+24\left|A_{1}A_{2}B_{3}B_{4}C_{5}D_{7}\right|$$$$-8\left|A_{1}A_{2}B_{3}B_{4}C_{5}C_{6}D_{7}\right|+\left|A_{1}A_{2}B_{3}B_{4}C_{5}C_{6}D_{7}D_{8}\right|$$

Beware that e.g. $|A_1A_2B_3C_5|=\frac{4!}{0!1!1!2!}$.

The final outcome appears to be:$$2520-5040+360+4320-720-1920+36+576+384-72-192+4+48-8+1$$$$=297$$