Session 11 · Unit 1

Matrix Spaces; Rank 1; Small World Graphs


Vector spaces whose vectors aren't columns of numbers — matrices, even solutions of a differential equation — obey the same rules of basis and dimension. Strang computes dimensions of matrix subspaces, discovers the formula relating intersections and sums, shows that every rank one matrix is a column times a row, and closes with the friendship graph behind "six degrees of separation."

Vector spaces that don’t contain vectors

At the end of lecture ten, Strang was working with vector spaces whose elements were not what we usually call vectors — they were matrices. This lecture picks that thread up, because the point deserves to sink in: we’ve been so specific about nn-dimensional space, and “you really want to see that the same ideas work as long as you can add and multiply by scalars.”

Take MM, the space of all 3×33 \times 3 matrices. You can add two of them; you can multiply one by a scalar. (You can also multiply two matrices together — but that’s not part of the vector space picture. The vector space part is just adding and scaling.) Inside MM sit interesting subspaces:

  • SS — the symmetric 3×33 \times 3 matrices. Add two symmetric matrices and the sum is still symmetric. (Multiply two symmetric matrices and the product need not be symmetric — but we’re not multiplying, so we’re fine.)
  • UU — the upper triangular 3×33 \times 3 matrices. Add two upper triangulars, still upper triangular.

Both pass the subspace test. Now the natural questions, the same ones we always ask: what is a basis, and what is the dimension?

Bases and dimensions of matrix spaces

How many numbers does it take to specify a 3×33 \times 3 matrix? Nine. So the dimension of MM is nine, and the most obvious basis is the “standard basis” of matrices with a single 11 and eight zeros:

[100000000],  [010000000],  ,  [000000001]\begin{bmatrix} 1 & 0 & 0 \\ 0 & 0 & 0 \\ 0 & 0 & 0 \end{bmatrix},\; \begin{bmatrix} 0 & 1 & 0 \\ 0 & 0 & 0 \\ 0 & 0 & 0 \end{bmatrix},\; \ldots,\; \begin{bmatrix} 0 & 0 & 0 \\ 0 & 0 & 0 \\ 0 & 0 & 1 \end{bmatrix}

Nine of them. Our space is “practically the same as nine-dimensional space” — the nine numbers are just written in a square instead of a column. But it deserves to be thought of as natural for itself.

Now the subspaces. For a symmetric matrix, how many parameters do you choose freely? The three diagonal entries, plus the three entries above the diagonal — the three below are then forced. So dimS=6\dim S = 6. For an upper triangular matrix, you choose the three diagonal entries and the three above: dimU=6\dim U = 6 as well.

Here’s a subtlety worth noticing. Of the nine standard basis matrices, six happen to be upper triangular — so the big basis accidentally contains a basis for UU. But only three of the nine are symmetric (the three diagonal ones), and three matrices can’t span a six-dimensional SS. The lesson: a basis for the big space generally does not hand you a basis for a subspace. You have to think it over again.

Intersections and sums of subspaces

What subspaces can we build from SS and UU? First, their intersection SUS \cap U — the matrices that are symmetric and upper triangular. Symmetric and upper triangular forces every off-diagonal entry to be zero, so SU=DS \cap U = D, the diagonal matrices, and dim(SU)=3\dim(S \cap U) = 3.

What about the union — matrices that are symmetric or upper triangular? That is not a subspace. It’s like taking a couple of lines in the plane and stopping there: two six-dimensional subspaces of a nine-dimensional space, headed in different directions. Add a symmetric matrix to an upper triangular one and you generally land outside both. We can’t just put the two subspaces together — we have to fill in.

What do you get from a symmetric plus an upper triangular? Anything — every 3×33 \times 3 matrix can be written that way. So S+U=MS + U = M and dim(S+U)=9\dim(S + U) = 9. And now Strang sees a nice formula sitting in the numbers: 6+6=3+96 + 6 = 3 + 9.

A vector space from a differential equation

One more vector space that doesn’t have vectors in it — this one comes from differential equations. Look at all solutions of

d2ydx2+y=0.\frac{d^2 y}{dx^2} + y = 0.

y=cosxy = \cos x is a solution. y=sinxy = \sin x is a solution. (y=eixy = e^{ix} too, but you don’t need to add it separately — it’s already a combination of these.) The complete solution is

y=c1cosx+c2sinx.y = c_1 \cos x + c_2 \sin x.

That set of solutions is a vector space. What Strang wants you to see: this is really a null space — the null space of a differential equation. And cosx\cos x, sinx\sin x are a basis: every solution is a combination of them, just as the special solutions were a basis for the null space of Ax=0A\mathbf{x} = \mathbf{0}. The dimension of the solution space is two, because the equation is second order. (eixe^{ix} and eixe^{-ix} would be another perfectly good basis — lots of bases.)

Rank one matrices: the building blocks

Back to the key number attached to a matrix: its rank (never bigger than mm or nn). Strang singles out rank one matrices because they ought to be simple — “if the rank is only one, the matrix can’t get away from us.”

Their determinants will be easy, their eigenvalues will be interesting — rank one matrices will keep coming back.

That raises a subspace question. Inside the space of all 5×175 \times 17 matrices, do the matrices of rank four (or less) form a subspace? No. If you add two rank four matrices, the sum is usually not rank four — in fact the general rule is

rank(A+B)rank(A)+rank(B),\operatorname{rank}(A + B) \le \operatorname{rank}(A) + \operatorname{rank}(B),

so the sum of two rank fours could go up to rank five here (never more than m=5m = 5). Same for rank one: add two rank one matrices and you most likely get rank two. Not a subspace.

One more subspace, all four ways

A more likely exam-style example. In R4\mathbb{R}^4, take

S={v:v1+v2+v3+v4=0}.S = \left\{ \mathbf{v} : v_1 + v_2 + v_3 + v_4 = 0 \right\}.

Is it a subspace? Yes: multiply a vector whose components add to zero by six and they still add to zero; add two such vectors and the sums add to zero. Its dimension? Three — and here’s the systematic way to see it. SS is exactly the null space of the 1×41 \times 4 matrix

A=[1111],A = \begin{bmatrix} 1 & 1 & 1 & 1 \end{bmatrix},

since Av=0A\mathbf{v} = 0 says precisely that the components add to zero. The rank of AA is one, so dimN(A)=nr=41=3\dim N(A) = n - r = 4 - 1 = 3. A basis: the three special solutions. The pivot variable is v1v_1; the free variables are v2,v3,v4v_2, v_3, v_4. Set each free variable to 11 in turn, and a 1-1 in the first slot makes the sum zero:

[1100],[1010],[1001]\begin{bmatrix} -1 \\ 1 \\ 0 \\ 0 \end{bmatrix},\quad \begin{bmatrix} -1 \\ 0 \\ 1 \\ 0 \end{bmatrix},\quad \begin{bmatrix} -1 \\ 0 \\ 0 \\ 1 \end{bmatrix}

Not the only possible basis, but “those are the special three.”

Now kill the example by finding all four fundamental subspaces of AA. The row space is one-dimensional in R4\mathbb{R}^4: all multiples of [1111]\begin{bmatrix} 1 & 1 & 1 & 1 \end{bmatrix}. The null space is the three-dimensional SS; check 1+3=4=n1 + 3 = 4 = n. The column space: the columns have only one component, so C(A)C(A) lives in R1\mathbb{R}^1 — and all multiples of the column 11 give all of R1\mathbb{R}^1, so C(A)=R1C(A) = \mathbb{R}^1, dimension one. The null space of ATA^T: the only combination of the rows giving the zero row is the zero combination, so N(AT)={0}N(A^T) = \{\mathbf{0}\}, dimension zero; check 1+0=1=m1 + 0 = 1 = m. And a nice point of hygiene: the subspace containing only the zero vector has dimension zero, and its basis is the empty set — zero members, dimension zero.

Small world graphs

Five minutes on the topic that leads into the next lecture. A graph here isn’t a sine curve from calculus — the word means something completely different: a set of nodes and edges connecting them. Strang draws five nodes and six edges, and promises that some 5×65 \times 6 matrix will tell us everything about that graph — next time.

The graph he’s interested in: let every person in the room be a node, with an edge between two people if they’re friends. Scale it up to the whole country — 260 million nodes, edges between friends. The question: how far apart can two people be in this friendship graph? Strang’s own distance to Clinton is two — he went to college with a senator who knows Clinton. Your distance to Clinton is then at most three, “I take credit for reducing your Clinton distance to three.”

That’s the meaning behind the phrase six degrees of separation (the movie title, the book title): in the friendship graph, roughly six steps connect almost anybody to anybody. Sit next to a stranger on an airplane, start hunting for mutual friends, and you’ll often connect in two or three or four steps — “it’s a small world,” and that’s where the expression comes from. The mathematical point, saved for lecture twelve: with a few shortcuts added, distances in such graphs come down dramatically. The graph of the World Wide Web — nodes are sites, edges are links — is the fantastic example everyone wants to model.

Problems

Work these before revealing the solutions. Everything you need is in the lecture.

Problem 11.1 Dimensions of matrix subspaces

In the space of all 4×44 \times 4 matrices, find the dimensions of: (a) the whole space MM; (b) the subspace SS of symmetric matrices; (c) the subspace UU of upper triangular matrices; (d) SUS \cap U; (e) S+US + U. Verify the formula dimS+dimU=dim(SU)+dim(S+U)\dim S + \dim U = \dim(S \cap U) + \dim(S + U).

Show solution

(a) A 4×44 \times 4 matrix has 1616 entries, so dimM=16\dim M = 16.

(b) A symmetric matrix is fixed by its diagonal (44 entries) plus the entries above the diagonal (66 entries): dimS=10\dim S = 10.

(c) Upper triangular: the diagonal and above, again 4+6=104 + 6 = 10, so dimU=10\dim U = 10.

(d) Symmetric and upper triangular forces all off-diagonal entries to zero: SUS \cap U is the diagonal matrices, dim(SU)=4\dim(S \cap U) = 4.

(e) Every matrix is a symmetric plus an upper triangular, so S+U=MS + U = M and dim(S+U)=16\dim(S + U) = 16.

Check: 10+10=4+16=2010 + 10 = 4 + 16 = 20. ✓

Problem 11.2 Solution space as null space

Consider all solutions of yy=0y'' - y = 0. Show that they form a vector space, give a basis, and state the dimension. Then give a second basis for the same space.

Show solution

If y1=y1y_1'' = y_1 and y2=y2y_2'' = y_2, then (c1y1+c2y2)=c1y1+c2y2=c1y1+c2y2(c_1 y_1 + c_2 y_2)'' = c_1 y_1'' + c_2 y_2'' = c_1 y_1 + c_2 y_2 — combinations of solutions are solutions, so the solution set is a vector space (the “null space” of the operator yyyy \mapsto y'' - y).

y=exy = e^{x} and y=exy = e^{-x} are solutions, and every solution is y=c1ex+c2exy = c_1 e^{x} + c_2 e^{-x}. Since neither is a multiple of the other, they are independent: {ex,ex}\{e^{x}, e^{-x}\} is a basis and the dimension is 22 (a second order equation).

A second basis: coshx=12(ex+ex)\cosh x = \tfrac{1}{2}(e^x + e^{-x}) and sinhx=12(exex)\sinh x = \tfrac{1}{2}(e^x - e^{-x}). Both solve the equation, they are independent, and e±x=coshx±sinhxe^{\pm x} = \cosh x \pm \sinh x shows they span the same space. Lots of bases.

Problem 11.3 Rank one factorization

Write the matrix

A=[363121242]A = \begin{bmatrix} 3 & 6 & -3 \\ 1 & 2 & -1 \\ 2 & 4 & -2 \end{bmatrix}

in the form uvT\mathbf{u}\mathbf{v}^T. Then give bases for its row space and column space, and find the dimension of its null space.

Show solution

Every row is a multiple of [121]\begin{bmatrix} 1 & 2 & -1 \end{bmatrix} — rows one, two, three are 33, 11, 22 times it. So

A=[312][121]=uvT.A = \begin{bmatrix} 3 \\ 1 \\ 2 \end{bmatrix} \begin{bmatrix} 1 & 2 & -1 \end{bmatrix} = \mathbf{u}\mathbf{v}^T.

The rank is one. Basis for the row space: [121]\begin{bmatrix} 1 & 2 & -1 \end{bmatrix}. Basis for the column space: [312]\begin{bmatrix} 3 \\ 1 \\ 2 \end{bmatrix} (every column is a multiple of it: 11, 22, 1-1 times).

Null space dimension: nr=31=2n - r = 3 - 1 = 2.

Problem 11.4 Is it a subspace?

Inside the space of all 3×33 \times 3 matrices, decide whether each subset is a subspace. Give a reason or a counterexample. (a) The matrices of rank one, together with the zero matrix. (b) The matrices whose nine entries add to zero.

Show solution

(a) Not a subspace. Take A=[100][100]A = \begin{bmatrix} 1 \\ 0 \\ 0 \end{bmatrix}\begin{bmatrix} 1 & 0 & 0 \end{bmatrix} and B=[010][010]B = \begin{bmatrix} 0 \\ 1 \\ 0 \end{bmatrix}\begin{bmatrix} 0 & 1 & 0 \end{bmatrix} — each has rank one, but A+BA + B has two independent rows, so its rank is two. Adding two rank one matrices most likely gives rank two; the set is not closed under addition. (In general rank(A+B)rank(A)+rank(B)\operatorname{rank}(A+B) \le \operatorname{rank}(A) + \operatorname{rank}(B), but the sum’s rank can exceed one.)

(b) A subspace. If the entries of AA add to zero and the entries of BB add to zero, the entries of A+BA + B add to 0+0=00 + 0 = 0, and the entries of cAcA add to c0=0c \cdot 0 = 0. One linear condition on the nine entries — exactly like v1++v4=0v_1 + \cdots + v_4 = 0 in R4\mathbb{R}^4 — so it is a null space in disguise, of dimension 91=89 - 1 = 8.

Problem 11.5 Four subspaces of a one-row matrix

Let A=[122]A = \begin{bmatrix} 1 & 2 & 2 \end{bmatrix}, a 1×31 \times 3 matrix. Find the dimension of each of the four fundamental subspaces, and give a basis for the null space N(A)N(A).

Show solution

The rank is r=1r = 1 (one nonzero row).

  • Row space C(AT)C(A^T): dimension 11 in R3\mathbb{R}^3; basis [122]\begin{bmatrix} 1 & 2 & 2 \end{bmatrix}.
  • Null space N(A)N(A): dimension nr=31=2n - r = 3 - 1 = 2.
  • Column space C(A)C(A): dimension 11 — it is all of R1\mathbb{R}^1.
  • Null space of ATA^T: dimension mr=11=0m - r = 1 - 1 = 0 — only the zero vector, with the empty set as basis.

For N(A)N(A): the pivot variable is v1v_1; free variables are v2,v3v_2, v_3. The condition is v1+2v2+2v3=0v_1 + 2v_2 + 2v_3 = 0. Special solutions: set v2=1,v3=0v_2 = 1, v_3 = 0 giving v1=2v_1 = -2; set v2=0,v3=1v_2 = 0, v_3 = 1 giving v1=2v_1 = -2:

[210],[201].\begin{bmatrix} -2 \\ 1 \\ 0 \end{bmatrix},\qquad \begin{bmatrix} -2 \\ 0 \\ 1 \end{bmatrix}.

Check: 1+2=3=n1 + 2 = 3 = n and 1+0=1=m1 + 0 = 1 = m. ✓