A cautionary Mathematica tale

Because a picture’s worth a thousand words:

visual proof that mathematica sucks at linear algebra

according to Mathematica, the rank of a matrix and that of a basis for its range can differ

The matrix involved is a projection, not some numerically unstable thing like the Hilbert matrix. You suck at linear algebra, Mathematica.

  • Oh, great! Now you warn me, after I re-learning to use Mathematica for my math class.
    Oh, I have begun learning to use LaTex as well.

    • swiftset

      Both nice tools to know 🙂 What class is this?

      It’s not *that* big of an issue, but it’s something to be aware of. I’m just annoyed by the fact that it fails on such an innocuous example.

      • Taking Math 23a (combo of Linear Algebra, multivariable calculus, and some real analysis).

        I am learning to practice writing LaTex which to me reminds me too much of programming. I hate programming which is why I never went into CS.
        Programming is debugging.

  • Aram Harrow

    I guess it’s always dangerous to compare things with zero. If you count the # of eigenvalues greater than 10^{-15} maybe they’ll be the same?

    • swiftset

      Yep, that’s probably the issue, but Matlab didn’t have any problem with this same example. I feel like this is a simple enough case that if the Orthogonalize function doesn’t work here, you can’t trust it as much as Matlab’s orth. To get an actual basis, I projected the ‘basis’ that Orthogonalize returned using the original matrix (a projection), then eliminated the elements that had norm noticeably smaller than 1.