How to make the $\ell_2$ norm of all columns and rows of an $n \times n$ matrix equal to $\sqrt{n}$?
HINT If we have the diagonal matrix: $$ D = \left[\begin{array}{cccc}
d_1&amp;0&amp;0&amp;0\\
0&amp;d_2&amp;0&amp;0\\
0&amp;0&amp;\ddots&amp;0\\
0&amp;0&amp;0&amp;d_n
\end{array}\right]$$

Multiplying another matrix $$M_r = \left[\begin{array}{c}
r_1\\
r_2\\
\vdots\\
r_n
\end{array}\right]$$to the left with it multiplies each row like this:

$$DM_r = \left[\begin{array}{c}
d_1r_1\\
d_2r_2\\
\vdots\\
d_nr_n
\end{array}\right]$$

If the matrix has the columns $$M_c = \left[\begin{array}{cccc}
c_1&amp;
c_2&amp;
\dots&amp;
c_n
\end{array}\right]$$

Then multiplying from the right with D will give:

$$M_cD = \left[\begin{array}{cccc}d_1c_1&amp;d_2c_2&amp;\dots&amp;d_nc_n
\end{array}\right]$$