*(This question is a repost of a deleted question I asked, because the previous version had several elements missing)*


**Setting**


For fixed $N \in \mathbb{N}$, **I wish to compute the entries of a matrix $P\_N$** that is $2^N \times 3^N$-dimensional, real-valued and satisfies:


1. $P\_N^T \textbf{1} = \textbf{1}$
2. $\textbf{1} P\_N^T = \frac{3^N}{2^N} \textbf{1}^T$


where $\textbf{1}$ is the all 1's vector in the appropriate dimension. Additionally, $P\_N$ is such that:


(i) its first $2^N$ columns are the first $2^N$ standard basis vectors


(ii) the remaining columns **contain 0's in all positions except two, which are unknown entries, $w\_{i,j}$, that I need to solve for.**


After some analysis, we can conclude that there are (i) $2(3^N - 2^N)$ total variables to solve for, and (ii) $3^N$ equations that they satisfy, which implies that for $N > 3$, the system is "undetermined", so has either no solutions or infinitely many solutions for the $(w\_{i,j})\_{i,j}$


(In actuality, I know everything about where the non-zero entries of $P$ are, as I know the underlying system of equations it is representing. However, I have not included this, as it may not be necessary to my questions, and more importantly it's really complicated
and, as I'm in the middle of formalizing it, the structure is not entirely clear yet either to me).


**Question**


Are there any computational methods or matrix tricks to show that such a system has a solution, for arbitrary $N$? The reason I ask is because the *form* of the matrix makes it really tricky to do so explicitly in this case, and so I wonder if there exist other methods to do this (either computational or theoretical), as admittedly I don't have much background in matrix analysis.


I apologize in this question is vague, I wasn't sure and so I can certainly expand if needed, but really just providing me with the most general suggestions is alright too!


Thank you all!



Methods to solve for a matrix whose entries satisfy certain properties
There are zero or infinitely many solutions depending on where the non-zero entries have to be. So there is no general-purpose answer.


I don't think your equations are properly stated, as $\boldsymbol 1$ seems to have at least two different meanings. I'll interpret your intention as that every row sums to $3^N/2^N$ and every column sums to $1. If that is incorrect, please let us know.


For a subset $R$ of the rows, let $N(R)$ be the set (not multiset!) of columns $c$ such some entry in column $c$ is allowed to be nonzero for some row in $R$. That is, for some $r\in R$, position $(r,c)$ in the matrix is one of those positions not required to be 0.


Here is a necessary and sufficient condition for there to be a non-negative solution: For every subset $R$ of the rows, $|N(R)| \ge (3/2)^N |R|$.


There is a similar dual nsc with the rows and columns reversed.


Whether this is useful will depend on where your non-zero entries have to be, and without that information little more can be said.


