November 27, 2026

Visual Math: When a Matrix Loses Rank

A thin red ellipse with yellow and green singular axes inside a blue parallelogram, beside the title When a matrix loses rank and the singular values 2.26 and 0.66

A 2×2 matrix takes every point of the unit circle and moves it somewhere new. The free When a Matrix Loses Rank app shows where, with four sliders for the entries and a fifth that shrinks the matrix’s weaker direction to zero, flattening the picture onto a line.

The circle always becomes an ellipse

An arXiv paper on the geometry of the singular value decomposition makes the starting observation plainly: feed a matrix the unit circle and the image always comes out an ellipse, and for a degenerate matrix the ellipse can flatten to a segment. The app draws the original circle as a dashed outline, the ellipse in red, and the image of the unit square as a blue parallelogram.

The two axes of the ellipse carry the information. A script from Florida State University states it as a rule: the vector V(1,:) maps to S(1) times U(:,1), and the same for the second pair, so the ellipse has an aspect ratio of S(1)/S(2). In the app those axes are the yellow and green segments, labelled σ₁ and σ₂, and their ratio is printed beside them.

Matrix rank app with matrix 2, 1, -0.5, 1.5: the unit circle mapped to a tilted ellipse with singular values 2.257 and 1.550 and rank 2
The matrix with rows 2, 1 and −0.5, 1.5: the unit circle becomes a tilted ellipse with singular values 2.257 and 1.550, inside a blue parallelogram.

Rank is the number of nonzero singular values

MathWorks’ profile of the decomposition puts the rule in one line: the rank of any matrix is the number of nonzero singular values. The same article adds that a square matrix is nonsingular exactly when its singular values are all nonzero, and recommends checking singular values over computing determinants, which scale badly.

The default matrix, [2 1; −0.5 1.5], has σ₁ = 2.257 and σ₂ = 1.550, so its rank is 2 and its determinant is 3.5, the product of the two. The preset button swaps in [1 2; 2 4]. Its second row is twice the first, so σ₂ = 0, the determinant is 0, the rank is 1, and the whole circle lands on one line, stretched to a segment 10 units long (σ₁ = 5).

Matrix rank app with matrix 1, 2, 2, 4: the unit circle flattened onto a straight line, second singular value 0 and rank 1
The rank 1 example matrix with rows 1, 2 and 2, 4: the unit circle has collapsed onto a straight line, σ₂ reads 0.000 and rank reads 1.

Sliding to the nearest rank-1 matrix

The collapse slider multiplies σ₂ by (1 − t) and leaves the directions alone. At t = 1 the second singular value is gone and what remains is the truncated decomposition. The Eckart–Young theorem says this is the best rank-1 approximation: MathWorld gives the error as min over rank ≤ k of ||A − B||₂ equals σ_(k+1). For k = 1 that is σ₂, so the readout “distance to nearest rank-1 matrix” in the app is simply the current σ₂.

Halfway along the slider, at t = 0.5, the default matrix reads σ₂ = 0.775, a ratio σ₁/σ₂ of 2.91 and a determinant of 1.75. The determinant falls in proportion to (1 − t), because it is the product of the two singular values up to sign.

Matrix rank app with the collapse slider at 0.5: a thinner ellipse, second singular value 0.775, determinant 1.750 and rank 2
The collapse slider at 0.5: the ellipse has thinned, σ₂ reads 0.775, the determinant 1.750 and the rank is still 2.

The matrix readout in the app was checked against a standard numerical SVD for seven test matrices, including a rotation and a reflection, and the two agreed to six decimal places.

The video

The companion reel runs 16 seconds on the default matrix, with the collapse slider driven from 0 to 1. Two readouts track σ₁ and σ₂ and the rank line flips from 2 to 1 once σ₂ reaches zero. The soundtrack holds a steady note for σ₁ and adds two higher partials whose loudness follows σ₂ divided by σ₁, so the chord thins to a single note as the ellipse flattens. It continues the series with the rhythm-to-pitch app.

Sources

502 Posts

Peter Kalafatis writes and edits X9M8. He holds a bachelor's degree from LIU Post and a master's in Media Studies from The New School, with academic work in the philosophy of science, human behavior, AI, and memetics.

View All Posts

Leave a Reply

Your email address will not be published. Required fields are marked *