How to find all solutions of the following system of equations? Problem. Let $m, n$ be natural numbers. Can we find all the solutions of the following system of equations?
$$\sum_{1\leq i\leq m, 1\leq j \leq  n} x_{ij} =1\\
\left(  \sum_{1\leq p\leq m} x_{pj}  \right) \left(  \sum_{1\leq q\leq n} x_{iq}    \right) = x_{ij}
\hspace{0.5cm} 
\forall 1\leq i\leq m, 1\leq j \leq  n$$
Note. The problem has many solutions. Indeed, consider the simple case $m=n=2$, it is easy to see that
$$x_{ij}=\frac{1}{4} \hspace{0.5cm}  \forall i,j\in \{1,2\}$$
and $$x'_{1j}=\frac{1}{2}; x'_{2j}=0 \hspace{0.5cm}  \forall j\in \{1,2\}$$ are solutions.
Comment. I have no idea how to tackle above problem. So I really appreciate any hints!
 A: Reformulating the problem in terms of row sums:
$$ r_i = \sum_{1\le q \le n} x_{iq} $$
and column sums:
$$ s_j = \sum_{1\le p \le m} x_{pj} $$
gives a full set of solutions rather quickly.
The sum of all entries $x_{ij}$ being one, the first requirement, implies both the sum of all row sums equals one and the sum of all column sums equals one:
$$ \sum_{1\le i \le m} r_i = 1 $$
$$ \sum_{1\le j \le n} s_j = 1 $$
So these two conditions are necessary for a solution.  The final requirement is just that:
$$ s_j r_i = x_{ij} $$
which is satisfied by assigning that value to $x_{ij}$ once the $r_i,s_j$ values are chosen.
It remains only to show that the conditions above for $r_i,s_j$ are sufficient.  That is, given the definition $x_{ij} = r_i s_j$, we check the row sums and column sums are as we supposed them to be:
$$ \sum_{1\le q \le n} x_{iq} = \sum_{1\le q \le n} r_i s_q = r_i \sum_{1\le q \le n} s_q = r_i $$
$$ \sum_{1\le p \le m} x_{pj} = \sum_{1\le p \le m} r_p s_j = s_j \sum_{1\le p \le m} r_p = s_j $$
Note that we've used respectively here that the sum of column sums $s_q$ is one and that the sum of row sums $r_p$ is one.
To summarize, any choice of such values $r_i,s_j$ for $1\le i \le m$ and $1\le j \le n$ gives a solution of the original problem.  Conversely, any solution will be of that form.
