# Matrix normalization for constant row and column sums

From a mxn matrix M with only strictly positive elements, I want to multiply each row and each column by real values in order to obtain a matrix N whose row sums are all 1/m and column sums are all 1/n.

For instance if n=m=2

$M=\begin{pmatrix} a&b \\\ c&d \end{pmatrix}$

then

$N=\begin{pmatrix} \lambda \alpha a & \lambda \beta b \\\ \mu \alpha c & \mu \beta d \end{pmatrix}$

and we want that $\lambda \alpha a + \lambda \beta b = \mu \alpha c + \mu \beta d = \lambda \alpha a + \mu \alpha c = \lambda \beta b + \mu \beta d = 0.5$

In general, We see that we have m+n variables with m+n-1 non-linear equations. (the equations over rows give the sum of all elements of the matrix as the equations over columns). So we can set the value of one of the coefficient (eg : $\lambda=1$ in the previous example)

I can easily find the result for m=n=2 and I imagine that the resolution practicly feasible but I would like to find a general formula whatever would be m or n.

Any help would be welcome.

-
How does this work even for 2 by 2 matrices, say, for (1,1; 0,1)? Am I missundertanding something, or do you have more assumptions on your matrix? –  quid Mar 9 '11 at 16:16
For nonnegative matrices and nonnegative scaling factors, this is sometimes called the matrix scaling problem.'' The most recent reference I am aware of is springerlink.com/content/675n557033217033 - you might want to look in there for refs. –  alex Mar 9 '11 at 17:07
Sorry, I forgot to tell that M has only strictly positive elements for 2 x 2 matrix, I found the upper left element of N to be 1/(2.(1+sqrt(bc/da)).Other element can be constructed using symmetry. The N matrix itself is symmetrical. Thank you for the link I will check it. –  Arnaud Mar 9 '11 at 18:11