$7$ dwarfs $d_1, ... , d_7$ have $7$ jobs $j_1, ... , j_7$ to do every day.
But: $$d_1 \text{ can't do } j_2, j_3$$ $$d_2 \text{ can't do } j_1, j_5$$ $$d_4 \text{ can't do } j_2, j_7$$ $$d_5 \text{ can't do } j_4$$ How many ways can they separate their work differently each day?
In this task we know that every dwarf can only do $j_6$. $j_1,j_3,j_4,j_5,j_7$ can be done by $6$ dwarfs. And $j_2$ can be done by $5$ dwarfs.
However this observation is not enough to finish this task. I need an intelligent way to connect this fact with a sollution.
Can you help me?
Another way to look at the problem is that it is the number of ways to place seven non-attacking rooks on the following 7 by 7 board, where an $X$ denotes a forbidden square.
"Non-attacking" means that no two rooks may be placed in the same row or column.
We can solve this problem by finding the rook polynomial of the forbidden sub-board, followed by an application of the principle of inclusion / exclusion. The rook polynomial $R(x)$ of a board is by definition a polynomial whose coefficient of $x^n$ is the number of ways to place $n$ non-attacking rooks on the board. We define the number of ways to place zero rooks as $1$. Two sources for additional information about rook polynomials are An Introduction to Combinatorial Analysis by John Riordan and Schaum's Outline of Theory and Problems of Combinatorics by V.K. Balakrishnan.
It's clear we can delete any unused rows or columns without changing its rook polynomial. With that modification, our board becomes $$\begin{bmatrix} &X & & \\ X & &X & \\ X & & & \\ & & &X \\ &X & & \\ & &X & \\ \end{bmatrix}$$ where we have switched to a matrix representation and marked forbidden squares with an $X$. We adopt the convention that such a matrix is interchangeable with the rook polynomial of the marked squares, so for example we may write $$\begin{bmatrix} X \end{bmatrix} = 1 + x$$ because the rook polynomial of a single-square board $\begin{bmatrix} X \end{bmatrix}$ is $1+x$.
Some properties of rook polynomials that we will use are:
To evaluate the rook polynomial of our chosen board, we designate one square, marked with a box, and we divide the possible arrangements of rooks into two cases: those in which a rook is placed on the designated square and those in which it is not. $$\begin{bmatrix} &X & & \\ X & &\boxed{X} & \\ X & & & \\ & & &X \\ &X & & \\ & &X & \\ \end{bmatrix}$$ If $R(x)$ is the rook polynomial of the total board, then since all arrangements fall into one of those two cases, $R(x) = S(x) + x T(x)$, where $S(x)$ is the rook polynomial of the board with the row and column of the designated square deleted, and $T(x)$ is the rook polynomial ot the board with only the designated square deleted. The $x$ in front of $T(x)$ accounts for the rook on the deleted square. Then $$ S(x) = \begin{bmatrix} &X & \\ X & & \\ & &X \\ &X & \\ \end{bmatrix} = \begin{bmatrix}X \end{bmatrix} \begin{bmatrix} X\\ X \end{bmatrix} \begin{bmatrix}X \end{bmatrix} = (1+2x) (1+x)^2 $$ and $$ T(x) = \begin{bmatrix} &X & & \\ X & & & \\ X & & & \\ & & &X \\ &X & & \\ & &X & \\ \end{bmatrix} = \begin{bmatrix} X\\ X \end{bmatrix} \begin{bmatrix} X\\ X \end{bmatrix} \begin{bmatrix}X \end{bmatrix} \begin{bmatrix}X \end{bmatrix} = (1+2x)^2 (1+x)^2 $$ so $$R(x) = x S(x) + T(x) = 1 + 7x + 17x^2 +17x^3 +6x^4$$
By Inclusion / Exclusion, the number of ways to place seven non-attaching rooks on the $7$ by $7$ board with none on the forbidden sub-board is $$1 \times 7! - 7 \times 6! + 17 \times 5! - 17 \times 4! + 6 \times 3! = \boxed{1668}$$