number of derangements

797 Views Asked by At

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

There are 1 best solutions below

2
On

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!$$