Chapter 7
26 min read
Section 38 of 139

Rank: How Much Grid You Actually Built

Building Your Own Grid

By the end of this section you will have a single number for everything the last four sections showed you: how much grid a set of vectors actually managed to build — retold one more time, at full size, in three dimensions. One vector built a line. A second, genuinely new vector, built a plane. A second vector that only duplicated the first built nothing extra at all. That count of genuinely new directions — one, two, or zero gained — is exactly what mathematicians call rank, and this closing section carries the whole construction into three dimensions, with a live cage you build with your own hands, before handing off to Chapter 8’s formal treatment.

What You Will Be Able to Do

You will be able to…Concretely
Define rank constructivelyState rank as 'the number of genuinely new directions a set of vectors managed to build,' not as a formula to memorize.
Retell span and refusal in 3DWalk the same line-then-sheet-then-refusal story one dimension higher, and say why a third vector inside the sheet builds nothing new.
Work a rank-collapse example by handCompute a 3x3 determinant by cofactor expansion and confirm it lands on exactly zero when one column is a combination of the other two.
Run the collapse backwardsNarrate the film in reverse: a full 3D cage flattening to a sheet, then a sheet thinning to a line, and connect each stage to its rank.
Carry the picture into Chapter 8Connect the constructive picture of rank to Chapter 8's formal treatment of independence and rank.

The Big Picture: Counting the Directions You Actually Built

Look back over the whole chapter with one question in mind: at each step, how many new directions did you actually gain?

ConstructionNew directions gainedRank
One vector î (Section 1)1 — the line it spans1
î and ĵ, genuinely different (Section 2)1 more — the plane opens up2
A skewed but independent pair (Section 3)Still 1 more — different angle, same result2
v and a scaled copy of v (Section 4)0 more — the second vector was extra1

That right-hand column is rank: not a formula to memorize, but a running tally of how much grid a set of vectors actually built, kept honest by refusing to count a direction twice. Three vectors in the plane can never push that tally past 22 — the plane only has two independent directions to give, no matter how many vectors you throw at it.

Everything so far has happened in two dimensions, where the story is short: build a line, then a plane, and there is nowhere left to grow. Three dimensions tell the same story with one more chapter — a line becomes a sheet, a sheet becomes a solid cage, and a third vector can either open up that cage or collapse uselessly back inside a sheet it already had. The rest of this section retells that story stage by stage, with a live 3D grid you can build with your own hands.


One Vector, Then Two: A Line, Then a Sheet

Start exactly the way Section 1 did — one ruler, ı^=(1,0,0)\hat{\imath} = (1, 0, 0) — except now it floats in three dimensions instead of two. Scrubbing xx in

V=xı^V = x \cdot \hat{\imath}

still sweeps out only a 1D line, exactly as before — a line that happens to sit inside a room with a third axis it never touches. The extra dimension changes nothing about what one vector can reach: rank stays 1. Even in 3D, one vector builds only a line.

Now add a second, genuinely different vector, ȷ^=(0,1,0)\hat{\jmath} = (0, 1, 0). The combination

V=xı^+yȷ^V = x \cdot \hat{\imath} + y \cdot \hat{\jmath}

reaches every point of an entire flat plane — but that plane is not the whole room. It is a two-dimensional sheet, infinitely wide and infinitely thin, hanging in empty 3D space with a whole unexplored third axis on either side of it. {ı^,ȷ^}\{\hat{\imath}, \hat{\jmath}\} built rank 2 — two genuinely different directions, exactly as many as before, just now drawn inside a bigger room.


The Refusal, Retold in 3D

Section 1’s refusal — a duplicate î sweeping the same line it already had — has a 3D twin, and it is worth seeing exactly as it happens. Offer the sheet a third vector that looks new but secretly is not:

v3=ı^+ȷ^=(1,1,0)\vec v_3 = \hat{\imath} + \hat{\jmath} = (1, 1, 0)

v3\vec v_3 is not a copy of either ı^\hat{\imath} or ȷ^\hat{\jmath} — it points diagonally, somewhere neither of them alone points. It looks like a promising third direction. But look at its third coordinate: it is 00, exactly like every other point xı^+yȷ^x\hat{\imath} + y\hat{\jmath} already reaches. v3\vec v_3 lands squarely inside the sheet the first two vectors already built.

The refusal, in 3D. A dependent vector cannot help you build any new part of the grid. A third vector lying inside a sheet you already own is extra, exactly the way a duplicate î was extra in Section 1 — the sheet stays a sheet, and rank stays 2.
This is not a different rule from the 2D refusal — it is the exact same test, applied one dimension higher. “Does this vector reach anywhere the others could not already reach?” is the entire question, in a plane, inside a sheet in 3D space, or inside any subspace at all. v3\vec v_3 fails it, so it is extra.

The Cage Completes

The refusal only teaches something when it is followed by a vector that does point somewhere new. Instead of v3\vec v_3, add k^=(0,0,1)\hat{k} = (0, 0, 1) — a direction with a nonzero third coordinate, the one thing every point in the sheet was missing:

V=xı^+yȷ^+zk^V = x \cdot \hat{\imath} + y \cdot \hat{\jmath} + z \cdot \hat{k}

This reaches every point in the room — the sheet inflates into a solid cage, the unit cube and every scaled copy of it. Named as a matrix,

A=[100010001]=I3,A = \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix} = I_3,

the identity cage — three genuinely new directions, three dimensions actually built. Rank 3. Nothing further can be added: a fourth vector, in a 3D room, can never point anywhere the first three genuinely-independent vectors could not already reach.


Rank, Defined for Real This Time

Every stage above answered the same question — how many genuinely new directions are actually here? — and every answer was a small whole number: 1, 2 (with a refused attempt that stayed at 2), then 3. That number, in general, is rank:

Rank, constructively

The rank of a set of vectors is the number of dimensions the set actually builds — the count of genuinely new directions among them, never more than the number of vectors you started with, and never more than the size of the room they live in.

For a square matrix, rank has an exact numeric fingerprint: a 3×33 \times 3 matrix has rank 3 exactly when its determinant is nonzero — a genuine volume, not a flattened sheet or a collapsed line. The next section works that fingerprint by hand, on the exact case the widget below calls “Nearly flat — finish it.”


Running the Film Backwards: 3 → 2 → 1

Every collapse this chapter has shown runs the construction film in reverse: a grid that was fully built loses a dimension the instant one of its vectors turns out to be redundant. Here is that reverse film, worked by hand, one frame at a time.

Frame 1 — the cage, intact

Start from the completed cage: b1=(1,0,0)\vec b_1 = (1, 0, 0), b2=(0,1,0)\vec b_2 = (0, 1, 0), b3=(0.6,0.4,0.25)\vec b_3 = (0.6, 0.4, 0.25) — a cage that is almost flat, but not quite, because b3\vec b_3 still has a small nonzero third coordinate lifting it just off the sheet. Rank 3, a thin sliver of volume, but a genuine one.

Frame 2 — the cage flattens to a sheet

Push b3\vec b_3 down until its third coordinate hits exactly zero:

b3=0.6b1+0.4b2=(0.6,0.4,0).\vec b_3 = 0.6\,\vec b_1 + 0.4\,\vec b_2 = (0.6, 0.4, 0).

b3\vec b_3 is now exactly the combination this section’s refusal warned about — a vector built entirely out of the other two, contributing nothing new. Name the columns as a matrix and compute the determinant by hand, the full 3×33 \times 3 cofactor expansion:

A=[100.6010.4000]A = \begin{bmatrix} 1 & 0 & 0.6 \\ 0 & 1 & 0.4 \\ 0 & 0 & 0 \end{bmatrix}
detA=1(100.40)0(000.40)+0.6(0010)\det A = 1 \cdot \big(1 \cdot 0 - 0.4 \cdot 0\big) - 0 \cdot \big(0 \cdot 0 - 0.4 \cdot 0\big) + 0.6 \cdot \big(0 \cdot 0 - 1 \cdot 0\big)
detA=1(0)0(0)+0.6(0)=0\det A = 1(0) - 0(0) + 0.6(0) = 0

Every term in that expansion multiplies against the all-zero bottom row, so the determinant lands on exactly zero — not approximately, exactly. The cage has lost its volume: it is a sheet again. Rank drops from 3 to 2. Geometrically, the parallelepiped that used to have a sliver of height has been crushed perfectly flat.

Frame 3 — the sheet thins to a line

Keep going. Collapse b2\vec b_2 onto b1\vec b_1’s own line too — for example b1=(1,0.5,0)\vec b_1 = (1, 0.5, 0), b2=2b1=(2,1,0)\vec b_2 = 2\vec b_1 = (2, 1, 0), b3=1b1=(1,0.5,0)\vec b_3 = -1\vec b_1 = (-1, -0.5, 0). Every one of the three columns is now a scalar multiple of the single direction (1,0.5,0)(1, 0.5, 0). The sheet thins all the way down to one line. Rank drops from 2 to 1 — three vectors went in, and only a single dimension came out.

FrameConstructiondet (of a full 3x3)Rank
1b1, b2, b3 = (0.6, 0.4, 0.25) -- a genuine sliver of volumenonzero3
2b3 = 0.6 b1 + 0.4 b2 -- flattened onto the b1-b2 sheet0 (worked above)2
3b2 = 2 b1, b3 = -1 b1 -- all three collinear01

The Hidden 1s, One Dimension Higher

Section 3 introduced the “hidden 1s” idea with two throwaway arithmetic facts: 18=81 \cdot 8 = 8 and 21=22 \cdot 1 = 2. The multiplier 11 is doing real work in both — it is just invisible, because multiplying by 1 changes nothing and so nobody bothers to write it.

The completed 3D cage carries the identical invisible bookkeeping. Whatever basis {b1,b2,b3}\{\vec b_1, \vec b_2, \vec b_3\} you actually build — skewed, stretched, rotated, however far from {ı^,ȷ^,k^}\{\hat{\imath}, \hat{\jmath}, \hat{k}\} it looks — every coordinate you read off it is still secretly a count of that basis’s own units, playing the exact role 1 played for 8. Toggle “Show the hidden 1s” in the widget below and the standard ı^,ȷ^,k^\hat{\imath}, \hat{\jmath}, \hat{k} frame draws itself back in, dashed white, sitting exactly where it always was — inside every transformed cage you build, never gone, just never written down.

The orthonormal grid never actually leaves. It becomes invisible the same way the factor 1 becomes invisible in 18=81 \cdot 8 = 8 — always multiplying, never announced.

See It Live: Build Your Own Cage

The widget below is the full 3D retelling of this whole chapter, built stage by stage — the same five moves worked out above, now under your own control. Each stage has a Guide panel below the canvas with the exact copy for that stage and a stepper across the top; presets and a live rank/determinant/volume readout appear once you reach your own grid.

StageWhat to look for
1 — One vectorScrub x and watch V = x*b1 slide along a single red line floating in an otherwise empty cyan-ghosted room. Nothing off that line is reachable yet.
2 — Add ĵ — the sheetA translucent purple sheet appears, spanned by b1 and b2. Scrub x and y together and watch the reachable set flood the whole sheet -- but it stays infinitely thin.
3 — A vector inside the sheetPress 'Add v3 = i + j'. Watch the sheet pulse once -- the widget's way of showing the span did not grow -- then read the refusal card explaining why v3 is extra.
4 — Add k̂ — the cagePress 'Add k instead ->'. A blue vector lifts out of the sheet and the amber wireframe cage inflates to fill the room. This is A = I3, rank 3.
5 — Your 3D gridDrag any of the three colored handles, or type the matrix directly. Try the 'Nearly flat -- finish it' preset and drag b3 down to z = 0 to reproduce this section's worked collapse live; then try 'Collinear' for the full 3 -> 2 -> 1 story in one preset.
Loading 3D grid builder

The mission inside the studio, “The grid architect,” asks you to do exactly this by hand: build a genuinely skewed full-rank grid, deliberately collapse it to rank 1, then reproduce a rank-2 collapse here in the 3D builder — the same three moves this section just walked through, scored instead of just watched. Open the standalone Linear Algebra Studio, pinned to the 3D grid builder to try the mission, explore beyond this section’s five stages, or just keep dragging.


Checking 3D Rank With NumPy

The three frames of the backwards film above — a genuine cage, the flattened sheet, and the fully collinear line — are exactly the three matrices worth checking numerically. np.linalg.matrix_rank\texttt{np.linalg.matrix\_rank} does not care that these are 3×33 \times 3 instead of 2×22 \times 2; it is the same tolerance-aware, SVD-based rank used throughout this chapter.

np.linalg.matrix_rank across a cage, a flattened sheet, and a collinear line
🐍grid_rank_3d_check.py
1import numpy as np

📚 The same rank function this whole chapter has been leaning on, now run on a 3×3 matrix instead of 2×2 — np.linalg.matrix_rank does not care about dimension.

EXAMPLE
after import: np.linalg.* available
3A_cage = np.array([[1,0,0],[0,1,0],[0,0,1]])

📚 The identity cage from Stage 4: b1, b2, b3 are the standard basis, each one a genuinely new direction. This is the 'Identity' preset in the live widget below.

EXAMPLE
⬆ A_cage.shape = (3, 3)
7A_flat = np.array([[1,0,0.6],[0,1,0.4],[0,0,0]])

📚 This section's worked collapse: column 2 is b3 = (0.6, 0.4, 0), which is exactly 0.6·b1 + 0.4·b2 — it lies inside the sheet the first two columns already span.

EXAMPLE
⬆ A_flat.shape = (3, 3)
11A_line = np.array([[1,2,-1],[0.5,1,-0.5],[0,0,0]])

📚 Every column here is a scalar multiple of (1, 0.5, 0) — the fully collapsed case, matching the 'Collinear' preset in the widget. Three vectors went in; one dimension came out.

EXAMPLE
⬆ A_line.shape = (3, 3)
14for name, A in [("A_cage", ...), ...]:

Loop over all three constructions and print both rank and determinant side by side, the same two numbers this section computed by hand for A_flat.

EXAMPLE
iterates 3 times
15print(name, "-> rank =", np.linalg.matrix_rank(A), ...)

The verdicts: A_cage -> rank 3, det = 1.0 (a genuine cube of volume 1). A_flat -> rank 2, det = 0.0 (the exact hand computation below). A_line -> rank 1, det = 0.0 (everything collinear).

EXAMPLE
stdout: A_cage -> rank = 3  det = 1.0
A_flat -> rank = 2  det = 0.0
A_line -> rank = 1  det = 0.0
11 lines without explanation
1import numpy as np
2
3A_cage = np.array([[1.0, 0.0, 0.0],
4                    [0.0, 1.0, 0.0],
5                    [0.0, 0.0, 1.0]])   # identity cage: b1, b2, b3 all new
6
7A_flat = np.array([[1.0, 0.0, 0.6],
8                    [0.0, 1.0, 0.4],
9                    [0.0, 0.0, 0.0]])   # b3 = 0.6*b1 + 0.4*b2 -- lies in the sheet
10
11A_line = np.array([[1.0,  2.0, -1.0],
12                    [0.5,  1.0, -0.5],
13                    [0.0,  0.0,  0.0]])  # b2 = 2*b1, b3 = -1*b1 -- all collinear
14
15for name, A in [("A_cage", A_cage), ("A_flat", A_flat), ("A_line", A_line)]:
16    print(name, "-> rank =", np.linalg.matrix_rank(A),
17          " det =", round(float(np.linalg.det(A)), 4))

Three matrices, three different ranks, and every one of them matches the determinant and the geometric picture worked out by hand above — NumPy is not doing anything this section has not already done with pencil and paper, just doing it in a fraction of a second and tolerant of the floating-point noise real data always carries.


Common Misconceptions

“A bigger room means a vector can build more dimensions”

Why it is tempting: moving from 2D to 3D adds a whole new axis, so it is tempting to think a single vector somehow gets more powerful with more room to work in. Correction: one vector always builds exactly one dimension, no matter how large the surrounding space is. Room size only sets the ceiling on rank, never the floor. Example: ı^\hat{\imath} spans a 1D line whether it lives in a 2D plane, a 3D room, or a 100-dimensional space — the span is still just one line.

“A third vector that looks different from the first two must add a dimension”

Why it is tempting: v3=(1,1,0)\vec v_3 = (1, 1, 0) is not equal to ı^\hat{\imath} or ȷ^\hat{\jmath}, so it is easy to assume it must point somewhere new. Correction: “looks different from each vector individually” is not the test — “lies outside the span of the others” is. Example: every point in the sheet spanned by ı^\hat{\imath} and ȷ^\hat{\jmath} looks different from both of them individually — that is what a plane full of combinations looks like — yet none of those points reach any new dimension.


Summary

IdeaThe takeaway
Rank, constructivelyThe number of genuinely new directions a set of vectors actually built -- never more than the vectors you started with, never more than the room they live in.
The 3D retellingOne vector -> a line (rank 1). A second, genuinely new vector -> an infinitely thin sheet (rank 2). A dependent third vector inside the sheet -> refused, rank stays 2. A genuinely new third vector -> the full cage (rank 3).
The determinant testFor a square matrix, rank equals the full dimension exactly when det != 0 -- a genuine volume, not a flattened sheet or collapsed line.
The backwards filmb3 = 0.6 b1 + 0.4 b2 flattens the cage to a sheet (rank 3 -> 2); collapsing b2 onto b1's own line thins the sheet to a line (rank 2 -> 1).
The hidden 1s, in 3DEvery constructed cage still silently carries the standard i, j, k frame inside it -- coordinates are always counted against a basis's own units, the same way 8 is secretly 8 times 1.

Practice Problems

Beginner

B1. For b1=(1,0,0)\vec b_1 = (1, 0, 0), b2=(0,1,0)\vec b_2 = (0, 1, 0), b3=(2,3,0)\vec b_3 = (2, 3, 0), state the rank of the set without computing a determinant, and explain in one sentence why.
Hint: what is the third coordinate of every one of these three vectors?

B2. Compute det[100010001]\det \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix} by cofactor expansion along the top row, and confirm it matches the rank-3 cage from this section.
Hint: two of the three cofactor terms multiply against a column of zeros.

Conceptual

C1. A classmate says “three vectors in 3D are always independent, because there are exactly three of them and three dimensions to fill.” Give a specific counterexample using the “flat cage” construction from this section.
Hint: reuse b3=0.6b1+0.4b2\vec b_3 = 0.6\vec b_1 + 0.4\vec b_2 and explain what it fails to build.

C2. Explain, using the “refusal, retold in 3D” argument above, why rank can never exceed the number of vectors you start with, even before you check a single determinant.
Hint: each vector can add at most one new dimension to the running tally.

Coding

K1. Using NumPy, build a 3×33 \times 3 matrix whose third column is a linear combination of the first two (pick your own weights), then confirm np.linalg.matrix_rank\texttt{np.linalg.matrix\_rank} reports 2 and np.linalg.det\texttt{np.linalg.det} reports (numerically) 0.
Hint: mirror this section’s AflatA_{\text{flat}} matrix with your own weights instead of 0.6 and 0.4.


Concept Map

This section closes the chapter by retelling every idea from Sections 1 through 4 one dimension higher, then handing the constructive picture of rank off to the chapter that treats it formally.

FromThis sectionLeads to
§1-4: span, the refusal, a skewed grid, and a full collapse -- all in 2DThe identical five-stage story retold in 3D: line, sheet, refused third vector, completed cage, then run backwards frame by frameChapter 8: linear independence and rank, treated formally

Everything in this chapter has been the same question, asked over and over: how much grid did a set of vectors actually build? Chapter 8, Linear Independence and Rank, picks that exact question back up and gives it the formal machinery this chapter deliberately set aside: the trivial-solution test for independence, rank as the dimension of a column space, and the numerical tools that make both trustworthy on real, floating-point data. Every intuition built here — the refusal, the hidden 1s, the film that runs forward and backward — carries over unchanged; only the vocabulary gets more precise.


Loading comments...