Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Positive, negative, complex determinants

  1. Jul 24, 2014 #1

    I have a rather trivial question but google did not really help me. So far I was always familiar with the fact that the determinant of a square matrix is positive.

    But it is not. When I randomly execute det(randn(12)) in MATLAB I get a negative determinant every couple of trials.

    What is the meaning of a negative determinate? And is it allowed to take the absolute value in this case?
    For example, in a convex optimization problem, you often maximize the log-determinant of a matrix. But in order for this to be defined, the determinant should be positive.

    Even worse, if I have a complex matrix, the determinant is generally complex too. For example, executing "det(randn(12)+i*randn(12))" in MATLAB always gives a complex determinant.

    Similarly to above: How to interpret a complex determinant, what does it tell me?

    And if my matrix in such a convex optimization problem is complex, log(det(A)) will also be complex. Since ">" for complex numbers is defined as the absolute value anyway, am I allowed to take the absolute value of the determinant, i.e., "log(abs(det(A)))" ?
  2. jcsd
  3. Jul 24, 2014 #2


    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper

  4. Jul 24, 2014 #3


    User Avatar
    Science Advisor

    That is very very wrong. You may just be confusing the notation |A| for the determinant with the absolute value notation.

    Well, yes, I would expect "positive" and "negative" determinants to be about equally likely.

    I suspect that you may find that for convex optimization problems the determinant must be positive.

    Again, not surprising. The real numbers form a subset of the complex numbers of "measure 0".

    How you "interpret" the determinant of a matrix depends upon how you are interpreting the matrix! Again, I suspect that a "convex optimization problem" is a special case. What sort of "convex optimization problem" would give you a complex matrix?

    (I would NOT say that "> for complex numbers is defined as the absolute value". I would say that, since the complex numbers is not an ordered field, there is NO ">" on the complex numbers. In particular, we do NOT say that "a> b if and only if |a|> |b|" which is what your wording implies.)
  5. Jul 24, 2014 #4


    User Avatar
    Science Advisor
    Gold Member

    Start with a Real matrix with positive determinant and exchange any two of its rows. Or, if n
    is odd, and the matrix (this is not true for the movie ;) ) M is nxn, multiply all entries by -1.
    This gives you material for a bijection between the two (positive and negative det.; if two rows are equal, then DetM =0).

    Still, in a sense, the determinant of a matrix is more likely to be nonzero than to be zero. Maybe that is what you meant?
    Last edited: Jul 24, 2014
  6. Jul 24, 2014 #5
    This is probably a bad reference because the first sentence is already "A determinant is a real number associated with every square matrix" - obviously wrong.

    Anyways, this sentence was not at all important and you misinterpreted it: I meant I am familiar with the fact, i.e., so far I had only to do with positive definite matrices.

    EDIT: By reading my sentence again I wrote it wrong, yes. But I intended to mean something else ;-)
    Last edited: Jul 24, 2014
  7. Jul 24, 2014 #6
    You misinterpreted my sentence, see my first reply.

    I found the issue already: Indeed, it must always be positive. The matric I am using is A^#*A which is positive definite by definition.

    However, MATLAB function det() uses a very sub-optimal algorithm based on LU decomposition. I get a complex number but the angle is nearly pi or zero. This explains also why taking the absolute value gives me the correct result.
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook