Skip to content

Matrix Phylogeny

Seven pages have introduced classes of matrices — invertible, defective, normal, symmetric, positive definite, orthogonal, diagonal — and a decomposition for most of them. This page is the map.

The word phylogenetic describes how we capture the relationships among individuals or groups, and comes from the Greek words for “tribe” and “source”. A phylogenetic tree of matrices is exactly what Figure 4.13 draws: black arrows for is a subset of, blue labels for what you can do with it.

  • The whole tree: which matrix classes contain which, in the order the book presents them.
  • Which decomposition attaches to each class, and what condition unlocks it.
  • Why non-singular and non-defective are independent — the book’s own caveat, with a witness in each of the four quadrants.
  • What normal means (AA=AA\mathbf{A}^\top\mathbf{A} = \mathbf{A}\mathbf{A}^\top) and why it sits between non-defective and symmetric.
  • A measured census: how often each construction of random matrix actually lands in each class.
  • Which class np.linalg.qr puts you in, which is not the one most people assume.

Intuition: two independent questions, then a chain of restrictions

Section titled “Intuition: two independent questions, then a chain of restrictions”

The tree looks complicated because it answers two different questions at the same level.

The first is can you invert it? — decided by the determinant. The second is can you diagonalise it? — decided by whether there are nn independent eigenvectors. These are independent: a matrix can be either, both or neither. The book says so explicitly, and it is the most commonly mis-remembered fact in the chapter.

Below the non-defective branch, though, everything is a chain of tightening restrictions, and each tightening buys something:

non-defectivenormalsymmetricpositive definitediagonal (positive){I}\text{non-defective} \supset \text{normal} \supset \text{symmetric} \supset \text{positive definite} \supset \text{diagonal (positive)} \supset \{\mathbf{I}\}

with orthogonal hanging off normal in a different direction.

diagram Diagram mermaid

That is the book’s Figure 4.13, with the blue operations folded into the boxes.

For all real matrices ARn×m\mathbf{A} \in \mathbb{R}^{n\times m}, the pseudo-inverse and the SVD exist. That is the widest statement in the chapter, and it is why §4.5 came last: it needs no hypothesis at all.

For non-square matrices (nmn \neq m) that is where the tree stops. There is no determinant, no trace, no eigenvalue — those all require a square matrix, since Ax=λx\mathbf{A}\mathbf{x} = \lambda\mathbf{x} needs Ax\mathbf{A}\mathbf{x} to live in the same space as x\mathbf{x}.

Focusing on square matrices ARn×n\mathbf{A} \in \mathbb{R}^{n\times n}, the determinant informs us whether the matrix possesses an inverse — that is, whether it belongs to the class of regular, invertible matrices. This is §4.1’s Theorem 4.1: detA0\det\mathbf{A} \neq 0 if and only if A1\mathbf{A}^{-1} exists.

If the square n×nn\times n matrix possesses nn linearly independent eigenvectors, then the matrix is non-defective and an eigendecomposition exists (§4.4’s Theorem 4.20; the sufficient condition of distinct eigenvalues is Theorem 4.12). Repeated eigenvalues may result in defective matrices, which cannot be diagonalized.

This is the condition that makes the two Gram matrices of §4.5 coincide — and therefore makes the left- and right-singular vectors the same, which is exactly why normal matrices are the ones whose SVD and eigendecomposition line up. Over the reals, normal is the natural home of “diagonalisable by an orthogonal change of basis”.

If the more restrictive condition holds that

AA=AA=I\mathbf{A}^\top\mathbf{A} = \mathbf{A}\mathbf{A}^\top = \mathbf{I}

then A\mathbf{A} is orthogonal (Definition 3.8). The set of orthogonal matrices is a subset of the regular matrices and satisfies A=A1\mathbf{A}^\top = \mathbf{A}^{-1} — the cheapest inverse in linear algebra. Orthogonal matrices with det=+1\det = +1 are rotations; with det=1\det = -1 they are reflections.

Normal matrices have a frequently encountered subset, the symmetric matrices SRn×n\mathbf{S} \in \mathbb{R}^{n\times n} satisfying S=S\mathbf{S} = \mathbf{S}^\top. Symmetric matrices have only real eigenvalues — the spectral theorem, 4.15, which the chapter has leaned on repeatedly.

A subset of the symmetric matrices consists of the positive definite matrices P\mathbf{P} satisfying

xPx>0for all xRn{0}\mathbf{x}^\top\mathbf{P}\mathbf{x} > 0 \quad \text{for all } \mathbf{x} \in \mathbb{R}^n\setminus\{\mathbf{0}\}

In this case a unique Cholesky decomposition exists (Theorem 4.18). Positive definite matrices have only positive eigenvalues and are always invertible — a nonzero determinant follows, since the determinant is the product of the eigenvalues.

Another subset of the symmetric matrices consists of the diagonal matrices D\mathbf{D}. Diagonal matrices are closed under multiplication and addition, but do not necessarily form a group — that is only the case if all diagonal entries are nonzero, so that the matrix is invertible. A special diagonal matrix is the identity I\mathbf{I}.

matrixinvertiblenon-defectivenormalsymmetricpos. def.orthogonaldiagonal
[0100]\begin{bmatrix}0&1\\0&0\end{bmatrix}nonononononono
[2102]\begin{bmatrix}2&1\\0&2\end{bmatrix}yesnononononono
[4213]\begin{bmatrix}4&2\\1&3\end{bmatrix}yesyesnonononono
[0110]\begin{bmatrix}0&-1\\1&0\end{bmatrix}yesyes over C\mathbb{C}, no over R\mathbb{R}yesnonoyesno
[2112]\begin{bmatrix}2&1\\1&2\end{bmatrix}yesyesyesyesyesnono
[2112]\begin{bmatrix}2&1\\1&-2\end{bmatrix}yesyesyesyesnonono
[3002]\begin{bmatrix}3&0\\0&2\end{bmatrix}yesyesyesyesyesnoyes
[1001]\begin{bmatrix}1&0\\0&1\end{bmatrix}yesyesyesyesyesyesyes

Two rows repay attention.

Row 4, the 90°90° rotation [0110]\begin{bmatrix}0&-1\\1&0\end{bmatrix}, is normal and orthogonal, with eigenvalues ±i\pm i. So “normal” does not imply “real eigenvalues” — only symmetric does. Over C\mathbb{C} it has two distinct eigenvalues and two independent eigenvectors, so it is perfectly diagonalisable there; over R\mathbb{R} there is no eigenvector at all. This is why the book’s caveat says “not diagonalizable in the real numbers”, and why the entry in that column needs a field, not just a yes or no. A numerical classifier built on np.linalg.eigvals, which returns complex arrays, will report it as non-defective — correctly, over C\mathbb{C}.

Row 6, [2112]\begin{bmatrix}2&1\\1&-2\end{bmatrix}, is symmetric with eigenvalues ±5±2.236\pm\sqrt5 \approx \pm2.236 — real, as the spectral theorem demands, but one is negative, so it is not positive definite and has no Cholesky. Symmetry gets you real eigenvalues; positive definiteness is a further condition.

phylogeny.py
import numpy as np
 
TOL = 1e-8
 
def is_defective(M, tol=1e-7):
    n = M.shape[0]
    seen, total = [], 0
    for lam in np.linalg.eigvals(M):
        if any(abs(lam - u) < 1e-6 for u in seen):
            continue
        seen.append(lam)
        s = np.linalg.svd(M - lam * np.eye(n), compute_uv=False)
        total += int(np.sum(s < tol * max(1.0, float(s[0]))))
    return total < n
 
def classify(M):
    n = M.shape[0]
    sym = bool(np.allclose(M, M.T, atol=TOL))
    posdef = False
    if sym:
        try:
            np.linalg.cholesky(M)
            posdef = True
        except np.linalg.LinAlgError:
            posdef = False
    return {
        "invertible":  abs(float(np.linalg.det(M))) > TOL,
        "non-defect":  not is_defective(M),
        "normal":      bool(np.allclose(M.T @ M, M @ M.T, atol=TOL)),
        "symmetric":   sym,
        "pos.def":     posdef,
        "orthogonal":  bool(np.allclose(M.T @ M, np.eye(n), atol=TOL)),
        "diagonal":    bool(np.allclose(M, np.diag(np.diag(M)), atol=TOL)),
    }
 
cases = {
    "nilpotent  [[0,1],[0,0]]": [[0.0, 1], [0, 0]],
    "Jordan     [[2,1],[0,2]]": [[2.0, 1], [0, 2]],
    "generic    [[4,2],[1,3]]": [[4.0, 2], [1, 3]],
    "rotation   [[0,-1],[1,0]]": [[0.0, -1], [1, 0]],
    "SPD        [[2,1],[1,2]]": [[2.0, 1], [1, 2]],
    "indefinite [[2,1],[1,-2]]": [[2.0, 1], [1, -2]],
    "diagonal   [[3,0],[0,2]]": [[3.0, 0], [0, 2]],
    "identity   [[1,0],[0,1]]": [[1.0, 0], [0, 1]],
}
 
keys = list(classify(np.eye(2)).keys())
print(f"{'matrix':26}" + "".join(f"{k:>12}" for k in keys) + f"{'eigenvalues':>26}")
for name, M in cases.items():
    M = np.asarray(M, dtype=float)
    c = classify(M)
    ev = np.linalg.eigvals(M)
    evs = ", ".join(f"{v.real:+.3f}{v.imag:+.3f}j" if abs(v.imag) > 1e-12 else f"{v.real:+.3f}"
                    for v in ev)
    print(f"{name:26}" + "".join(f"{('yes' if c[k] else 'no'):>12}" for k in keys) + f"{evs:>26}")
output
matrix                      invertible  non-defect      normal   symmetric     pos.def  orthogonal    diagonal               eigenvalues
nilpotent  [[0,1],[0,0]]            no          no          no          no          no          no          no            +0.000, +0.000
Jordan     [[2,1],[0,2]]           yes          no          no          no          no          no          no            +2.000, +2.000
generic    [[4,2],[1,3]]           yes         yes          no          no          no          no          no            +5.000, +2.000
rotation   [[0,-1],[1,0]]          yes         yes         yes          no          no         yes          no+0.000+1.000j, +0.000-1.000j
SPD        [[2,1],[1,2]]           yes         yes         yes         yes         yes          no          no            +3.000, +1.000
indefinite [[2,1],[1,-2]]          yes         yes         yes         yes          no          no          no            +2.236, -2.236
diagonal   [[3,0],[0,2]]           yes         yes         yes         yes         yes          no         yes            +3.000, +2.000
identity   [[1,0],[0,1]]           yes         yes         yes         yes         yes         yes         yes            +1.000, +1.000

Read down the columns and the tree appears. Every yes in pos.def has a yes in symmetric to its left, which has a yes in normal, which has a yes in non-defect. The containments hold in every row, which is what a tree of subsets should look like.

Two rows show where the tree branches rather than nests. The Jordan row is invertible yes with non-defect no — the book’s caveat, and note that nothing to its right is yes either, because a defective matrix cannot be normal. The rotation row is normal yes with symmetric no, and its eigenvalue column is the only complex one: ±i\pm i. That is the pair to remember — normal buys you an orthogonal diagonalisation, but only symmetry buys you real eigenvalues.

Notice also that this classifier reports the rotation as non-defect yes, because np.linalg.eigvals works over C\mathbb{C} and finds two distinct eigenvalues with two independent eigenvectors there. That is the right answer to the question the code asks. It is not the answer to the question the book asks, which is about R\mathbb{R} — and the discrepancy is a reminder that “diagonalisable” is incomplete without a field.

sketch Where does this matrix sit in the tree? p5.js
Edit a 2x2 matrix with the four knobs, or press a preset. Every class in the phylogeny lights up or stays dark, the eigenvalues are shown (complex when they are), and the tree redraws with the matrix's path highlighted. Watch what breaks first as you move away from the identity.
sketch Which classes are common, and which need arranging? p5.js
Each column is a matrix class; each row is a way of generating a random 3x3 matrix. Press sample to draw more and watch the percentages settle. The point is which cells stay at zero: no amount of sampling makes a Gaussian matrix symmetric, because symmetry is a measure-zero coincidence.
matrixThe rotation matrix: invertible, and not diagonalizable over the realslinear map on R^2
-4-3-2-101234-4-3-2-101234x1x2
0-110
columns of A = images of e1, e2
det A 1area factor 1orientation preserved
det A1A e1(0, 1)A e2(-1, 0)
basisThe plane before anything happens, with the standard basis e1 = (1, 0) and e2 = (0, 1) and the unit square they span.
1/7

Determinant +1, so certainly invertible. But its characteristic polynomial is lambda squared plus one, whose roots are plus and minus i — so there is no real eigenvector and no real eigendecomposition. This is the book's own counterexample to the idea that non-singular and non-defective are the same.

phylogeny_census.py
import numpy as np
 
TOL = 1e-8
PROPS = ["invertible", "non-defective", "normal", "symmetric",
         "pos. definite", "orthogonal", "diagonal", "rotation"]
 
def is_defective(M, tol=1e-7):
    n = M.shape[0]
    seen, total = [], 0
    for lam in np.linalg.eigvals(M):
        if any(abs(lam - u) < 1e-6 for u in seen):
            continue
        seen.append(lam)
        s = np.linalg.svd(M - lam * np.eye(n), compute_uv=False)
        total += int(np.sum(s < tol * max(1.0, float(s[0]))))
    return total < n
 
def classify(M):
    n = M.shape[0]
    sym = bool(np.allclose(M, M.T, atol=TOL))
    posdef = False
    if sym:
        try:
            np.linalg.cholesky(M)
            posdef = True
        except np.linalg.LinAlgError:
            posdef = False
    orth = bool(np.allclose(M.T @ M, np.eye(n), atol=TOL))
    return {
        "invertible": abs(float(np.linalg.det(M))) > TOL,
        "non-defective": not is_defective(M),
        "normal": bool(np.allclose(M.T @ M, M @ M.T, atol=TOL)),
        "symmetric": sym,
        "pos. definite": posdef,
        "orthogonal": orth,
        "diagonal": bool(np.allclose(M, np.diag(np.diag(M)), atol=TOL)),
        "rotation": orth and float(np.linalg.det(M)) > 0,
    }
 
rng = np.random.default_rng(41)
n = 3
 
def jordan():
    J = np.eye(n); J[0, 1] = 1.0
    S = rng.normal(size=(n, n))
    while abs(np.linalg.det(S)) < 0.3:
        S = rng.normal(size=(n, n))
    return S @ J @ np.linalg.inv(S)
 
families = [
    ("Gaussian",      lambda: rng.normal(size=(n, n))),
    ("small integer", lambda: rng.integers(-2, 3, size=(n, n)).astype(float)),
    ("symmetric",     lambda: (lambda M: M + M.T)(rng.normal(size=(n, n)))),
    ("SPD",           lambda: (lambda M: M @ M.T + n * np.eye(n))(rng.normal(size=(n, n)))),
    ("orthogonal",    lambda: np.linalg.qr(rng.normal(size=(n, n)))[0]),
    ("diagonal",      lambda: np.diag(rng.normal(size=n))),
    ("Jordan-like",   jordan),
]
 
trials = 1200
print(f"{'construction':>15}" + "".join(f"{p[:13]:>15}" for p in PROPS))
for name, make in families:
    hits = np.zeros(len(PROPS))
    for _ in range(trials):
        c = classify(make())
        hits += np.array([1.0 if c[p] else 0.0 for p in PROPS])
    pct = 100.0 * hits / trials
    print(f"{name:>15}" + "".join(f"{v:>15.2f}" for v in pct))
output
   construction     invertible  non-defective         normal      symmetric  pos. definite     orthogonal       diagonal       rotation
       Gaussian         100.00         100.00           0.00           0.00           0.00           0.00           0.00           0.00
  small integer          83.83          94.33           0.67           0.58           0.00           0.00           0.00           0.00
      symmetric         100.00         100.00         100.00         100.00           2.50           0.00           0.00           0.00
            SPD         100.00         100.00         100.00         100.00         100.00           0.00           0.00           0.00
     orthogonal         100.00         100.00         100.00           0.00           0.00         100.00           0.00         100.00
       diagonal         100.00         100.00         100.00         100.00          12.67           0.00         100.00           0.00
    Jordan-like         100.00           0.00           0.00           0.00           0.00           0.00           0.00           0.00

Six readings, in order of how surprising they are.

The Jordan-like row is the book’s counterexample, sampled. 100%100\% invertible, 0%0\% non-defective. The two properties do not merely fail to imply each other in principle; you can generate a thousand matrices that split them.

The diagonal row’s 12.67%12.67\% positive definite is a coin-flip check. A diagonal matrix with three independent standard-normal entries is positive definite exactly when all three are positive, which has probability 1/8=12.5%1/8 = 12.5\%. Measuring 12.67%12.67\% over 12001200 draws confirms the classifier is testing what it claims to.

The symmetric row is only 2.50%2.50\% positive definite. Symmetry gets you real eigenvalues, not positive ones. M+M\mathbf{M} + \mathbf{M}^\top for Gaussian M\mathbf{M} has eigenvalues spread either side of zero, and needing all three positive is rare. The book’s chain symmetric \supset positive definite is a strict containment, and this is how strict.

The Gaussian row has zeros in five of eight columns, and they will never fill in. Symmetry requires aij=ajia_{ij} = a_{ji} exactly, an equality between two independent continuous random variables — probability zero. All the structured classes are measure-zero coincidences, which is why every one of them has to be constructed.

Small-integer matrices are only 83.83%83.83\% invertible. Over a range of five integers, det=0\det = 0 happens. And 94.33%94.33\% non-defective — repeats become possible once entries are discrete, exactly as §4.4’s census found.

The orthogonal row is 100%100\% rotation, and that is an artefact of n=3n = 3. np.linalg.qr returns a Q\mathbf{Q} with detQ=(1)n1\det\mathbf{Q} = (-1)^{n-1}, which is +1+1 for n=3n = 3. In any even dimension the same code returns reflections, every time. The last figure on this page measures it.

figure The tree, sampled matplotlib
A heatmap with seven rows for matrix constructions and eight columns for matrix classes, cells shaded by the percentage of random matrices in that construction having that property, with many cells at exactly zero. A heatmap with seven rows for matrix constructions and eight columns for matrix classes, cells shaded by the percentage of random matrices in that construction having that property, with many cells at exactly zero.
1200 random 3x3 matrices per construction. The zeros are the message: a Gaussian matrix is never symmetric, normal, orthogonal or diagonal, because each is an exact equality between continuous quantities. The Jordan-like row is 100% invertible and 0% non-defective.
figure Which class implies which, measured matplotlib
A square heatmap whose rows and columns are both matrix classes, each cell giving the percentage of sampled matrices with the row property that also have the column property, with a clear triangular structure of hundred-percent cells. A square heatmap whose rows and columns are both matrix classes, each cell giving the percentage of sampled matrices with the row property that also have the column property, with a clear triangular structure of hundred-percent cells.
Every cell is the share of sampled matrices with the row property that also have the column property. The 100% cells reproduce the tree's containments — symmetric implies normal, positive definite implies symmetric. The two cells that matter are invertible-implies-non-defective at 85.0% and non-defective-implies-invertible at 98.0%: neither is 100%.
figure All four combinations occur matplotlib
Four boxed panels, one per quadrant, each showing a two-by-two matrix with its determinant, eigenvalues, and whether it is defective and invertible — covering all four combinations. Four boxed panels, one per quadrant, each showing a two-by-two matrix with its determinant, eigenvalues, and whether it is defective and invertible — covering all four combinations.
A witness in each quadrant: diag(2,3) is invertible and diagonalisable, [[2,1],[0,2]] is invertible and defective, diag(1,0) is singular and diagonalisable, and [[0,1],[0,0]] is both singular and defective. The book's own example, a rotation matrix, is the second quadrant with complex eigenvalues instead of a repeat.
figure Which class does np.linalg.qr put you in? matplotlib
A plot of the determinant of numpy's QR factor against matrix size from two to twelve, alternating exactly between minus one and plus one with no scatter. A plot of the determinant of numpy's QR factor against matrix size from two to twelve, alternating exactly between minus one and plus one with no scatter.
400 random inputs at each size from 2 to 12. The determinant of Q is (-1) to the (n-1), exactly, with no exceptions in 4400 trials: minus one for even n, plus one for odd. Householder QR applies n-1 reflections and each has determinant minus one. So in every even dimension numpy hands back a reflection, never a rotation.

From the census heatmap. Read the zeros, not the hundreds. Five of the eight columns are empty in the Gaussian row, and no amount of sampling changes that — symmetry, normality, orthogonality and diagonality are all exact equalities between continuous quantities, so their probability is zero. Every interesting class in this chapter has to be built, and that is why the book’s tree is a tree of constructions rather than a partition of the typical case.

The two rows that are not zero-or-one are the informative ones: small integer at 83.83%83.83\% invertible and 94.33%94.33\% non-defective, and diagonal at 12.67%12.67\% positive definite. The last one is a check on the classifier, since the theoretical value is 12.5%12.5\%.

From the implications heatmap. The 100%100\% cells are the tree’s black arrows, recovered from data: symmetric \Rightarrow normal, positive definite \Rightarrow symmetric \Rightarrow normal \Rightarrow non-defective, orthogonal \Rightarrow normal, diagonal \Rightarrow symmetric. None of those needed to be told to the sampler; they fall out.

The cells that are not 100%100\% are where the tree branches rather than nests:

givenalso hasshare
invertiblenon-defective85.0%85.0\%
non-defectiveinvertible98.0%98.0\%
normalsymmetric75.0%75.0\%
symmetricpositive definite38.8%38.8\%
symmetricorthogonal0.0%0.0\%
orthogonalsymmetric0.0%0.0\%

The first two rows are the book’s caveat as a pair of numbers: neither direction is an implication. The last two are worth noticing too — in this sample no orthogonal matrix was symmetric and vice versa. That is not a theorem (the identity and any reflection matrix are both) but it reflects that the two branches leave normal in different directions, so a matrix in both is a further coincidence.

From the four-quadrant figure. Read the defective and invertible lines in each box. All four (yes,no)(\text{yes},\text{no}) pairs appear, which is the definition of independent. The book names the rotation matrix as its example and puts it in the top-right quadrant; the figure uses [2102]\begin{bmatrix}2&1\\0&2\end{bmatrix} there instead, because a repeated real eigenvalue makes the failure visible without leaving the reals. Both work; the rotation’s failure is complex eigenvalues, the Jordan block’s is a deficient eigenspace.

From the QR figure. This is the practical one, and it corrects a widespread assumption. Ask for a random orthogonal matrix with np.linalg.qr(np.random.normal(size=(n,n)))[0] and you do not get a uniformly random element of the orthogonal group — you get one whose determinant is (1)n1(-1)^{n-1}, deterministically. Over 44004400 trials across eleven sizes there was not one exception.

The reason is the algorithm: Householder QR builds Q\mathbf{Q} from n1n-1 reflections, and each reflection has determinant 1-1, so detQ=(1)n1\det\mathbf{Q} = (-1)^{n-1}. For n=3n=3 that is +1+1, which is why the census row said 100%100\% rotation — a fact about three dimensions, not about QR. In n=2,4,6,n = 2, 4, 6, \dots the same call returns a reflection every time. If you need a rotation, negate a column when the determinant is negative.

classdefining conditionwhat it unlockscost of the inverse
real, any shapenoneSVD, pseudo-inversepseudo-inverse, O(mnmin(m,n))O(mn\min(m,n))
squarem=nm = ndeterminant, trace, eigenvalues
invertibledet0\det \neq 0A1\mathbf{A}^{-1}LU, 23n3\tfrac23n^3
non-defectivenn independent eigenvectorsPDP1\mathbf{P}\mathbf{D}\mathbf{P}^{-1}, matrix powersvia the eigendecomposition
normalAA=AA\mathbf{A}^\top\mathbf{A} = \mathbf{A}\mathbf{A}^\topsingular and eigen-directions align
symmetricS=S\mathbf{S} = \mathbf{S}^\topspectral theorem: real λ\lambda, orthonormal eigenbasis, PDP\mathbf{P}\mathbf{D}\mathbf{P}^\topvia eigh
positive definitexPx>0\mathbf{x}^\top\mathbf{P}\mathbf{x} > 0unique Cholesky, λ>0\lambda > 0, samplingCholesky, 13n3\tfrac13n^3
orthogonalAA=I\mathbf{A}^\top\mathbf{A} = \mathbf{I}A1=A\mathbf{A}^{-1} = \mathbf{A}^\top, lengths and angles preservedfree — transpose
diagonalaij=0a_{ij} = 0 for iji \neq jeverything elementwisenn reciprocals
identityA=I\mathbf{A} = \mathbf{I}itself

The right-hand column is the whole chapter in one view: the further down the tree, the cheaper everything gets. That is what a decomposition buys — it moves your matrix down the tree.

pch.quizTag Check your understanding
  1. The book explicitly warns that non-singular and non-defective are not the same. What is its example?

    pch.quizShowAnswer

    B — A rotation matrix: its determinant is nonzero so it is invertible, but its eigenvalues are not real so it is not diagonalizable over the reals — Measured, the two properties split both ways: 85.0 percent of sampled invertible matrices were non-defective, and 98.0 percent of non-defective ones were invertible. Neither is an implication.

  2. Where does 'eigenvalues are real' sit in the tree, and why not one level higher?

    pch.quizShowAnswer

    B — On the symmetric box. A rotation matrix is normal and has eigenvalues plus and minus i, so normality alone does not give real eigenvalues — over the reals you need symmetry — Over the complex numbers every normal matrix is unitarily diagonalizable, which is why the distinction is easy to lose. The book's tree places the real-eigenvalue claim on symmetric deliberately.

  3. A Gaussian random 3x3 matrix was symmetric in 0 of 1200 trials. Will more sampling change that?

    pch.quizShowAnswer

    B — No. Symmetry requires a-ij to equal a-ji exactly — an equality between two independent continuous random variables, which has probability zero — The same holds for normal, orthogonal and diagonal. Every structured class in the tree is a measure-zero condition, which is why they all have to be constructed rather than found.

  4. The census found random diagonal matrices positive definite 12.67 percent of the time. What does that number check?

    pch.quizShowAnswer

    B — The classifier itself: a diagonal matrix with three independent standard-normal entries is positive definite exactly when all three are positive, so the theoretical rate is one in eight, 12.5 percent — A measurement that lands on a value you can derive independently is worth more than one that merely looks plausible. Compare the symmetric row's 2.50 percent, which has no such simple closed form.

  5. np.linalg.qr on a random Gaussian matrix returns a Q with determinant (-1) to the (n-1), with zero exceptions in 4400 trials. Why?

    pch.quizShowAnswer

    B — Householder QR builds Q from n-1 reflections and each reflection has determinant minus one, so the product is determined by n alone — meaning in every even dimension you get a reflection, never a rotation — This is why the census row for the orthogonal family showed 100 percent rotation: n was 3, so (-1) to the 2 is plus one. It is a fact about three dimensions, not about QR. For a Haar-random orthogonal matrix you must correct the column signs using the diagonal of R.

Exercise 4 – What np.linalg.qr actually returns

Section titled “Exercise 4 – What np.linalg.qr actually returns”

Exercise 5 – Which decomposition applies?

Section titled “Exercise 5 – Which decomposition applies?”
  • The SVD and pseudo-inverse exist for every real matrix; determinant, trace and eigenvalues need a square one.
  • The determinant decides invertibility; the eigenvector count decides diagonalisability, and these are two independent questions.
  • Non-singular and non-defective are not the same — the book’s example is a rotation matrix, invertible with complex eigenvalues. Measured, the split runs 85.0 percent one way and 98.0 percent the other, and all four combinations have small witnesses.
  • Normal means A-transpose A equals A A-transpose, which is what makes the singular and eigen directions align.
  • Orthogonal is the stricter A-transpose A equals A A-transpose equals I, giving the free inverse A-transpose; determinant plus one is a rotation, minus one a reflection.
  • Symmetric is a subset of normal and is where real eigenvalues live — normality alone does not give them.
  • Positive definite is a subset of symmetric, with a unique Cholesky, positive eigenvalues and a nonzero determinant. Only 38.8 percent of sampled symmetric matrices qualified.
  • Diagonal matrices are closed under multiplication and addition but form a group only when every entry is nonzero; the identity is a special diagonal matrix.
  • Every structured class is measure-zero: a Gaussian matrix was symmetric, normal, orthogonal or diagonal in zero of 1200 trials, because each condition is an exact equality between continuous quantities.
  • np.linalg.qr returns a Q with determinant (-1) to the (n-1), exactly — so in every even dimension it is a reflection, not a rotation, with zero exceptions in 4400 trials.

Next: Chapter 4 Exercises and Solutions — all twelve of the book’s exercises, worked and verified.

pch.coffeeTagline

pch.coffeeCta

pch.feedbackHeading

pch.feedbackSubheading