# Symmetric matrix, a>0 on diagonal and b<0 off diagonal, positive definite?

this came up in a specific example that I'm working on, but I'm wondering under what conditions it's true in general.

Consider an nxn matrix, all of whose diagonal entries are a>0 and all of whose non-diagonal entries are b<0. Is the matrix positive (semi)definite?

In the specific example I'm interested in, n=10000, a=17.552 and b=-0.00175538. But I'm interested in the question in general too.

Thanks

Edit: The general 2x2 case is easy to work out by hand. There, the matrix is positive definite (respectively semidefinite) if and only if a+b>0 (respectively >= 0). But what about in general?

Not true. Just take $$1$$ along the diagonal and $$-10$$ off diagonal in a $$2 \times 2$$ matrix.
• The vector $v$ with constant coefficients equal to $1$ is eigen. For $a=-(n-1)b$, it corresponds to the eigenvalue $0$. As your matrix is symetric, it is diagonalisable on a orthonormal basis. Set $V=v^{\perp}$, Check that $OMO^{-1}=M$ for every $O\in O(n)$ that let $v$ (thus $V$) stable. This implies that $M$ as a single eigenvalue on $V$, which thus has multiplicty $n-1$. Another way to do it is to verify that if $w\in V$ is eigen, then every permutation of its component is also eigen. A third way is to write your matrix as $cI-dE$ where $E$ is full 1, then use characteristic polynomial – Isao Jul 29 '19 at 9:46