Linear-Algebra-Done-Right Β· Unit 21 Β· Video 4 Β· Interactive Practice

Matrix SVD: Computing It and Factoring A = BDC*

IKey Formulas

FormulaNameWhat it says
Tβˆ—Tek=Ξ»kekT^*T e_k = \lambda_k e_k with Ξ»k>0\lambda_k > 0, Β sk=Ξ»k\ s_k = \sqrt{\lambda_k}, Β fk=Teksk\ f_k = \dfrac{Te_k}{s_k}Computing an SVDThe eke_k are an orthonormal basis of each eigenspace E(Ξ»,Tβˆ—T)E(\lambda, T^*T) with Ξ»>0\lambda > 0, put together; the fkf_k then come out orthonormal automatically
Tv=s1⟨v,e1⟩f1+β‹―+sm⟨v,em⟩fmTv = s_1\langle v, e_1\rangle f_1 + \cdots + s_m\langle v, e_m\rangle f_mSingular value decompositionmm = number of positive singular values =dim⁑range⁑T= \dim \operatorname{range} T
A=BDCβˆ—A = BDC^*Matrix versionA∈Fp,nA \in \mathbf{F}^{p,n} of rank mβ‰₯1m \ge 1: B=(f1β‹―fm)B = (f_1 \cdots f_m) is pΓ—mp \times m, D=diag⁑(s1,…,sm)D = \operatorname{diag}(s_1, \dots, s_m) is mΓ—mm \times m, C=(e1β‹―em)C = (e_1 \cdots e_m) is nΓ—mn \times m
m(p+m+n)<pnm(p + m + n) < pnStorage savingB,D,CB, D, C hold pm+m2+nmpm + m^2 + nm entries against the pnpn entries of AA

Key Insight: When m<nm < n, CCβˆ—β‰ ICC^* \ne I, yet ACCβˆ—=AACC^* = A: CCβˆ—CC^* fixes each eke_k, and on (span⁑(e1,…,em))βŠ₯(\operatorname{span}(e_1, \dots, e_m))^\perp both AA and Cβˆ—C^* are zero.

IIEvery Choice in the Recipe, Checked by BDCβˆ—BDC^*

For the video's TT, with s1=5s_1 = 5 and s2=2s_2 = \sqrt{2}, the product BDCβˆ—BDC^* equals M(T)\mathcal{M}(T) only for orthonormal ee's with fk=Tek/skf_k = Te_k/s_k.

T(x1,x2,x3,x4)=(βˆ’5x4,Β 0,Β x1+x2)T(x_1, x_2, x_3, x_4) = (-5x_4,\ 0,\ x_1 + x_2), Β M(T)=(000βˆ’500001100)\ \mathcal{M}(T) = \begin{pmatrix} 0&0&0&-5\\ 0&0&0&0\\ 1&1&0&0 \end{pmatrix}

IIICCβˆ—β‰ ICC^* \ne I, Yet ACCβˆ—=AACC^* = A

For a rank-one AA, CCβˆ—CC^* projects onto span⁑(e1)\operatorname{span}(e_1), and AA sends the discarded part v2v_2 to 00.

A=(11βˆ’1βˆ’1)A = \begin{pmatrix} 1&1\\ -1&-1 \end{pmatrix}, rank 11: Β e1=12(1,1)\ e_1 = \tfrac{1}{\sqrt2}(1, 1), s1=2s_1 = 2, f1=12(1,βˆ’1)f_1 = \tfrac{1}{\sqrt2}(1, -1), Β CCβˆ—=(12121212)β‰ I\ CC^* = \begin{pmatrix} \tfrac12&\tfrac12\\ \tfrac12&\tfrac12 \end{pmatrix} \ne I

IVWhen the Factors Save Storage

AA takes pnpn entries and B,D,CB, D, C take m(p+m+n)m(p + m + n), so only a small rank saves.

VQuiz Questions

Problem 1 Β· Singular Values from Tβˆ—TT^*T

Given: T∈L(F3,F2)T \in \mathcal{L}(\mathbf{F}^3, \mathbf{F}^2), T(x1,x2,x3)=(3x2,Β x1+x3)T(x_1, x_2, x_3) = (3x_2,\ x_1 + x_3), so that Tβˆ—T(x1,x2,x3)=(x1+x3,Β 9x2,Β x1+x3)T^*T(x_1, x_2, x_3) = (x_1 + x_3,\ 9x_2,\ x_1 + x_3). Find the positive singular values of TT.

βœ… Correct! The positive eigenvalues of Tβˆ—TT^*T are 99 and 22, and the singular values are their square roots: s1=3s_1 = 3, s2=2s_2 = \sqrt{2}.
❌ Not quite. 99 and 22 are the positive eigenvalues of Tβˆ—TT^*T; each singular value is the square root sk=Ξ»ks_k = \sqrt{\lambda_k}.
❌ Close, but… the eigenvalue 00 of Tβˆ—TT^*T is dropped: only positive singular values enter the decomposition, and there are dim⁑range⁑T=2\dim \operatorname{range} T = 2 of them.
❌ Not quite. The diagonal entries 1,9,11, 9, 1 of M(Tβˆ—T)\mathcal{M}(T^*T) are not its eigenvalues, because that matrix is not diagonal: Tβˆ—T(1,0,0)=(1,0,1)T^*T(1, 0, 0) = (1, 0, 1), so (1,0,0)(1, 0, 0) is not an eigenvector.
Show solution

Step one is given. Step two: find the positive eigenvalues of Tβˆ—TT^*T.

Tβˆ—T(0,1,0)=(0,9,0)=9(0,1,0),Tβˆ—T(1,0,1)=(2,0,2)=2(1,0,1),T^*T(0, 1, 0) = (0, 9, 0) = 9(0, 1, 0), \qquad T^*T(1, 0, 1) = (2, 0, 2) = 2(1, 0, 1),

and Tβˆ—T(1,0,βˆ’1)=(0,0,0)T^*T(1, 0, -1) = (0, 0, 0), so the eigenvalues are 99, 22, 00, each with a one-dimensional eigenspace. The eigenvalue 00 is dropped.

Step three: s1=9=3s_1 = \sqrt{9} = 3 and s2=2s_2 = \sqrt{2}. Two positive singular values, matching dim⁑range⁑T=2\dim \operatorname{range} T = 2 (the range is all of F2\mathbf{F}^2).

Problem 2 Β· Which Change Keeps the Decomposition?

Given: the same T(x1,x2,x3)=(3x2, x1+x3)T(x_1, x_2, x_3) = (3x_2,\ x_1 + x_3) has the singular value decomposition Tv=3⟨v,e1⟩f1+2⟨v,e2⟩f2Tv = 3\langle v, e_1\rangle f_1 + \sqrt{2}\langle v, e_2\rangle f_2 with e1=(0,1,0)e_1 = (0, 1, 0), f1=(1,0)f_1 = (1, 0), e2=12(1,0,1)e_2 = \tfrac{1}{\sqrt2}(1, 0, 1), f2=(0,1)f_2 = (0, 1). Which change, keeping s1=3s_1 = 3 and s2=2s_2 = \sqrt{2} and leaving the other vectors alone, still gives a singular value decomposition of TT?

βœ… Correct! 3⟨v,βˆ’e1⟩(βˆ’f1)=3⟨v,e1⟩f13\langle v, -e_1\rangle(-f_1) = 3\langle v, e_1\rangle f_1, so the sum is unchanged; and βˆ’f1=T(βˆ’e1)/3-f_1 = T(-e_1)/3 is exactly what step four produces from βˆ’e1-e_1.
❌ Not quite. Flipping only e1e_1 makes the first term 3⟨v,βˆ’e1⟩f1=(βˆ’3x2,0)3\langle v, -e_1\rangle f_1 = (-3x_2, 0), the wrong sign. Step four would give f1=T(βˆ’e1)/3=(βˆ’1,0)f_1 = T(-e_1)/3 = (-1, 0): the signs of e1e_1 and f1f_1 change together.
❌ Not quite. βˆ₯(1,0,1)βˆ₯=2\|(1, 0, 1)\| = \sqrt{2}, so this e2e_2 is not a unit vector, and f2=(0,2)f_2 = (0, \sqrt2) is not one either. The second term becomes 2(x1+x3)(0,2)=(0,2(x1+x3))\sqrt{2}(x_1 + x_3)(0, \sqrt{2}) = (0, 2(x_1 + x_3)): twice too big.
❌ Not quite. (0,βˆ’1)(0, -1) is a unit vector on the line of Te2Te_2, but it is not Te2/s2=(0,1)Te_2/s_2 = (0, 1). The second term becomes (0,βˆ’(x1+x3))(0, -(x_1 + x_3)), the wrong sign.
Show solution

Every fkf_k is tied to its eke_k by fk=Tek/skf_k = Te_k/s_k. Check each option against Tv=(3x2, x1+x3)Tv = (3x_2,\ x_1 + x_3), using ⟨v,e1⟩=x2\langle v, e_1\rangle = x_2 and ⟨v,e2⟩=x1+x32\langle v, e_2\rangle = \tfrac{x_1 + x_3}{\sqrt2}.

  • (a) 3⟨v,βˆ’e1⟩f1=βˆ’3x2(1,0)3\langle v, -e_1\rangle f_1 = -3x_2(1, 0): first coordinate βˆ’3x2-3x_2. Fails.
  • (b) 3⟨v,βˆ’e1⟩(βˆ’f1)=3x2(1,0)3\langle v, -e_1\rangle(-f_1) = 3x_2(1, 0): unchanged. Still orthonormal lists. Works.
  • (c) 2⟨v,(1,0,1)⟩(0,2)=(0,2(x1+x3))\sqrt2\langle v, (1,0,1)\rangle(0, \sqrt2) = (0, 2(x_1 + x_3)). Fails (and neither vector is a unit vector).
  • (d) 2β‹…x1+x32(0,βˆ’1)=(0,βˆ’(x1+x3))\sqrt2 \cdot \tfrac{x_1 + x_3}{\sqrt2}(0, -1) = (0, -(x_1 + x_3)). Fails.

Changing the signs of eke_k and fkf_k together always gives another valid decomposition; changing only one of them breaks it.

Problem 3 Β· Factor a Rank-One Matrix

Given: A=(221122)A = \begin{pmatrix} 2&2\\ 1&1\\ 2&2 \end{pmatrix} has rank 11 and Aβˆ—A=(9999)A^*A = \begin{pmatrix} 9&9\\ 9&9 \end{pmatrix}. Take C=12(11)C = \tfrac{1}{\sqrt2}\begin{pmatrix} 1\\ 1 \end{pmatrix}, so Cβˆ—=(1212)C^* = \begin{pmatrix} \tfrac{1}{\sqrt2} & \tfrac{1}{\sqrt2} \end{pmatrix}. Find DD and BB with A=BDCβˆ—A = BDC^* as in the matrix version of the SVD.

What is DD?

What is BB?

βœ… Correct! BDCβˆ—=13(212)32(1212)=(212)(11)=ABDC^* = \tfrac13\begin{pmatrix} 2\\ 1\\ 2 \end{pmatrix} 3\sqrt2 \begin{pmatrix} \tfrac{1}{\sqrt2} & \tfrac{1}{\sqrt2} \end{pmatrix} = \begin{pmatrix} 2\\ 1\\ 2 \end{pmatrix}\begin{pmatrix} 1 & 1 \end{pmatrix} = A.
❌ Not quite. 1818 is the positive eigenvalue of Aβˆ—AA^*A; the diagonal of DD holds the singular value s1=18s_1 = \sqrt{18}.
❌ Not quite. DD is mΓ—mm \times m with m=rank⁑A=1m = \operatorname{rank} A = 1, and every diagonal entry of DD is positive; the zero belongs to the pΓ—np \times n diagonal matrix of Video 3, which the matrix version drops.
❌ Not quite. 6=βˆ₯A(1,1)tβˆ₯=βˆ₯(4,2,4)βˆ₯6 = \|A(1, 1)^t\| = \|(4, 2, 4)\|, but (1,1)(1, 1) has norm 2\sqrt2. With the unit vector e1=12(1,1)e_1 = \tfrac{1}{\sqrt2}(1, 1), βˆ₯Ae1βˆ₯=6/2=32\|Ae_1\| = 6/\sqrt2 = 3\sqrt2.
❌ Check DD. Its diagonal holds the square roots of the positive eigenvalues of Aβˆ—AA^*A.
❌ Not quite. The column of BB must be a unit vector, and βˆ₯(2,1,2)βˆ₯=3\|(2, 1, 2)\| = 3. It is f1=Ae1/s1f_1 = Ae_1/s_1.
❌ Not quite. That is CC, a vector in F2\mathbf{F}^2. BB is pΓ—m=3Γ—1p \times m = 3 \times 1: its column is f1=Ae1/s1∈F3f_1 = Ae_1/s_1 \in \mathbf{F}^3.
❌ Not quite. βˆ’13(2,1,2)-\tfrac13(2, 1, 2) is a unit vector on the right line, but with this CC it gives BDCβˆ—=βˆ’ABDC^* = -A. Once e1e_1 is fixed, f1=Ae1/s1f_1 = Ae_1/s_1 leaves nothing to choose.
❌ Check BB. Its column is f1=Ae1/s1f_1 = Ae_1/s_1.
Show solution

Aβˆ—A(1,1)=(18,18)A^*A(1, 1) = (18, 18), so the only positive eigenvalue is 1818, with e1=12(1,1)e_1 = \tfrac{1}{\sqrt2}(1, 1), the column of CC. Then s1=18=32s_1 = \sqrt{18} = 3\sqrt2 and D=(32)D = \begin{pmatrix} 3\sqrt2 \end{pmatrix}, a 1Γ—11 \times 1 matrix since m=1m = 1.

f1=Ae1s1=12(4,2,4)32=(4,2,4)6=13(2,1,2),βˆ₯f1βˆ₯=134+1+4=1.f_1 = \frac{Ae_1}{s_1} = \frac{\tfrac{1}{\sqrt2}(4, 2, 4)}{3\sqrt2} = \frac{(4, 2, 4)}{6} = \tfrac13(2, 1, 2), \qquad \|f_1\| = \tfrac13\sqrt{4 + 1 + 4} = 1.

So B=13(2,1,2)tB = \tfrac13(2, 1, 2)^t, and

BDCβˆ—=13(212)β‹…32β‹…(1212)=(221122)=A.BDC^* = \tfrac13\begin{pmatrix} 2\\ 1\\ 2 \end{pmatrix}\cdot 3\sqrt2 \cdot \begin{pmatrix} \tfrac{1}{\sqrt2} & \tfrac{1}{\sqrt2} \end{pmatrix} = \begin{pmatrix} 2&2\\ 1&1\\ 2&2 \end{pmatrix} = A.

Here m(p+m+n)=1β‹…(3+1+2)=6=pnm(p + m + n) = 1 \cdot (3 + 1 + 2) = 6 = pn: the factors hold exactly as many entries as AA.

Problem 4 Β· When Does the Factorization Pay?

Given: AA is a 200Γ—500200 \times 500 matrix of rank mβ‰₯1m \ge 1. For which ranks do BB, DD and CC from A=BDCβˆ—A = BDC^* together hold fewer entries than AA?

βœ… Correct! 121β‹…821=99,341<100,000121 \cdot 821 = 99{,}341 < 100{,}000, while 122β‹…822=100,284>100,000122 \cdot 822 = 100{,}284 > 100{,}000.
❌ Close, but… m≀142m \le 142 solves m(p+n)<pnm(p + n) < pn, which leaves out the m2m^2 entries of DD. At m=142m = 142 the factors hold 142β‹…842=119,564142 \cdot 842 = 119{,}564 entries.
❌ Not quite. At m=200m = 200 the factors hold 200β‹…(200+200+500)=180,000200 \cdot (200 + 200 + 500) = 180{,}000 entries, more than pn=100,000pn = 100{,}000.
❌ Not quite. That is true of the full-size factors of Video 3 (pΓ—pp \times p, pΓ—np \times n, nΓ—nn \times n). The matrix version keeps only mm columns: at m=10m = 10 it holds 10β‹…710=7,10010 \cdot 710 = 7{,}100 entries.
Show solution

AA has pn=200β‹…500=100,000pn = 200 \cdot 500 = 100{,}000 entries. BB (200Γ—m200 \times m), DD (mΓ—mm \times m) and CC (500Γ—m500 \times m) hold 200m+m2+500m=m(m+700)200m + m^2 + 500m = m(m + 700).

m(m+700)<100,000β€…β€ŠβŸΊβ€…β€Šm2+700mβˆ’100,000<0β€…β€ŠβŸΊβ€…β€Šm<βˆ’700+890,0002β‰ˆ121.7.m(m + 700) < 100{,}000 \iff m^2 + 700m - 100{,}000 < 0 \iff m < \frac{-700 + \sqrt{890{,}000}}{2} \approx 121.7.

So the saving happens exactly for 1≀m≀1211 \le m \le 121. Check: 121β‹…821=99,341<100,000121 \cdot 821 = 99{,}341 < 100{,}000 and 122β‹…822=100,284>100,000122 \cdot 822 = 100{,}284 > 100{,}000.

Solved: 0 / 4