1Function: matpermanent 2Section: linear_algebra 3C-Name: matpermanent 4Prototype: G 5Help: matpermanent(x): permanent of the matrix x. 6Doc: permanent of the square matrix $x$ using Ryser's formula in Gray code 7 order. 8 \bprog 9 ? n = 20; m = matrix(n,n,i,j, i!=j); 10 ? matpermanent(m) 11 %2 = 895014631192902121 12 ? n! * sum(i=0,n, (-1)^i/i!) 13 %3 = 895014631192902121 14 @eprog\noindent This function runs in time $O(2^n n)$ for a matrix of size 15 $n$ and is not implemented for $n$ large. 16