Post Reply 
Construct Matrix with given Permanent
01-03-2024, 11:55 PM (This post was last modified: 01-04-2024 01:20 AM by Albert Chan.)
Post: #4
RE: Construct Matrix with given Permanent
We can use DSU (Decorate Sort Undecorate) to avoid manually swapping columns.

Starting from original puzzle m

> m:=concat(transpose(map(sum,m)), m)
> m:=sort(m)
> DELCOL(m,1)
> m:=transpose(m)

Do the same for its transpose

> m:=concat(transpose(map(sum,m)), m)
> m:=sort(m)
> DELCOL(m,1)
> m:=transpose(m)

\(\left(\begin{array}{cccccccccccc}
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 1 \\
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 1 & 1 \\
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 1 & 1 & 1 \\
0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 1 & 1 & 1 & 1 \\
0 & 0 & 0 & 0 & 0 & 0 & 1 & 1 & 1 & 1 & 1 & 1 \\
0 & 0 & 0 & 0 & 0 & 1 & 1 & 1 & 1 & 1 & 1 & 1 \\
0 & 0 & 0 & 0 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 \\
1 & 1 & 1 & 1 & 1 & 1 & 0 & 0 & 1 & 1 & 0 & 1 \\
0 & 0 & 0 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 \\
0 & 0 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 \\
0 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 \\
1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1
\end{array}\right) \)

> horner(m[8],2)      → 4045
> ceiling(Ans/2)        → 2023 // = permanent(m)
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Construct Matrix with given Permanent - Albert Chan - 01-03-2024 11:55 PM



User(s) browsing this thread: 5 Guest(s)