[Math] Permutations with forbidden positions – sit $n$ students in a row

combinatoricspermutations

Suppose we have $N$ students $(N>20)$ that should be seated in a row. ($1-n$
seats)

$1.$ In how many ways can we arrange such that student number $2$ won't sit on chair number $1,3$ or $7$?

$2.$ In how many ways can we arrange such that student number $2$ won't sit on chairs number $1,3$ or $7.$ Student number $1$ won't sit on chairs
$1,2$ or $3$ and student number $7$ won't sit on chair number $13$.

For question number $1$ my answer is $(n-3)\cdot(n-1)!$

But I'm getting troubles with question $24.
I can't see how to count it, should I use inclusion-inclusive-principle?
Any hints?

Thanks a lot.

Best Answer

Since you have done the first one I will go through number $2$. For the sake of brevity I will give the highlights of the method and provide links for further explanation.

I would use rook polynomials.

In this case the chess board looks like

$$\begin{array}{cc} & \text{chairs} \\ \text{students} & \begin{array}{c|c|c|c|c|c|c|c} &2&1&3&7&13&4&\cdots \\\hline 1 &\bbox[silver,10px]{\phantom{H}} &\bbox[silver,10px]{\phantom{H}} &\bbox[silver,10px]{\phantom{H}} & & & &\cdots \\\hline 2 & &\bbox[silver,10px]{\phantom{H}} &\bbox[silver,10px]{\phantom{H}} &\bbox[silver,10px]{\phantom{H}} & & &\cdots \\\hline 7 & & & & &\bbox[silver,10px]{\phantom{H}} &\bbox[white,10px]{\phantom{H}} &\cdots \\\hline 3 &\bbox[white,10px]{\phantom{H}} & & & & & &\cdots \\\hline 4 &\bbox[white,10px]{\phantom{H}} & & & & & &\cdots \\\hline \vdots & \vdots &\vdots &\vdots &\vdots &\vdots &\vdots&\ddots \\ \end{array} \end{array}$$

We have two disjunct forbidden subboards, one consisting of a single square, this has rook polynomial

$$1+x$$

the other consists of two rows of $3$ squares with the lower $3$ offset by $1$ square. The rook polynomial for this is found by manually counting the placements of identical non-attacking rooks. There is $1$ way to place $0$ rooks, $6$ ways to place $1$ rook and $7$ ways to place $2$ rooks, hence the polynomial for this subboards is

$$1+6x+7x^2$$

since they are disjunct subboards the total rook polynomial is

$$(1+x)(1+6x+7x^2)= 1 + 7x + 13x^2 + 7x^3$$

Since the board is $N\times N$ with $N\gt 20$ (assuming the same number of students as seats) then this polynomial transforms by replacing

$$x^k\longrightarrow (-1)^k(N-k)!$$

giving our final answer:

$$\text{arrangements}=N!-7(N-1)!+13(N-2)!-7(N-3)!\tag{Answer}$$

Please see my answer here for more on rook polynomials.