3

In the normal derangement problem we have to count the number of derangement when each counter has just one correct house,what if some counters have shared houses. A derangement of n numbers is a permutation of those numbers in which none of the numbers appears in its original place. For example, the numbers {1,2,3} can be deranged into {2,3,1} and {3,1,2} But in our modified version no number in the derangement can be in the place that a number of the same value was in in the original ordering. So the numbers {1,1,2,2,3} could be deranged into {2,2,1,3,1}, {2,2,3,1,1}, {2,3,1,1,2}, and {3,2,1,1,2}.

How to go about it! any hints?

1 Answers1

3

This is a permutation with forbidden positions. Your specific problem corresponds to the board below, where $X$ in square $(i,j)$ denotes that element $i$ is not allowed to go to position $j$.

XXOOO
XXOOO
OOXXO
OOXXO
OOOOX

Let $r_i$ denote the number of ways to place $i$ rooks on the $X$ squares, such that none attack each other.

$r_1=9$, because there are $9$ squares marked $X$.
$r_2=4^2+4+4+2+2$, because there are $4^2$ ways to pick one square from each of the $2\times 2$ grids, there are $4+4$ ways to pick one square from one of the $2\times 2$ grids plus the lower-right square, and there are $2+2$ ways to pick two squares from each of the $2\times 2$ grids.

You still need to find $r_3, r_4, r_5$. It's fairly tedious but possible. Then, the answer is $$5!-r_14!+r_23!-r_32!+r_41!-r_50!$$

vadim123
  • 82,796
  • I tried figuring out $r_3,r_4,r_5$ however I am not getting the final correct answer. $$r_3=2(2.5)+4.4$$ since there are 2 ways to select two squares from any of the $2 X 2$ grid and 5 ways to select remaining square from any of the 5 remaining squares. The number of $2 X 2$ grid is two and hence the total number is 2(2.5). Another way is to select one square from each of $2X2$ grid and the corner square in 4.4 ways. – user471651 Oct 08 '23 at 12:01
  • $$r_4 = 2.2+2(2.4)$$ since 4 elements can be chosen by selecting two elements from each of $2 X 2$ grid in 2.2 ways and two elements from one of the $2X2$ grid, one element from the other $2X2$ grid and the corner element in 2.(2.4) ways. $$r_5 = 2.2$$ since two elements need to chosen from each of the $2X2$ grid and the corner element. Thus $r_1=9,r_2=28,r_3=36,r_4=20,r_5=4$. Hence the number of derangements come out to be as $$5!-9.4!+28.3!-36.2!+20.1!-4.0!$$ which is 16, however wolfram gives out the answer as 4. Can you please see where is the mistake in the above calculations? Thanks. – user471651 Oct 08 '23 at 12:01