# A problem on calculating rank of a matrix

Let $x_1, x_2, x_3, x_4, y_1, y_2, y_3$ and $y_4$ be fixed real numbers, not all of them equal to zero. Define a $4 \times 4$ matrix A by

$$\left( \begin{array}{ccc} x_1^2+y_1^2 & x_1x_2+y_1y_2& x_1x_3 +y_1y_3& x_1x_4 +y_1y_4\\ x_2x_1+y_2y_1 & x_2^2+y_2^2 & x_2x_3 +y_2y_3 & x_2x_4 +y_2y_4 \\ x_3x_1+y_3y_1 & x_3x_2 +y_3y_2 & x_3^2+y_3^2 & x_3x_4 +y_3y_4 \\ x_4x_1+y_4y_1 & x_4x_2 +y_4y_2 & x_4x_3 +y_4y_3 & x_4^2+y_4^2 \end{array} \right)$$. We need to calculate its rank.

In the worst case lets assume all except one variables are zero. Then exactly one entry of the matrix is non-zero, thus the rank is 1. Is this correct ?

-
If all except one are $0$, then you get a $0$-matrix with one non-zero diagonal entry, which will have deteminant $0$. – gt6989b May 7 '13 at 14:27

$$A = (x_1, x_2, x_3, x_4)^T (x_1, x_2, x_3, x_4) + (y_1, y_2, y_3, y_4)^T (y_1, y_2, y_3, y_4)$$
If the resulting sum is not the zero matrix, then its rank is at least 1. Sufficient conditions for the rank to be exactly 1 are for the matrix $A$ to be nonzero and for the vectors $(x_1, x_2, x_3, x_4)$ and $(y_1, y_2, y_3, y_4)$ to be linearly dependent.
Conversely, if the rank is at least 1, then $A$ is not the zero matrix. Also, for the rank of $A$ to be exactly 1, it is necessary for the vectors $(x_1, x_2, x_3, x_4)$ and $(y_1, y_2, y_3, y_4)$ to be linearly dependent.
Combining these observations gives us exact characterizations of when $A$ has rank respectively 0, 1, or 2. Among other things this confirms the OP's idea, that if exactly one variable is nonzero, then the rank of $A$ is 1.