F = ryser M
Uses Ryser's inclusion-exclusion formula (see page 27 of Ryser, Herbert John (1963), Combinatorial Mathematics, The Carus mathematical monographs, The Mathematical Association of America).
Let $M=(m_{i,j})$ be an nxn matrix. Then $perm(M)=\sum_{S\subseteq [n]} (-1)^{\mid S\mid} \prod_{i=1}^n \sum_{j\in S^c}m_{i,j}$.
For example, for the 3x3 generic matrix Ryser’s formula gives $perm(M) = (a + b + c)(d + e + f)(g + h + i) − (a + b)(d + e)(g + h)−(a + c)(d + f)(g + i) − (b + c)(e + f)(h + i) + adg + beh + cfi$.
Here is the permanent of a 3x3 generic matrix of variables.
|
|
|
Here is the permanent of a 4x4 generic matrix of variables.
|
|
|
Here is the permanent of a 3x3 matrix of integers.
|
|
Computationally intensive for moderate size matrices.
The object ryser is a method function.