# similar matrices, real eigenvalues, matrix rank,

I'm not quite sure how to tackle this problem:

Consider a real nxn matrix A, where all elements are zero except those on the diagonal and those in the first row and first column. Also, assume that all diagonal elements differ from zero and that all elements in the first row and first column are strictly positive.

(a) Prove that all the eigenvalues of such a matrix are real.

(b) Prove that the rank of such a matrix is either n or n-1.

My idea: since eigenvalues are a similarity invariant, I could try to compute a similarity transform to find a real symmetric matrix B for which A is similar to.

If I looked at an easier, 2x2 case, I'd have:

$\begin{bmatrix}1&0\\0&x\end{bmatrix}\begin{bmatrix}a&b\\c&d\end{bmatrix} \begin{bmatrix}1&0\\0&x^-1\end{bmatrix} = \begin{bmatrix}a&bx^-1\\cx&d\end{bmatrix}$ =: B

and since b and c are assumed to be positive real numbers, then $cx$ = $bx^-1$ implies that $x^2$ = b/c has a positive, real solution. This shows that we can find a symmetric matrix B for which A is similar to, and since A and B have the same eigenvalues, and B has only real eigenvalues, then A must have only real eigenvalues, as required.

...can anyone comment on proving the general case?

any help with part(b) would be greatly appreciated, too.

edit: I think, with part(b), since the rank of a matrix is also a similarity invariant, then, assuming that I have part(a) proved in full generality, then I can look at the symmetric matrix for which A is similar to, and try to find the rank of this symmetric matrix (though, I don't know if it's any easier to find the rank of a symmetric matrix, compared to finding the rank of a non-symmetric matrix). Then, I apply Guassian Elimination and reduce this symmetric matrix to row-echelon form.

Some scratch work leads me to believe that the row-echelon form of the symmetric matrix either has full rank = n, or rank = n-1 (if the entry in the last row, last column were 0). And since elementary row operations are rank-preserving, we know that the symmetric matrix has rank = n or n-1, which implies that the original matrix, A, must also have rank = n or n-1.

I feel like I have to make this more precise, though.

Thanks,

Let $$A:=\begin{bmatrix}\alpha&b^T\\c&D\end{bmatrix},$$ where $b$ and $c$ are positive vectors and $D$ is a nonsingular diagonal matrix.
The second part is easy. If a matrix contains a sub-matrix of the rank $k$, the rank of the matrix is at least $k$. Since $D$ is by assumption a nonsingular $(n-1)\times (n-1)$ matrix, it follows that the rank of $A$ is at least $n-1$, that is, $n-1$ or $n$.
The first part can be solved by symmetrizing $A$ as you already did for the $2\times 2$ case (the generalization is straightforward). Consider a simple diagonal scaling $$X=\begin{bmatrix}1&0\\0&Y\end{bmatrix},$$ where $Y:=\mathrm{diag}(\eta_2,\ldots,\eta_n)$ and its action on $A$: $$B:=XAX^{-1}=\begin{bmatrix}1&0\\0&Y\end{bmatrix}\begin{bmatrix}\alpha&b^T\\c&D\end{bmatrix}\begin{bmatrix}1&0\\0&Y^{-1}\end{bmatrix}=\begin{bmatrix}\alpha&b^TY^{-1}\\Yc&YDY^{-1}\end{bmatrix}.$$ Note that $YDY^{-1}=D$ and that $B$ is symmetric iff $Yc=Y^{-1}b$. With $b:=[\beta_2,\ldots,\beta_n]^T$ and $c:=[\gamma_2,\ldots,\gamma_n]^T$, it means that we want the scaling matrix $Y$ to satisfy $$\eta_i\gamma_i=\frac{\beta_i}{\eta_i},\quad\text{ that is, } \quad\eta_i^2=\frac{\beta_i}{\gamma_i} \quad i=2,\ldots,n.$$ Since $b$ and $c$ are positive vectors, there is no problem in constructing such a scaling matrix. Simply take $$\eta_i=\sqrt{\frac{\beta_i}{\gamma_i}}, \quad i=2,\ldots,n.$$