# Matrix with given row and column sums

Let $N$ and $K$ be two given integer numbers different from zero. Let $S_n$ with $n=1,...,N$ and $C_k$ with $k=1,...,K$ strictly positive integer numbers such that

$$\sum_{n=1}^NS_n=\sum_{k=1}^KC_k=L.$$

Consider the system of equations

$$\left\{\begin{array}{lll} \sum_{k=1}^K\varphi_n\,\xi_k & = & S_n,~n=1,...N,\\ \sum_{n=1}^N\varphi_n\,\xi_k & = & C_k,~k=1,...K, \end{array}\right.$$

where $\varphi_n$ with $n=1,...,N$ and $\xi_k$ with $k=1,...,K$ are strictly positive real numbers. I want to show that there is a unique solution given by

$$\varphi_n\,\xi_k = \frac{S_n\,C_k}{L}.$$

Clearly the expression above is a solution, but I guess that it is the unique solution.

By construction you have that $\frac{\epsilon_k}{\epsilon_l}=\frac{C_k}{C_l}$ and $\frac{\psi_m}{\psi_n}=\frac{S_m}{S_n}$. Consequently there exists constants $a,b$ for which
$$\epsilon_k=aC_k~\text{and}~\psi_n=bS_n$$ Hence we obtain $\epsilon_k\psi_n=abC_kS_n$. What remains is finding $ab$. This can be done by summing $\epsilon_k\psi_n$ over all coordinates. Note that sum of all coordinates is equal to $L$. Then, you have that $$ab\sum_k\sum_n\epsilon_k\psi_n=ab\sum_k\epsilon_k\sum_n\psi_n=abL^2=L$$ hence $ab=1/L$. Overall you find that $$\epsilon_k\psi_n=\frac{C_kS_n}{L}$$