Ask Your Question

Partitioning a (1,-1)square matrix into (0,-1,1)summand matrices

asked 2022-01-06 16:25:20 +0100

sgmth gravatar image

Given a square matrix M with entries from {1,-1} how to find all possible sets of matrices A1,A2,A3.....(with entries from {0,-1,1}), such that M=A1+A2+A3....

edit retag flag offensive close merge delete


Welcome to Ask Sage! Thank you for your question.

slelievre gravatar imageslelievre ( 2022-01-06 18:20:52 +0100 )edit

Do you require the matrices $A_j$ to be pairwise distinct?

That way there would be finitely many tuples of matrices $A_j$ summing to M.

One could also forbid having $A_j = 0$ for any $j$, and forbid having $A_j = -A_k$ for any $j$ and $k$.

slelievre gravatar imageslelievre ( 2022-01-06 18:24:32 +0100 )edit

Homework ?

Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 2022-01-06 19:17:11 +0100 )edit

Question refined at Ask Sage question 63305.

slelievre gravatar imageslelievre ( 2022-07-20 12:10:14 +0100 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2022-01-07 04:31:12 +0100

slelievre gravatar image

For each nonnegative integer $k$, you could find the possible tuples of matrices $(A_1, ..., A_k)$ as follows:

  • for each of -1, 0, 1, find the ways to write it as a sum of $k$ summands each in {-1, 0, 1}.

  • the target matrix $M$ has $n^2$ entries $m_{i, j}$; so the $(A_1, ..., A_k)$ are obtained by combining all the possible ways to get each entry.

edit flag offensive delete link more


First of all apologies for replying very late as I was busy with some other things and I logged again yesterday only after so many months. I am really sorry for that. Yes, your idea of finding ways to write -1,0,1 as k summands of {-1,0,1} appears to be very good. i will try to make the code accordingly. Thanks a lot.

sgmth gravatar imagesgmth ( 2022-07-20 12:02:47 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2022-01-06 16:25:20 +0100

Seen: 186 times

Last updated: Jan 07 '22