Calculate when an $n\times n$ matrix is positive My question is when is an  $n\times n$ matrix positive where by positive I mean the matrix is hermitian
and has no negative eigenvalues.  If you ask the the matrix be strictly positive the answer is
well known.  If $A$ is the matrix let $A_p$ be the $p\times p$ matrix obtained by only looking at the first
$p$ rows and columns.  Then $A$ is strictly positive if and only if the determinant of $A_p$ is positive
for $p = 1,2,\dotsc,n$.  If you only want positivity the problem is harder.  One solution is to look
at $A+eI$ for $0 < e$ and then ask if $A+eI$ is strictly positive for all $e > 0$.  However, I do not
consider this to be an answer because I insist then answer be complete something and then answer the question.
I believe the followings.  Suppose $Q$ is a subset of $\{1,2,....,n\}$ and $A_Q$ is the matrix obtained by only considering the rows and columns is $Q$.  I believe if the determinant of $A_Q$ is non negative for all $Q$ then $A$ is positive.  I have proved this in the $3\times3$ case.  Also you must look at all the
$A_Q$ for all 7 possible $Q$'s.  I confess I have not finished the $4\times4$ case but I have handled a lot of cases.  I confess have better things to work on but I have become obsessed.  If anyone has a short answer I would be relieved.
 A: Your solution is correct and is known as Sylvester's criterion.

A symmetric matrix is positive semi-definite (all eigenvalues $\geq 0$) if all principal minors are $\geq 0$ (a principal minor is the determinant of the matrix obtained by removing some rows and columns with the same numbers).
The difference with positive definite (all eigenvalues $>0$) is that you must consider all principal minors, and not only the leading principal minors (determinant of upper-left submatrices).
A counterexample to show that you need to consider all principal minors is the matrix $\begin{pmatrix} 0 & 0 \\ 0 & -1 \end{pmatrix}$; the two leading principal  minors are both 0, but the matrix has a negative eigenvalue.
A: *

*Compute the kernel $K$ of $A$, and its orthogonal complement $K^\perp$.


*rewrite $A$ in a basis formed by concatenation of bases for $K$ and for $K^\perp$. In such a basis, the only non-0 block $A'$ will correspond to a strictly positive matrix, if and only if $A$ is positive.
PS. To test that $A'$ is strictly positive, it's quicker to compute
its Cholesky decomposition, or an $A'=LDL^*$ decomposition. The latter is given by a lower-triangular matrix $L$ with all-ones diagonal, and $D$ a real diagonal matrix with positive entries.
A: Sylvester's criterion consists in the calculation of $n$ determinants —for $A>0$—, in the calculation of $2^n-1$ determinants —for $A\geq 0$—.
Then we cannot conclude semi-positivity —in the second case- when —for example— $n=100$.
In a similar way, it is very difficult to obtain values of the real parameters so that the following real symmetric matrix is semi-positive. Try….
$$A=\begin{bmatrix}
1&-\dfrac{3}{2}&0&a&-b&c\\
-\dfrac{3}{2}&-2a+2&b&0&-d&-e\\
0&b&-2c+2&d&e&-\dfrac{3}{2}\\
a&0&d&1&-\dfrac{3}{2}&f\\
-b&-d&e&-\dfrac{3}{2}&-2f+2&0\\
c&-e&-\dfrac{3}{2}&f&0&1
\end{bmatrix}$$
