Artificial intelligent assistant

The mènage problem and permanent formula I have found the following formula on the wiki. It was stated that the mènage Problem can be solved by the permanent $perm(J-I-I')$. **Question:** How the permanent of the Matrix $J-I-I'$ arises within the mènage Problem; how this combinatorical Expression can be derived? Also, $perm(J-I)$ solves the Derangement Problem, but why? (I have no clue to prove this) Every hints will be greatly appreciated.

Regarding the derangement problem:


Let's consider permutations of $\\{1,\ldots,n\\}.$ Then, $J-I$ is the $n$-by-$n$ matrix with $0$ on the diagonal and $1$ elsewhere, i.e. $$ J-I = (a_{ij})\qquad with\ a_{ij} = 0\ for\ i=j\ and\ a_{ij} = 1\ for\ i\
eq j. $$ By definition of the permanent, we have $$ perm(J-I) = \sum_{\sigma\in S_n}\prod_{j=1}^n a_{j,\sigma(j)}. $$ Looking at the above description of $J-I,$ we see that, for a fixed $\tau\in S_n,$ $$ \prod_{j=1}^n a_{j,\tau(j)} = 1\ if\ \tau\ doesn't\ have\ fixed\ points\qquad and\qquad \prod_{j=1}^n a_{j,\tau(j)} = 0\ if\ \tau\ has\ fixed\ points. $$ Plugging this observation into the above expression for $perm(J-I),$ we find $$ perm(J-I) = \sum_{\sigma\in S_n,\ \sigma\ doesn't\ have\ fixed\ points} 1, $$ which is the number of derangements of $\\{1,\ldots, n\\},$ as desired.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy ae969ce8c7d963060e74e3bffec2a2e4