Mathematics · Book 2 · Grades 10–12

High School Mathematics

High School Mathematics · Grades 10–12

30Matrices and Graphs

A matrix is a rectangular array of numbers, added and multiplied by rules designed so that matrix algebra represents the composition of linear transformations. Matrices solve linear systems, drive coupled recurrent sequences, and count walks in networks — the mathematics behind search engines and shortest-path algorithms.

30.1 Matrix algebra

Definition 30.1 (Matrix)

An m×nm \times n matrix is a table of real numbers with mm rows and nn columns: A=(aij)A = (a_{ij}), where aija_{ij} is the entry in row ii, column jj. Two matrices of the same size are added entry by entry, and λA=(λaij)\lambda A = (\lambda a_{ij}).

Definition 30.2 (Matrix product)

Let AA be m×nm \times n and BB be n×pn \times p. The product ABAB is the m×pm \times p matrix whose (i,j)(i,j) entry is

(AB)ij=k=1naikbkj(AB)_{ij} = \sum_{k=1}^{n} a_{ik} b_{kj}

(the “row ii of AA times column jj of BB” rule).

Example 30.3

(1234)(0111)=(2347)\begin{pmatrix} 1 & 2\\ 3 & 4\end{pmatrix} \begin{pmatrix} 0 & 1\\ 1 & 1\end{pmatrix} = \begin{pmatrix} 2 & 3\\ 4 & 7\end{pmatrix}, while (0111)(1234)=(3446)\begin{pmatrix} 0 & 1\\ 1 & 1\end{pmatrix} \begin{pmatrix} 1 & 2\\ 3 & 4\end{pmatrix} = \begin{pmatrix} 3 & 4\\ 4 & 6\end{pmatrix}: matrix multiplication is not commutative.

Proposition 30.4 (Rules of matrix algebra)

Whenever the sizes make the products meaningful:

(AB)C=A(BC),A(B+C)=AB+AC,(A+B)C=AC+BC,(AB)C = A(BC), \qquad A(B + C) = AB + AC, \qquad (A+B)C = AC + BC,

and the identity matrix InI_n (ones on the diagonal, zeros elsewhere) satisfies ImA=AIn=AI_m A = A I_n = A for AA of size m×nm \times n.

Proof. All are entry-by-entry verifications from Definition 30.2; associativity, the only nontrivial one, amounts to exchanging two finite sums: ((AB)C)ij=l(kaikbkl)clj=kaik(lbklclj)=(A(BC))ij\bigl((AB)C\bigr)_{ij} = \sum_l \left(\sum_k a_{ik}b_{kl}\right) c_{lj} = \sum_k a_{ik} \left(\sum_l b_{kl} c_{lj}\right) = \bigl(A(BC)\bigr)_{ij}.

Definition 30.5 (Inverse)

A square matrix AA of size nn is invertible if there is a matrix BB with AB=BA=InAB = BA = I_n; BB is then unique, written A1A^{-1}.

Proposition 30.6 (Inverse of a 2×22\times2 matrix)

Let A=(abcd)A = \begin{pmatrix} a & b\\ c & d\end{pmatrix} and detA=adbc\det A = ad - bc (the determinant). Then AA is invertible if and only if detA0\det A \neq 0, in which case

A1=1adbc(dbca).A^{-1} = \frac{1}{ad - bc}\begin{pmatrix} d & -b\\ -c & a\end{pmatrix}.

Proof. A computation gives A(dbca)=(dbca)A=(adbc)I2A \begin{pmatrix} d & -b\\ -c & a\end{pmatrix} = \begin{pmatrix} d & -b\\ -c & a\end{pmatrix} A = (ad - bc) I_2; if adbc0ad - bc \neq 0, divide. Conversely, if adbc=0ad - bc = 0, the columns of AA are proportional, and so are the columns of ABAB for any BB; but the columns of I2I_2 are not proportional, so no BB can satisfy AB=I2AB = I_2.

Method 30.7 (Linear systems)

The system {ax+by=ecx+dy=f\begin{cases} ax + by = e\\ cx + dy = f \end{cases} is the matrix equation AX=YAX = Y with X=(xy)X = \begin{pmatrix} x \\ y\end{pmatrix}, Y=(ef)Y = \begin{pmatrix} e \\ f\end{pmatrix}. If detA0\det A \neq 0, its unique solution is X=A1YX = A^{-1}Y. The same formalism handles nn equations in nn unknowns.

30.2 Matrix powers and recurrent sequences

Definition 30.8

For a square matrix AA and kNk \in \N, Ak=A××AA^k = A \times \dots \times A (kk factors), with A0=IA^0 = I.

Method 30.9 (Diagonal-plus-nilpotent and diagonalizable cases)

Two standard ways to compute AkA^k:

  • If A=λI+NA = \lambda I + N where N2=0N^2 = 0, the binomial theorem (valid here since II and NN commute) collapses to two terms: Ak=λkI+kλk1NA^k = \lambda^k I + k \lambda^{k-1} N.
  • If one finds an invertible PP with A=PDP1A = PDP^{-1} and DD diagonal, then Ak=PDkP1A^k = P D^k P^{-1}, and DkD^k is computed entry by entry. (Finding such a PP systematically is the theory of diagonalization, developed at university; at this level PP is given.)

Example 30.10 (Coupled sequences)

Let un+1=3un+vnu_{n+1} = 3u_n + v_n and vn+1=un+3vnv_{n+1} = u_n + 3v_n. Setting Xn=(unvn)X_n = \begin{pmatrix} u_n\\ v_n \end{pmatrix} and A=(3113)A = \begin{pmatrix} 3 & 1\\ 1 & 3\end{pmatrix}, we get Xn+1=AXnX_{n+1} = AX_n, so Xn=AnX0X_n = A^n X_0. The auxiliary sequences sn=un+vns_n = u_n + v_n and dn=unvnd_n = u_n - v_n satisfy sn+1=4sns_{n+1} = 4s_n and dn+1=2dnd_{n+1} = 2d_n, so sn=4ns0s_n = 4^n s_0, dn=2nd0d_n = 2^n d_0 and

un=4n(u0+v0)+2n(u0v0)2,vn=4n(u0+v0)2n(u0v0)2.u_n = \frac{4^n(u_0+v_0) + 2^n(u_0-v_0)}{2}, \qquad v_n = \frac{4^n(u_0+v_0) - 2^n(u_0-v_0)}{2}.

(Behind the scenes: (1,1)(1,1) and (1,1)(1,-1) are eigenvector directions of AA.)

30.3 Graphs and walks

Definition 30.11 (Graph, adjacency matrix)

A graph consists of vertices 1,2,,n1, 2, \dots, n and edges joining certain pairs of vertices (ordered pairs for a directed graph). Its adjacency matrix is the n×nn \times n matrix MM with mij=1m_{ij} = 1 if there is an edge from ii to jj, and 00 otherwise. A walk of length kk from ii to jj is a sequence of kk consecutive edges leading from ii to jj.

M = pmatrix 0 & 1 & 1\\ 0 & 0 & 1\\ 1 & 0 & 0 pmatrix A directed graph and its adjacency matrix (): m_ij = 1 exactly when there is an edge from i to j.
M=(011001100)M = \begin{pmatrix} 0 & 1 & 1\\ 0 & 0 & 1\\ 1 & 0 & 0 \end{pmatrix} A directed graph and its adjacency matrix (Exercise 30.6): mij=1m_{ij} = 1 exactly when there is an edge from ii to jj.

Theorem 30.12 (Counting walks)

The number of walks of length kk from vertex ii to vertex jj is the (i,j)(i,j) entry of MkM^k.

Proof. Induction on kk. For k=1k = 1 this is the definition of MM. Assume the claim for kk. A walk of length k+1k+1 from ii to jj is a walk of length kk from ii to some vertex ll, followed by an edge from ll to jj; by the addition and multiplication principles, their number is

l=1n(Mk)ilmlj=(Mk+1)ij.\sum_{l=1}^{n} \bigl(M^k\bigr)_{il}\, m_{lj} = \bigl(M^{k+1}\bigr)_{ij}. \qedhere

Example 30.13

For the triangle graph (33 vertices, all pairs joined), M=(011101110)M = \begin{pmatrix} 0&1&1\\ 1&0&1\\ 1&1&0\end{pmatrix} and M2=(211121112)M^2 = \begin{pmatrix} 2&1&1\\ 1&2&1\\ 1&1&2\end{pmatrix}: from each vertex there are 22 walks of length 22 back to itself (via either neighbor) and 11 to each other vertex.

30.4 Exercises

Exercise 30.1

Let A=(1201)A = \begin{pmatrix} 1 & 2\\ 0 & 1 \end{pmatrix} and B=(2011)B = \begin{pmatrix} 2 & 0\\ 1 & 1 \end{pmatrix}. Compute A+BA + B, ABAB, BABA and A2A^2.

Solution

Solution of Exercise 30.1.

A+B=(3212),AB=(4211),BA=(2413),A2=(1401).A + B = \begin{pmatrix} 3 & 2\\ 1 & 2\end{pmatrix}, \quad AB = \begin{pmatrix} 4 & 2\\ 1 & 1\end{pmatrix}, \quad BA = \begin{pmatrix} 2 & 4\\ 1 & 3\end{pmatrix}, \quad A^2 = \begin{pmatrix} 1 & 4\\ 0 & 1\end{pmatrix}.

Note ABBAAB \neq BA.

Exercise 30.2

Determine whether the following matrices are invertible, and compute the inverses when they exist:

A=(2513),B=(3624).A = \begin{pmatrix} 2 & 5\\ 1 & 3\end{pmatrix}, \qquad B = \begin{pmatrix} 3 & 6\\ 2 & 4\end{pmatrix}.
Solution

Solution of Exercise 30.2.

detA=65=10\det A = 6 - 5 = 1 \neq 0: A1=(3512)A^{-1} = \begin{pmatrix} 3 & -5\\ -1 & 2 \end{pmatrix}. detB=1212=0\det B = 12 - 12 = 0: BB is not invertible.

Exercise 30.3

Solve by matrix inversion the system {2x+5y=1x+3y=2.\begin{cases} 2x + 5y = 1\\ x + 3y = 2 . \end{cases}

Solution

Solution of Exercise 30.3.

The system is AX=YAX = Y with AA as in Exercise 30.2 and Y=(12)Y = \begin{pmatrix} 1\\ 2\end{pmatrix}:

X=A1Y=(3512)(12)=(73):x=7, y=3.X = A^{-1}Y = \begin{pmatrix} 3 & -5\\ -1 & 2\end{pmatrix} \begin{pmatrix} 1\\ 2\end{pmatrix} = \begin{pmatrix} -7\\ 3\end{pmatrix}: \qquad x = -7,\ y = 3 .

Exercise 30.4 ★★

Let A=(2102)=2I+NA = \begin{pmatrix} 2 & 1\\ 0 & 2\end{pmatrix} = 2I + N with N=(0100)N = \begin{pmatrix} 0 & 1\\ 0 & 0 \end{pmatrix}.

  1. Check that N2=0N^2 = 0 and that II and NN commute.
  2. Deduce AkA^k for all kNk \in \N and verify the formula for k=2k=2 by direct computation.
Solution

Solution of Exercise 30.4.

1. N2=(0100)(0100)=0N^2 = \begin{pmatrix} 0&1\\0&0\end{pmatrix} \begin{pmatrix} 0&1\\0&0\end{pmatrix} = 0, and II commutes with every matrix.

2. Since the two terms commute, the binomial theorem applies and all terms containing N2N^2 vanish:

Ak=(2I+N)k=2kI+k2k1N=(2kk2k102k).A^k = (2I + N)^k = 2^k I + k\,2^{k-1} N = \begin{pmatrix} 2^k & k\,2^{k-1}\\ 0 & 2^k \end{pmatrix}.

Check for k=2k = 2: A2=(2102)2=(4404)A^2 = \begin{pmatrix} 2&1\\0&2\end{pmatrix}^2 = \begin{pmatrix} 4&4\\0&4\end{pmatrix}, and the formula gives 22=42^2 = 4, 2×2=42 \times 2 = 4. ✓

Exercise 30.5 ★★

Let A=(0111)A = \begin{pmatrix} 0 & 1\\ 1 & 1\end{pmatrix} and FnF_n the Fibonacci sequence (F0=0F_0 = 0, F1=1F_1 = 1, Fn+2=Fn+1+FnF_{n+2} = F_{n+1} + F_n). Show by induction that for n1n \geq 1,

An=(Fn1FnFnFn+1),A^n = \begin{pmatrix} F_{n-1} & F_n\\ F_n & F_{n+1}\end{pmatrix},

and deduce the identity Fn+1Fn1Fn2=(1)nF_{n+1}F_{n-1} - F_n^2 = (-1)^n. (Hint: determinants multiply: det(MN)=detMdetN\det(MN) = \det M \det N, which you may check for 2×22\times2 matrices.)

Solution

Solution of Exercise 30.5.

Induction. For n=1n = 1: A1=(0111)=(F0F1F1F2)A^1 = \begin{pmatrix} 0&1\\1&1\end{pmatrix} = \begin{pmatrix} F_0 & F_1\\ F_1 & F_2\end{pmatrix}. Assume the formula for nn; then

An+1=AnA=(Fn1FnFnFn+1)(0111)=(FnFn1+FnFn+1Fn+Fn+1)=(FnFn+1Fn+1Fn+2).A^{n+1} = A^n A = \begin{pmatrix} F_{n-1} & F_n\\ F_n & F_{n+1}\end{pmatrix} \begin{pmatrix} 0 & 1\\ 1 & 1\end{pmatrix} = \begin{pmatrix} F_n & F_{n-1} + F_n\\ F_{n+1} & F_n + F_{n+1}\end{pmatrix} = \begin{pmatrix} F_n & F_{n+1}\\ F_{n+1} & F_{n+2}\end{pmatrix}.

Identity. For 2×22\times2 matrices, expanding shows det(MN)=detMdetN\det(MN) = \det M \det N; hence det(An)=(detA)n=(1)n\det(A^n) = (\det A)^n = (-1)^n, and detAn=Fn1Fn+1Fn2\det A^n = F_{n-1}F_{n+1} - F_n^2. (This is Cassini’s identity.)

Exercise 30.6 ★★

A directed graph on vertices {1,2,3}\{1, 2, 3\} has edges 121\to2, 232\to3, 313\to1 and 131\to3.

  1. Write the adjacency matrix MM and compute M2M^2 and M3M^3.
  2. How many walks of length 33 go from 11 to 11? List them.
Solution

Solution of Exercise 30.6.

1. Ordering vertices 1,2,31, 2, 3:

M=(011001100),M2=(101100011),M3=(111101101).M = \begin{pmatrix} 0&1&1\\ 0&0&1\\ 1&0&0\end{pmatrix}, \quad M^2 = \begin{pmatrix} 1&0&1\\ 1&0&0\\ 0&1&1\end{pmatrix}, \quad M^3 = \begin{pmatrix} 1&1&1\\ 1&0&1\\ 1&0&1 \end{pmatrix}.

2. (M3)11=1\bigl(M^3\bigr)_{11} = 1: exactly one closed walk of length 33 at vertex 11, namely 12311 \to 2 \to 3 \to 1. (The walk 1311 \to 3 \to 1 has length 22 only, and 131 \to 3 then 313\to1 then 131\to3 ends at 33.)

Exercise 30.7 ★★

A car-sharing company moves vehicles between two cities AA and BB. Each week, 80%80\% of the cars in AA stay in AA and 20%20\% move to BB; 30%30\% of the cars in BB move to AA and 70%70\% stay. Let an,bna_n, b_n be the proportions of the fleet in each city.

  1. Write Xn+1=MXnX_{n+1} = MX_n with Xn=(anbn)X_n = \begin{pmatrix} a_n\\ b_n\end{pmatrix} and identify MM.
  2. Find the equilibrium proportions (solve MX=XMX = X with a+b=1a + b = 1).
  3. Show that cn=an0.6c_n = a_n - 0.6 satisfies cn+1=0.5cnc_{n+1} = 0.5\,c_n, and conclude that the fleet distribution converges to the equilibrium.
Solution

Solution of Exercise 30.7.

1. an+1=0.8an+0.3bna_{n+1} = 0.8a_n + 0.3b_n, bn+1=0.2an+0.7bnb_{n+1} = 0.2a_n + 0.7b_n: M=(0.80.30.20.7)M = \begin{pmatrix} 0.8 & 0.3\\ 0.2 & 0.7\end{pmatrix}.

2. MX=XMX = X gives 0.8a+0.3b=a0.8a + 0.3b = a, i.e. 0.3b=0.2a0.3b = 0.2a, so b=23ab = \frac23 a; with a+b=1a + b = 1: a=0.6a = 0.6, b=0.4b = 0.4.

3. Using bn=1anb_n = 1 - a_n: an+1=0.8an+0.3(1an)=0.5an+0.3a_{n+1} = 0.8a_n + 0.3(1 - a_n) = 0.5a_n + 0.3, so

cn+1=an+10.6=0.5an+0.30.6=0.5(an0.6)=0.5cn.c_{n+1} = a_{n+1} - 0.6 = 0.5a_n + 0.3 - 0.6 = 0.5(a_n - 0.6) = 0.5\,c_n .

Hence cn=0.5nc00c_n = 0.5^n c_0 \to 0: an0.6a_n \to 0.6 and bn0.4b_n \to 0.4, whatever the initial distribution.

Exercise 30.8 ★★★

Let A=(3113)A = \begin{pmatrix} 3 & 1\\ 1 & 3 \end{pmatrix}, P=(1111)P = \begin{pmatrix} 1 & 1\\ 1 & -1 \end{pmatrix}.

  1. Compute P1P^{-1}, then D=P1APD = P^{-1}AP, and check that DD is diagonal.
  2. Deduce a closed formula for AnA^n and compare with Example 30.10.
Solution

Solution of Exercise 30.8.

1. detP=2\det P = -2, so P1=12(1111)=12(1111)P^{-1} = -\frac12\begin{pmatrix} -1 & -1\\ -1 & 1\end{pmatrix} = \frac12\begin{pmatrix} 1 & 1\\ 1 & -1\end{pmatrix}. Then

AP=(4242),D=P1AP=12(1111)(4242)=(4002).AP = \begin{pmatrix} 4 & 2\\ 4 & -2 \end{pmatrix}, \qquad D = P^{-1}AP = \frac12\begin{pmatrix} 1&1\\1&-1\end{pmatrix} \begin{pmatrix} 4&2\\4&-2\end{pmatrix} = \begin{pmatrix} 4 & 0\\ 0 & 2\end{pmatrix}.

2. From A=PDP1A = PDP^{-1}, an immediate induction gives An=PDnP1A^n = PD^nP^{-1} with Dn=(4n002n)D^n = \begin{pmatrix} 4^n & 0\\ 0 & 2^n\end{pmatrix}, so

An=PDnP1=(4n2n4n2n)12(1111)=12(4n+2n4n2n4n2n4n+2n).A^n = P D^n P^{-1} = \begin{pmatrix} 4^n & 2^n\\ 4^n & -2^n\end{pmatrix}\cdot \frac12\begin{pmatrix} 1&1\\1&-1\end{pmatrix} = \frac12\begin{pmatrix} 4^n + 2^n & 4^n - 2^n\\ 4^n - 2^n & 4^n + 2^n\end{pmatrix}.

Applying AnA^n to X0=(u0v0)X_0 = \begin{pmatrix} u_0\\v_0\end{pmatrix} reproduces exactly the formulas of Example 30.10.

30.5 Problem: The matrix that knows Fibonacci (and the weather)

Problem 30.1

Weekend problem — one 2×22 \times 2 matrix carries all of Fibonacci, a Markov matrix forecasts the long-run weather, and an eigenvector is worth a billion dollars

A matrix is a machine that eats a state and returns the next one — and its powers therefore hold entire futures. This problem opens with the astonishing matrix whose powers list the Fibonacci numbers (and prove their identities in one line each), then runs the weather as a Markov chain to its steady state, and closes with the eigenvector on which a search engine was built (Theorem 30.12, Method 30.9).

Part I — Fluency.

  1. With A=(1234)A = \begin{pmatrix} 1 & 2\\ 3 & 4\end{pmatrix} and B=(0110)B = \begin{pmatrix} 0 & 1\\ 1 & 0\end{pmatrix}: compute ABAB and BABA. Verdict on commutativity?
  2. Invert (2153)\begin{pmatrix} 2 & 1\\ 5 & 3\end{pmatrix} (Proposition 30.6) and use the inverse to solve 2x+y=42x + y = 4, 5x+3y=75x + 3y = 7.
  3. Let N=(0100)N = \begin{pmatrix} 0 & 1\\ 0 & 0\end{pmatrix}: compute N2N^2, and deduce (I+N)n=I+nN(I + N)^n = I + nN for every nn.
  4. The triangle graph (three vertices, all pairs joined): write its adjacency matrix AA, compute A3A^3, and interpret the diagonal entries (Theorem 30.12).
  5. For D=(20012)D = \begin{pmatrix} 2 & 0\\ 0 & \frac12 \end{pmatrix}: give DnD^n and its behavior as nn \to \infty.

Part II — The Fibonacci matrix. Let F=(1110)F = \begin{pmatrix} 1 & 1\\ 1 & 0\end{pmatrix} and let F1=F2=1,F3=2,F_1 = F_2 = 1, F_3 = 2, \dots be the Fibonacci numbers of Problem 13.1.

  1. Compute F2F^2, F3F^3, F4F^4 and conjecture the general form of FnF^n in terms of Fibonacci numbers.
  2. Prove the conjecture Fn=(Fn+1FnFnFn1)F^n = \begin{pmatrix} F_{n+1} & F_n\\ F_n & F_{n-1} \end{pmatrix} by induction.
  3. Take determinants of both sides (the determinant of a product is the product of the determinants — check it on 2×22 \times 2 matrices if you have never seen it): deduce Cassini’s identity Fn+1Fn1Fn2=(1)nF_{n+1}F_{n-1} - F_n^2 = (-1)^n — the vanishing-square engine, proved in one line.
  4. From Fm+n=FmFnF^{m+n} = F^m F^n, read off the top-right entries and derive the addition formula

    Fm+n=Fm+1Fn+FmFn1.F_{m+n} = F_{m+1} F_n + F_m F_{n-1} .

    Check it for m=n=3m = n = 3.

  5. Deduce from the addition formula (induction on kk) that FnF_n divides FknF_{kn}, and verify on F3F6F_3 \mid F_6 and F3F9F_3 \mid F_9.
  6. To compute F100F_{100}, one need not multiply 100100 matrices: square repeatedly (F2,F4,F8,F^2, F^4, F^8, \dots) and combine. How many matrix multiplications suffice, and which ancient multiplication trick from the Middle School volume is this, promoted to matrices?

Part III — The weather machine. In a certain city: after a sunny day, the next is sunny with probability 0.80.8; after a rainy day, sunny with probability 0.40.4. Encode the day’s distribution as a column (psunprain)\binom{p_{\text{sun}}}{p_{\text{rain}}} and the evolution by

M=(0.80.40.20.6).M = \begin{pmatrix} 0.8 & 0.4\\ 0.2 & 0.6 \end{pmatrix}.
  1. Check that each column of MM sums to 11, and say why any weather machine must have this property.
  2. Today is sunny. Compute the forecast for tomorrow and for the day after.
  3. Find the steady state: the distribution vv with Mv=vMv = v (and entries summing to 11). What fraction of days is sunny in the long run?
  4. Start from a rainy day, (01)\binom01, and apply MM four times, tracking the distance to the steady state at each step. By what factor does the gap shrink per step — and what kind of convergence is this?
  5. PageRank in miniature: three pages, with links ABA \to B, ACA \to C, BCB \to C, CAC \to A. A random surfer follows an outgoing link uniformly at random. Write the transition matrix, find the steady state, and rank the pages.
  6. Interpret the ranking: why does CC score as high as AA despite receiving links from fewer pages — what does the steady state actually measure? (Real PageRank adds a damping factor for dead ends and jumps; the eigenvector idea is exactly this one.)

Part IV — Diagonal dividends.

  1. Two coupled quantities obey un+1=3un+vnu_{n+1} = 3u_n + v_n, vn+1=un+3vnv_{n+1} = u_n + 3v_n, i.e. the matrix AA of Exercise 30.8. Using that exercise’s diagonalization (D=diag(4,2)D = \operatorname{diag}(4, 2)), give the closed formula for unu_n when u0=1u_0 = 1, v0=0v_0 = 0, and check it against direct computation for n=1,2,3n = 1, 2, 3.
  2. In one or two sentences: what does diagonalization do to a coupled system — and in what sense is the Markov steady state of question 14 an eigenvector story too?
  3. Finale — the matrix’s three faces this weekend: bookkeeping (systems and inverses), combinatorics (walks and links counted by powers), and evolution (Fibonacci, weather, the web — futures read off eigen-directions). One sentence each, plus the forward pointer: the university volumes’ linear algebra makes every one of these faces a theory.
Solution

Solution of Problem 30.1.

1. AB=(2143)AB = \begin{pmatrix} 2 & 1\\ 4 & 3\end{pmatrix} and BA=(3412)BA = \begin{pmatrix} 3 & 4\\ 1 & 2\end{pmatrix}: matrix multiplication is not commutative — BB swaps columns on the right, rows on the left.

2. Determinant 65=16 - 5 = 1: inverse (3152)\begin{pmatrix} 3 & -1\\ -5 & 2\end{pmatrix}. Applying it to (47)\binom{4}{7}: x=127=5x = 12 - 7 = 5, y=20+14=6y = -20 + 14 = -6.

3. N2=0N^2 = 0. Then (I+N)n=I+nN(I + N)^n = I + nN by induction: (I+nN)(I+N)=I+(n+1)N+nN2=I+(n+1)N(I + nN)(I + N) = I + (n+1)N + nN^2 = I + (n+1)N.

4. A=(011101110)A = \begin{pmatrix} 0&1&1\\ 1&0&1\\ 1&1&0 \end{pmatrix}, and A3A^3 has diagonal entries 22: from each vertex, exactly two closed walks of length 33 (the triangle walked clockwise or counterclockwise) — the counting theorem in action.

5. Dn=(2n002n)D^n = \begin{pmatrix} 2^n & 0\\ 0 & 2^{-n} \end{pmatrix}: one direction explodes, the other dies — diagonal fates are independent geometric sequences.

6. F2=(2111)F^2 = \begin{pmatrix} 2 & 1\\ 1 & 1\end{pmatrix}, F3=(3221)F^3 = \begin{pmatrix} 3 & 2\\ 2 & 1\end{pmatrix}, F4=(5332)F^4 = \begin{pmatrix} 5 & 3\\ 3 & 2\end{pmatrix}: Fibonacci everywhere; conjecture as stated.

7. If Fn=(Fn+1FnFnFn1)F^n = \begin{pmatrix} F_{n+1} & F_n\\ F_n & F_{n-1}\end{pmatrix}, then

Fn+1=FnF=(Fn+1+FnFn+1Fn+Fn1Fn)=(Fn+2Fn+1Fn+1Fn):F^{n+1} = F^n F = \begin{pmatrix} F_{n+1} + F_n & F_{n+1}\\ F_n + F_{n-1} & F_n \end{pmatrix} = \begin{pmatrix} F_{n+2} & F_{n+1}\\ F_{n+1} & F_n \end{pmatrix} :

heredity; the base case n=1n = 1 is FF itself, using the convention F0=0F_0 = 0 (which extends the recurrence backwards).

8. detF=1\det F = -1, so det(Fn)=(detF)n=(1)n\det(F^n) = (\det F)^n = (-1)^n; and directly det(Fn)=Fn+1Fn1Fn2\det(F^n) = F_{n+1}F_{n-1} - F_n^2: Cassini, one line. (The product rule for 2×22 \times 2 determinants is a pleasant five-minute expansion.)

9. Top-right of FmFnF^m F^n: Fm+1Fn+FmFn1F_{m+1}F_n + F_m F_{n-1}; top-right of Fm+nF^{m+n}: Fm+nF_{m+n}. For m=n=3m = n = 3: F4F3+F3F2=3×2+2×1=8=F6F_4 F_3 + F_3 F_2 = 3 \times 2 + 2 \times 1 = 8 = F_6.

10. For k=1k = 1: trivial. If FnFknF_n \mid F_{kn}, the addition formula with m=knm = kn: F(k+1)n=Fkn+1Fn+FknFn1F_{(k+1)n} = F_{kn+1}F_n + F_{kn}F_{n-1}: both terms are multiples of FnF_n. So FnFknF_n \mid F_{kn} for all kk: check F3=2F_3 = 2 divides F6=8F_6 = 8 and F9=34F_9 = 34.

11. F100=F64F32F4F^{100} = F^{64} F^{32} F^4: seven squarings (F2,F4,,F64F^2, F^4, \dots, F^{64}) plus two combinations — nine multiplications instead of ninety-nine. It is the doubling-table trick of the Egyptian scribes, lifted from numbers to matrices: write 100100 in binary, multiply the doublings you need.

12. 0.8+0.2=10.8 + 0.2 = 1 and 0.4+0.6=10.4 + 0.6 = 1: tomorrow must be some weather — each column is a complete probability distribution, so probabilities are conserved.

13. Tomorrow: (0.80.2)\binom{0.8}{0.2}. Day after: M(0.80.2)=(0.720.28)M\binom{0.8}{0.2} = \binom{0.72}{0.28}.

14. Mv=vMv = v with v=(sr)v = \binom{s}{r}, s+r=1s + r = 1: 0.8s+0.4r=s0.8s + 0.4r = s gives 0.4r=0.2s0.4r = 0.2s, s=2rs = 2r: v=(2/31/3)v = \binom{2/3}{1/3}. In the long run, two days in three are sunny — whatever today looks like.

15. From (01)\binom01: sunny components 0.40.4, 0.560.56, 0.6240.624, 0.64960.6496; gaps to 23\frac23: 0.2670.267, 0.1070.107, 0.0430.043, 0.0170.017 — each step multiplies the gap by exactly 0.40.4 (the machine’s second eigenvalue): geometric convergence to the steady state.

16. Columns (from AA, BB, CC): P=(00112001210)P = \begin{pmatrix} 0 & 0 & 1\\ \frac12 & 0 & 0\\ \frac12 & 1 & 0\end{pmatrix}. Steady state: vA=vCv_A = v_C, vB=vA2v_B = \frac{v_A}{2}, vC=vA2+vBv_C = \frac{v_A}{2} + v_B; summing to 11: v=(25,15,25)v = \left(\frac25, \frac15, \frac25\right). Ranking: AA and CC tie for first, BB last.

17. CC receives all of BB’s traffic and half of AA’s, and it funnels everything back to AA: the steady state measures where the surfer spends time, not how many links point in — one link from a popular page outweighs several from deserted ones. That recursive weighting is precisely Google’s founding idea; damping handles spider traps and dead ends.

18. An=PDnP1A^n = P D^n P^{-1} gives un=4n+2n2u_n = \frac{4^n + 2^n}{2} (and vn=4n2n2v_n = \frac{4^n - 2^n}{2}). Check: u1=3u_1 = 3, u2=10u_2 = 10, u3=36u_3 = 36; directly: (1,0)(3,1)(10,6)(36,28)(1,0) \to (3,1) \to (10,6) \to (36, 28): matching.

19. Diagonalization changes to coordinates in which the coupled system falls apart into independent geometric sequences — each eigenvalue runs its own race. The Markov steady state is the eigenvector of eigenvalue 11, and the convergence rate of question 15 is the next eigenvalue: the weather machine was an eigen-story all along.

20. Bookkeeping: a system is one matrix equation, solved by one inverse. Combinatorics: powers of the adjacency matrix count walks, links, connections. Evolution: powers of the machine carry states to their destinies, and the eigen-directions (Fibonacci’s golden direction, the weather’s steady state, the web’s ranking vector) are the destinies. Linear algebra, in the university volumes, is the science of exactly this.