Post Reply 
Construct Matrix with given Permanent
01-03-2024, 06:06 PM
Post: #2
RE: Construct Matrix with given Permanent
(01-03-2024 05:53 PM)Albert Chan Wrote:  To solve puzzle, we undo randomization, to make above "standard form".
Then, we just read off first row pattern for Permanent.

VA Square Matrix Permanent Puzzle
VA Solution posted yesterday, so this is not a spoiler anymore.

> m := [
[1,0,1,1,1,0,1,1,1,1,1,1],
[0,0,1,1,0,0,0,0,0,1,0,1],
[1,0,1,1,0,0,0,1,0,1,1,1],
[0,0,1,0,0,0,0,0,0,1,0,0],
[1,0,1,1,1,1,1,1,1,1,1,1],
[0,0,1,1,0,0,0,0,0,1,1,1],
[1,0,1,1,1,0,0,1,0,1,1,1],
[0,1,0,1,1,1,1,1,1,1,0,1],
[1,0,1,1,0,0,0,0,0,1,1,1],
[1,1,1,1,1,1,1,1,1,1,1,1],
[0,0,1,0,0,0,0,0,0,1,0,1],
[1,0,1,1,1,0,1,1,0,1,1,1]]

> s:=map(sum,m)      → [10,4,7,2,11,5,8,9,6,12,3,9]

If Permanent Puzzle setup as I predicted, "first row" has 9 1's
We make them slightly different for sorting purpose.

> s[0]:=9.5
> m:=map(sort(s), k->m[index(s,k)])

\(\left(\begin{array}{cccccccccccc}
0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 \\
0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 1 \\
0 & 0 & 1 & 1 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 1 \\
0 & 0 & 1 & 1 & 0 & 0 & 0 & 0 & 0 & 1 & 1 & 1 \\
1 & 0 & 1 & 1 & 0 & 0 & 0 & 0 & 0 & 1 & 1 & 1 \\
1 & 0 & 1 & 1 & 0 & 0 & 0 & 1 & 0 & 1 & 1 & 1 \\
1 & 0 & 1 & 1 & 1 & 0 & 0 & 1 & 0 & 1 & 1 & 1 \\
0 & 1 & 0 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 0 & 1 \\
1 & 0 & 1 & 1 & 1 & 0 & 1 & 1 & 0 & 1 & 1 & 1 \\
1 & 0 & 1 & 1 & 1 & 0 & 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
\end{array}\right)\)

> SWAPCOL(m,10,12)
> SWAPCOL(m,3,11)
> SWAPCOL(m,4,9)
> SWAPCOL(m,3,8)
> SWAPCOL(m,1,7)
> SWAPCOL(m,3,6)
> SWAPCOL(m,1,4)
> SWAPCOL(m,1,3)
> SWAPCOL(m,1,2)

\(\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) \)

"First row" bits (if we move 8th row to top) for Permanent

> 0b11111100110 + 1

2023
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 06:06 PM



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