101 Best Linear Algebra Problems and Solutions: From Eigenvalues to Vector Spaces
101 linear algebra problems with full solutions and checks, from vectors and Gaussian elimination to determinants, eigenvalues, least squares and SVD.
By BlogAI Editors · · 21 min read
Linear algebra is learned by doing. Definitions of span, rank and eigenvalues only start to make sense after you have row-reduced a few matrices and watched a vector refuse to change direction. This article collects 101 problems in the order a first course usually covers them: vectors, linear combinations, matrix arithmetic, systems of equations, determinants, inverses, vector spaces, linear transformations, eigenvalues, and finally orthogonality, least squares and the singular value decomposition.
Every problem has a full solution and, where it helps, a check you can do in a few seconds to catch arithmetic slips. Every answer was recomputed with SymPy (exact arithmetic) before publication. Try each problem before opening the solution; the gap between "I follow the solution" and "I can produce it" is where the learning happens.
Notation. Vectors are columns, written in parentheses in running text, such as v=(1,2,3). AT is the transpose, A−1 the inverse, detA the determinant and I the identity matrix.
Vectors
1. Linear combination of vectors
Problem: For u=(2,−1,3) and v=(1,4,−2), compute 3u−2v.
Show solution
Scale, then subtract component by component:
3u−2v=(6,−3,9)−(2,8,−4)=(4,−11,13)
Check: the first components give 3⋅2−2⋅1=4.
2. Length of a vector
Problem: Find ∥(3,4,12)∥.
Show solution∥(3,4,12)∥=9+16+144=169=13
3. Unit vector
Problem: Find the unit vector in the direction of (1,2,2).
Show solution
The length is 1+4+4=3, so the unit vector is (31,32,32).
Check:91+94+94=1.
4. Dot product
Problem: Compute (1,2,3)⋅(4,−5,6).
Show solution1⋅4+2⋅(−5)+3⋅6=4−10+18=12
5. Angle between two vectors
Problem: Find the angle between (1,0,1) and (0,1,1).
Show solutioncosθ=∥a∥∥b∥a⋅b=221=21⟹θ=60∘
6. Testing orthogonality
Problem: Are (2,−1,3) and (1,5,1) orthogonal?
Show solution
2−5+3=0. The dot product is zero, so yes, they are orthogonal.
7. Choosing a parameter for orthogonality
Problem: For which k are (k,2,−1) and (3,k,4) orthogonal?
Show solution3k+2k−4=0⟹k=54
Check:3(0.8)+2(0.8)−4=2.4+1.6−4=0.
8. Cross product
Problem: Compute (1,2,3)×(4,5,6).
Show solution(2⋅6−3⋅5,3⋅4−1⋅6,1⋅5−2⋅4)=(−3,6,−3)
Check: the result must be orthogonal to both inputs: −3+12−9=0 and −12+30−18=0.
9. Area of a triangle in space
Problem: Find the area of the triangle with vertices P(1,0,0), Q(0,2,0) and R(0,0,3).
Show solution
PQ=(−1,2,0) and PR=(−1,0,3). Their cross product is (6,3,2), whose length is 36+9+4=7. The triangle is half the parallelogram, so the area is 27=3.5.
10. Projection of one vector onto another
Problem: Project b=(1,3) onto the line through a=(3,1), and find the error vector.
Show solutionp=a⋅aa⋅ba=106(3,1)=(1.8,0.6),e=b−p=(−0.8,2.4)
Check:e⋅a=−2.4+2.4=0, so the error is perpendicular to the line, as it must be.
Problem 10: the projection p is the point on the line closest to b, so the error b − p is perpendicular to a.
11. Cauchy–Schwarz inequality
Problem: Verify ∣u⋅v∣≤∥u∥∥v∥ for u=(1,2) and v=(3,4).
Show solution
u⋅v=11, and ∥u∥∥v∥=5⋅5≈11.18. Since 11≤11.18, the inequality holds. Equality would require the vectors to be parallel.
12. Distance from a point to a plane
Problem: Find the distance from (1,2,3) to the plane 2x−y+2z=10.
Show solutiond=22+(−1)2+22∣2(1)−2+2(3)−10∣=3∣−4∣=34
Linear combinations, span and independence
13. Writing a vector as a combination
Problem: Write (7,8) as a combination of (1,2) and (3,1).
Show solution
Solve c1+3c2=7 and 2c1+c2=8. From the second, c2=8−2c1; substituting gives c1+24−6c1=7, so c1=517 and c2=56.
Check:517+518=7 and 534+56=8.
14. Membership in a span
Problem: Is (1,2,3) in the span of (1,0,1) and (0,1,1)?
Show solution
From the first two components, c1=1 and c2=2. The third component must then be c1+c2=3, which matches. Yes: (1,2,3)=1(1,0,1)+2(0,1,1).
15. Testing independence with a determinant
Problem: Are (1,1,0), (0,1,1) and (1,0,1) linearly independent?
Show solution
Put them in the columns of a matrix and take the determinant:
det110011101=1(1−0)−0+1(1−0)=2=0
The determinant is nonzero, so the vectors are independent and form a basis of R3.
16. Finding a dependence relation
Problem: Show that (1,2,3), (4,5,6) and (7,8,9) are dependent by finding a relation.
Show solution
The vectors step by the same amount, (3,3,3), so the middle one is the average of the other two: v1−2v2+v3=0.
Check:(1−8+7,2−10+8,3−12+9)=(0,0,0).
17. Too many vectors
Problem: Explain why (1,0,0), (0,1,0), (0,0,1) and (1,2,3) must be dependent, and find the relation.
Show solution
Any set of more than n vectors in Rn is dependent, because a matrix with more columns than rows has a free column. Here (1,2,3)=1e1+2e2+3e3.
18. Parameter that causes dependence
Problem: For which k are (1,k) and (k,4) dependent?
Show solution
det[1kk4]=4−k2=0, so k=2 or k=−2.
Check: with k=2, (2,4)=2(1,2).
19. Describing a span geometrically
Problem: Describe the span of (1,2) in R2.
Show solution
All multiples t(1,2)=(t,2t): the line y=2x through the origin.
20. Spanning the plane
Problem: Show that (1,1) and (1,−1) span R2, and write (5,3) in terms of them.
Show solution
det[111−1]=−2=0, so they span the plane. Solving c1+c2=5 and c1−c2=3 gives c1=4 and c2=1.
21. Equation of a plane spanned by two vectors
Problem: Find the equation of the plane through the origin spanned by (1,0,2) and (0,1,−1).
Show solution
A normal vector is the cross product: (1,0,2)×(0,1,−1)=(−2,1,1). The plane is −2x+y+z=0.
Write their coefficients (constant, x, x2) as columns:
100110111
The matrix is triangular with nonzero diagonal, so its determinant is 1 and the polynomials are independent. They form a basis of the polynomials of degree at most 2.
Matrix operations
23. Matrix multiplication is not commutative
Problem: For A=[1324] and B=[0110], compute AB and BA.
Show solutionAB=[2413],BA=[3142]
Multiplying by B on the right swaps the columns of A; on the left it swaps the rows. AB=BA.
24. Matrix times vector
Problem: Compute [10012−1]312 and state the shapes.
Show solution
A 2×3 matrix times a 3×1 vector gives a 2×1 vector:
[3+0+40+1−2]=[7−1]
25. Transpose of a product
Problem: Using A and B from problem 23, verify (AB)T=BTAT.
Show solution
(AB)T=[2143]. Since BT=B, BTAT=[0110][1234]=[2143]. They match. The order reverses.
26. Powers of a matrix
Problem: Find A5 for A=[1011].
Show solution
A2=[1021], and each further multiplication adds 1 to the top-right entry, so An=[10n1] and A5=[1051]. (Prove the pattern by induction: AnA adds the top-left 1 to the top-right entry.)
27. Trace of a product
Problem: With A and B from problem 23, verify tr(AB)=tr(BA).
Show solution
tr(AB)=2+3=5 and tr(BA)=3+2=5. The products differ but their traces agree, which is true for any compatible square products.
28. Symmetric plus skew-symmetric
Problem: Write A=[1243] as a symmetric matrix plus a skew-symmetric matrix.
Show solutionS=21(A+AT)=[1333],K=21(A−AT)=[0−110]
Check:S+K=A, ST=S and KT=−K.
29. A nilpotent matrix
Problem: For N=000100010, compute N2 and N3.
Show solution
Each multiplication shifts the ones one place further up and to the right:
N2=000000100,N3=0
All eigenvalues of a nilpotent matrix are 0.
30. Matrix-vector product as a combination of columns
Problem: Compute [1324][56] as a combination of columns.
Show solution5[13]+6[24]=[1739]
This "column picture" is why Ax=b is solvable exactly when b is in the column space of A.
31. Outer product
Problem: Compute uvT for u=(1,2) and v=(3,4,5), and give its rank.
Show solutionuvT=[3648510]
The second row is twice the first, so the rank is 1. Every nonzero outer product has rank 1.
32. Rotation matrix
Problem: Rotate (3,4) by 90∘ counterclockwise.
Show solutionR90∘=[01−10],R90∘[34]=[−43]
Check: the length is still 5, and (3,4)⋅(−4,3)=0.
33. Projection matrix
Problem: Find the matrix that projects onto the line through (1,1) and verify P2=P.
Show solutionP=aTaaaT=21[1111]
P2=41[2222]=P. Projecting twice is the same as projecting once.
34. Reflection matrix
Problem: Find the matrix that reflects across the line y=x and apply it to (2,5).
Show solution
The reflection swaps coordinates: [0110], giving (5,2). Applying it twice returns the original vector, so the matrix is its own inverse.
Systems of linear equations
35. A 2 × 2 system
Problem: Solve x+y=4 and x−y=2.
Show solution
Adding the equations gives 2x=6, so x=3 and y=1.
Problems 35, 37 and 38: two equations in two unknowns can meet once, never or everywhere.
36. A 3 × 3 system by elimination
Problem: Solve x+y+z=6, 2x−y+z=3, x+2y−z=2.
Show solution
Subtract twice row 1 from row 2, and row 1 from row 3:
−3y−z=−9,y−2z=−4
From the second, y=2z−4. Substituting: −3(2z−4)−z=−9, so −7z=−21 and z=3. Then y=2 and x=1.
Check:1+2+3=6, 2−2+3=3, 1+4−3=2.
37. An inconsistent system
Problem: Solve x+2y=3 and 2x+4y=7.
Show solution
Subtracting twice the first equation from the second gives 0=1, which is impossible. There is no solution: the lines are parallel.
38. Infinitely many solutions
Problem: Solve x+y+z=3 and x−y+z=1.
Show solution
Subtracting gives 2y=2, so y=1 and x+z=2. Let z=t be free:
(x,y,z)=(2−t,1,t),t∈R
The solution set is a line: two planes in R3 that are not parallel meet in a line.
39. Reduced row echelon form
Problem: Solve x+2y−z=3, 2x+4y+z=9, x+2y+2z=6 using RREF.
Show solution121242−112396⟶100200010410
Pivots are in columns 1 and 3, so y is free. With y=t: (x,y,z)=(4−2t,t,1).
40. A homogeneous system
Problem: Find all solutions of Ax=0 for A=[122436].
Show solution
Row 2 is twice row 1, so only x+2y+3z=0 remains. With y=s and z=t free:
x=s(−2,1,0)+t(−3,0,1)
The null space is a plane with basis (−2,1,0) and (−3,0,1).
41. When does a system have a unique solution?
Problem: For which k does x+y=1, 2x+ky=3 have exactly one solution?
Show solution
The coefficient determinant is k−2. For k=2 there is exactly one solution. For k=2 the second equation says 2x+2y=3, while the first implies 2x+2y=2, so there is no solution.
42. Cramer's rule for a 3 × 3 system
Problem: Use Cramer's rule to find x in problem 36.
Show solutiondetA=det1211−1211−1=1(1−2)−1(−2−1)+1(4+1)=7
Replace column 1 with the right-hand side (6,3,2):
detAx=6(1−2)−1(−3−2)+1(6+2)=7,x=77=1
This matches problem 36. Cramer's rule is useful for theory and tiny systems; elimination is far cheaper for anything larger.
43. LU decomposition of a 2 × 2 matrix
Problem: Factor A=[2618] as LU.
Show solution
The multiplier for row 2 is 6/2=3; subtracting 3× row 1 leaves (0,5):
A=[1301][2015]
44. LU decomposition of a 3 × 3 matrix
Problem: Factor A=248137139 as LU.
Show solution
Multipliers 2 and 4 clear column 1, leaving rows (0,1,1) and (0,3,5). Multiplier 3 then clears column 2, leaving (0,0,2):
L=124013001,U=200110112
Check:detA=2⋅1⋅2=4, the product of the pivots.
45. Why pivoting matters
Problem: Solve 0.0001x+y=1, x+y=2, and explain what goes wrong without row swaps in low-precision arithmetic.
Show solution
Exactly: y=2−x, so 0.0001x+2−x=1, giving x=0.99991≈1.0001 and y≈0.9999.
Without a swap, the multiplier is 10000, and row 2 becomes −9999y=−9998. With three significant digits both numbers round to about −10000, so y=1, and back-substitution gives 0.0001x=0, so x=0, which is badly wrong. Swapping rows first (partial pivoting) uses the multiplier 0.0001 and gives x≈1, y≈1 even at low precision.
46. Balancing a chemical equation
Problem: Balance aC3H8+bO2→cCO2+dH2O.
Show solution
Atom counts give a homogeneous system: carbon 3a=c, hydrogen 8a=2d, oxygen 2b=2c+d. Setting a=1: c=3, d=4, b=26+4=5.
C3H8+5O2→3CO2+4H2O
Determinants
47. Determinant as area
Problem: Find det[3012] and interpret it.
Show solution
3⋅2−1⋅0=6. The matrix sends the unit square to the parallelogram spanned by its columns (3,0) and (1,2), which has area 6.
Problem 47: the absolute value of the determinant is the factor by which the matrix scales area.
48. A 3 × 3 determinant by cofactors
Problem: Compute det211031124.
Show solution
Expand along row 1 (the zero saves work):
2(3⋅4−2⋅1)−0+1(1⋅1−3⋅1)=2(10)+(−2)=18
49. Determinant of a triangular matrix
Problem: Compute det300520794.
Show solution
For a triangular matrix the determinant is the product of the diagonal: 3⋅2⋅4=24.
50. Effect of scaling a matrix
Problem: If A is 3×3 with detA=5, find det(2A).
Show solution
Multiplying the matrix by 2 multiplies each of the 3 rows by 2, and each row scaling multiplies the determinant by 2: det(2A)=23⋅5=40.
51. Product and inverse rules
Problem: If detA=3 and detB=−2 for n×n matrices, find det(AB), det(A−1B2) and det(AT).
This is a Vandermonde matrix with nodes 1,2,3, whose determinant is the product of all differences xj−xi with i<j:
(2−1)(3−1)(3−2)=2
Because it is nonzero, exactly one parabola passes through any three points with x=1,2,3.
54. Volume of a parallelepiped
Problem: Find the volume of the box spanned by (1,0,0), (1,2,0) and (1,1,3).
Show solutiondet100120113=1⋅2⋅3=6
The volume is ∣6∣=6.
55. A 4 × 4 determinant by elimination
Problem: Compute det1021210103111012.
Show solution
Adding multiples of one row to another does not change the determinant. Clear column 1 (row 3 minus 2× row 1, row 4 minus row 1), then column 2 using row 2:
Finally row 4 minus 134 row 3 leaves 1+134=1317 in the corner. The determinant is 1⋅1⋅13⋅1317=17.
Matrix inverses
56. Inverse of a 2 × 2 matrix
Problem: Invert A=[4276].
Show solution
detA=24−14=10. Swap the diagonal, negate the off-diagonal and divide by the determinant:
A−1=101[6−2−74]
Check: the top-left entry of AA−1 is 1024−14=1.
57. Inverse of a 3 × 3 matrix by Gauss–Jordan
Problem: Invert A=105216340.
Show solution
Row-reduce [A∣I] until the left block is I. The determinant is 1(0−24)−2(0−20)+3(0−5)=1, so the inverse has integer entries:
A−1=−2420−518−1545−41
Check: row 1 of A times column 1 of A−1: −24+40−15=1.
58. Solving a system with an inverse
Problem: Solve 4x+7y=1, 2x+6y=2 using problem 56.
Show solutionx=A−1b=101[6−14−2+8]=[−0.80.6]
Check:4(−0.8)+7(0.6)=1 and 2(−0.8)+6(0.6)=2. In software, call a solver (such as numpy.linalg.solve) rather than forming the inverse; it is faster and more accurate.
59. Inverse of a product
Problem: Show that (AB)−1=B−1A−1.
Show solution
(AB)(B−1A−1)=A(BB−1)A−1=AIA−1=I. The order reverses, like taking off socks and shoes.
60. Inverse of an orthogonal matrix
Problem: Find the inverse of the rotation R=[cosθsinθ−sinθcosθ].
Show solution
Its columns are orthonormal, so R−1=RT=[cosθ−sinθsinθcosθ], which is rotation by −θ.
61. A matrix with no inverse
Problem: Show that [2142] is not invertible in two ways.
Show solution
The determinant is 4−4=0. Also, (2,−1) is a nonzero vector in the null space: 2⋅2+4⋅(−1)=0 and 2−2=0. A matrix that sends a nonzero vector to zero cannot be undone.
62. Sherman–Morrison formula
Problem: Use (I+uvT)−1=I−1+vTuuvT with u=(1,0) and v=(1,1).
Show solution
I+uvT=[2011] and vTu=1, so
(I+uvT)−1=I−21[1010]=[0.50−0.51]
Check: the 2 × 2 formula gives 21[10−12], the same matrix. The formula lets software update an inverse after a rank-one change without starting over.
Vector spaces and subspaces
63. Is it a subspace?
Problem: Which of these are subspaces of R2: the line y=2x, the line y=2x+1?
Show solution
y=2x is a subspace: it contains 0 and is closed under addition and scaling. y=2x+1 is not, because it does not contain (0,0).
64. Symmetric matrices as a subspace
Problem: Show that the 2×2 symmetric matrices form a subspace and find its dimension.
Show solution
Sums and multiples of symmetric matrices are symmetric, and the zero matrix is symmetric. Every such matrix is
[abbc]=a[1000]+b[0110]+c[0001]
These three matrices form a basis, so the dimension is 3.
65. Coordinates in a non-standard basis
Problem: Find the coordinates of p(x)=3−2x+5x2 in the basis {1,1+x,1+x+x2}.
Show solution
Write p=a+b(1+x)+c(1+x+x2) and match coefficients from the highest power down: x2: c=5; x: b+c=−2, so b=−7; constant: a+b+c=3, so a=5. Coordinates: (5,−7,5).
Check:5−7(1+x)+5(1+x+x2)=3−2x+5x2.
66. Rank of a matrix
Problem: Find the rank of A=121240361.
Show solution
Row 2 is twice row 1. Rows 1 and 3 are not multiples of each other. Elimination leaves two nonzero rows, so the rank is 2.
67. Basis for a null space
Problem: Find the null space of 147258369.
Show solution
Elimination gives x−z=0 and y+2z=0. With z=t: x=t(1,−2,1), so the columns satisfy c1−2c2+c3=0. Problem 16 found the same coefficients for the rows.
68. Rank–nullity theorem
Problem: A 3×5 matrix has rank 2. What is the dimension of its null space?
Show solution
rank+nullity=number of columns, so the nullity is 5−2=3.
69. The four fundamental subspaces
Problem: Find bases for the four fundamental subspaces of A=[1224].
Show solution
Column space: multiples of (1,2).
Null space: x+2y=0, so multiples of (−2,1).
Row space: multiples of (1,2) (the matrix is symmetric).
Left null space (null space of AT): multiples of (−2,1).
Check: the row space is perpendicular to the null space: (1,2)⋅(−2,1)=0.
70. Change of basis
Problem: Find the coordinates of (4,3) in the basis {(2,1),(1,1)}.
Show solution
Solve 2a+b=4 and a+b=3: subtracting gives a=1, then b=2. Coordinates: (1,2). Equivalently, multiply by P−1 where P=[2111] has the basis vectors as columns.
71. Dimension of a solution space
Problem: What is the dimension of the subspace x+y+z+w=0 in R4?
Show solution
One equation of rank 1 on 4 unknowns leaves 4−1=3 free variables. A basis is (−1,1,0,0), (−1,0,1,0), (−1,0,0,1).
72. Intersection of two subspaces
Problem: Find the intersection of the planes x+y+z=0 and x−y=0.
Show solution
From the second, y=x; then z=−2x. The intersection is the line spanned by (1,1,−2).
Linear transformations
73. Is the map linear?
Problem: Which is linear: T1(x,y)=(x+y,2x) or T2(x,y)=(x+1,y)?
Show solution
T1 is linear: it is multiplication by [1210]. T2 is not, because T2(0,0)=(1,0)=(0,0); a linear map must send zero to zero.
74. Matrix of a transformation
Problem: Find the matrix of T(x,y,z)=(x+2y,3z−y).
Show solution
The columns are the images of the standard basis vectors: T(e1)=(1,0), T(e2)=(2,−1), T(e3)=(0,3).
[102−103]
75. Rotation by 30 degrees
Problem: Rotate (1,0) by 30∘.
Show solution[cos30∘sin30∘−sin30∘cos30∘][10]=[3/21/2]
76. Composing transformations
Problem: Rotate by 90∘, then reflect across the x-axis. What single transformation is this?
Show solution
The matrix of "first R, then F" is FR:
FR=[100−1][01−10]=[0−1−10]
This sends (x,y) to (−y,−x): reflection across the line y=−x.
77. Kernel and image
Problem: Find the kernel and image of T(x,y,z)=(x−y,y−z).
Show solution
The kernel needs x=y=z: the line spanned by (1,1,1). The rank is 3−1=2, so the image is all of R2.
78. A shear preserves area
Problem: Show that the shear [10k1] preserves area for every k.
Show solution
Its determinant is 1⋅1−k⋅0=1, so areas are multiplied by 1. A shear slides layers past each other, like pushing a deck of cards sideways.
79. Differentiation as a matrix
Problem: Find the matrix of D=dxd on polynomials of degree at most 2, in the basis {1,x,x2}.
Show solution
D(1)=0, D(x)=1, D(x2)=2x. These images, written in coordinates, are the columns:
D=000100020
Check:3−2x+5x2 has coordinates (3,−2,5), and D sends them to (−2,10,0), which is −2+10x.
80. A matrix in a better basis
Problem: Write A=[2112] in the basis {(1,1),(1,−1)}.
Show solution
A(1,1)=(3,3)=3(1,1) and A(1,−1)=(1,−1). In this basis the transformation is simply [3001]: stretch by 3 along (1,1), leave (1,−1) alone. This is what diagonalization means (problem 87).
Eigenvalues and eigenvectors
81. Eigenvalues of a symmetric 2 × 2 matrix
Problem: Find the eigenvalues and eigenvectors of A=[2112].
Show solutiondet(A−λI)=(2−λ)2−1=0⟹λ=3 or λ=1
For λ=3: (A−3I)x=0 gives x=(1,1). For λ=1: x=(1,−1).
Check:3+1=4=trA and 3⋅1=3=detA.
Problem 81: eigenvectors are the directions that A only stretches. The ellipse's axes lie along them, with half-lengths equal to the eigenvalues 3 and 1.
82. Eigenvalues of a non-symmetric matrix
Problem: Find the eigenvalues and eigenvectors of A=[4213].
Show solutionλ2−7λ+10=0⟹λ=5 or λ=2
For λ=5: A−5I=[−121−2], so x=(1,1). For λ=2: A−2I=[2211], so x=(1,−2).
Check:A(1,−2)=(2,−4)=2(1,−2).
83. Eigenvalues of a triangular matrix
Problem: Find the eigenvalues of 3007−20−156.
Show solution
det(A−λI) is the product of the diagonal entries (3−λ)(−2−λ)(6−λ), so the eigenvalues are 3, −2 and 6.
84. Using trace and determinant
Problem: A 2×2 matrix has trace 10 and determinant 21. Find its eigenvalues.
Show solution
They are the roots of λ2−10λ+21=0: λ=3 and λ=7. Their sum is the trace and their product is the determinant.
85. Eigenvalues of a block matrix
Problem: Find the eigenvalues of 200034049.
Show solution
The matrix is block diagonal, so its eigenvalues are 2 together with those of [3449]: λ2−12λ+11=0, so λ=11 and λ=1. The eigenvalues are 2, 11 and 1.
86. Complex eigenvalues of a rotation
Problem: Find the eigenvalues of [01−10].
Show solution
λ2+1=0, so λ=±i. No real vector keeps its direction under a 90∘ rotation, which is why the eigenvalues are not real.
87. Diagonalization
Problem: Diagonalize A=[4213] from problem 82.
Show solution
Put the eigenvectors in the columns of P and the eigenvalues on the diagonal of D:
A=PDP−1,P=[111−2],D=[5002]
Check:AP=[552−4]=PD.
88. Fibonacci numbers from matrix powers
Problem: Use F=[1110] to find the 10th Fibonacci number.
Show solution
Fn=[Fn+1FnFnFn−1], and
F10=[89555534]
so F10=55. The eigenvalues of F are φ=21+5 and ψ=21−5, which gives Binet's formula Fn=5φn−ψn.
89. A matrix that cannot be diagonalized
Problem: Show that [1011] is not diagonalizable.
Show solution
The only eigenvalue is λ=1 (repeated). A−I=[0010] has a one-dimensional null space spanned by (1,0). Two independent eigenvectors are needed to diagonalize a 2×2 matrix, and there is only one.
90. Steady state of a Markov chain
Problem: Each day 90% of customers of shop A stay and 10% switch to B; B keeps 50% and loses 50% to A. Find the long-run market shares.
Show solution
With column-stochastic matrix P=[0.90.10.50.5], the steady state is the eigenvector with λ=1: Ps=s. The first row gives 0.9a+0.5b=a, so 0.1a=0.5b and a=5b. Normalizing, s=(65,61).
Check:0.9⋅65+0.5⋅61=64.5+0.5=65.
91. Cayley–Hamilton theorem
Problem: Use Cayley–Hamilton to find the inverse of A=[1324].
Show solution
The characteristic polynomial is λ2−5λ−2, and every matrix satisfies its own: A2−5A−2I=0. Multiply by A−1: A−5I=2A−1, so
A−1=21(A−5I)=[−21.51−0.5]
This matches the 2 × 2 formula, −21[4−3−21].
92. Solving a system of differential equations
Problem: Solve x′(t)=Ax(t) with A=[4213].
Show solution
Each eigenpair from problem 82 gives a solution eλtv:
x(t)=c1e5t[11]+c2e2t[1−2]
The constants come from the initial condition. As t grows, the e5t term dominates, so solutions line up with (1,1).
Orthogonality, least squares and decompositions
93. Gram–Schmidt process
Problem: Orthonormalize a1=(1,1,0) and a2=(1,0,1).
Show solution
q1=21(1,1,0). Remove from a2 its component along q1:
a2−(q1⋅a2)q1=(1,0,1)−21(1,1,0)=(21,−21,1)
Its length is 3/2, so q2=61(1,−1,2).
Check:q1⋅q2=121−1+0=0.
94. QR decomposition
Problem: Factor A=110101 as QR.
Show solution
The columns of A are the vectors from problem 93, so Q=[q1q2]. R records the dot products and lengths from Gram–Schmidt:
R=[201/23/2]
Check: the first column of QR is 2q1=(1,1,0).
95. Least squares line of best fit
Problem: Fit y=c+mx to the points (0,1), (1,3), (2,4), (3,4).
Show solution
The system Ax=b has no exact solution, so solve the normal equations ATAx^=ATb:
A=11110123,ATA=[46614],ATb=[1223]
Solving gives c=1.5 and m=1: the line y=1.5+x.
Check: the residuals are −0.5,0.5,0.5,−0.5. They sum to zero and are orthogonal to the x values: 0+0.5+1−1.5=0.
Problem 95: least squares chooses the line that minimizes the sum of the squared vertical distances.
96. Projection onto a column space
Problem: Using problem 95, find the projection of b=(1,3,4,4) onto the column space of A.
Show solution
The projection is Ax^=(1.5,2.5,3.5,4.5): the fitted values. The error b−Ax^=(−0.5,0.5,0.5,−0.5) is perpendicular to both columns of A, which is exactly what the normal equations say.
97. Orthogonal diagonalization of a symmetric matrix
Problem: Write A=[2112] as QΛQT.
Show solution
Normalize the eigenvectors from problem 81:
Q=21[111−1],Λ=[3001]
By the spectral theorem every real symmetric matrix has real eigenvalues and orthonormal eigenvectors, so Q−1=QT.
98. Testing positive definiteness
Problem: Is A=[2−1−12] positive definite?
Show solution
Three equivalent tests all say yes:
Eigenvalues: λ2−4λ+3=0 gives 1 and 3, both positive.
Leading minors: 2>0 and detA=3>0.
Energy: xTAx=2x2−2xy+2y2=x2+y2+(x−y)2>0 for every nonzero (x,y).
99. Singular value decomposition
Problem: Find the singular values of A=[3405] and the singular vectors.
Show solutionATA=[25202025]
has eigenvalues 45 and 5 with eigenvectors v1=21(1,1) and v2=21(1,−1). The singular values are σ1=45=35 and σ2=5. The left singular vectors are ui=Avi/σi:
u1=101(1,3),u2=101(3,−1)
Check:σ1σ2=15=∣detA∣.
100. Best rank-one approximation
Problem: Find the best rank-one approximation to A from problem 99 and its error.
Show solution
Keep only the largest singular value (Eckart–Young theorem):
A1=σ1u1v1T=23[1313]=[1.54.51.54.5]
The error A−A1=[1.5−0.5−1.50.5] has Frobenius norm 2.25+2.25+0.25+0.25=5=σ2. The same idea compresses images and powers principal component analysis.
101. Condition number
Problem: Find the condition number of A from problem 99, and explain why B=[1111.0001] is dangerous to solve with.
Show solution
κ(A)=σ1/σ2=35/5=3: well-conditioned. For B, κ(B)≈40002. A relative error in the data can be amplified by up to that factor in the solution, so about 4 to 5 significant digits can be lost. Change the right-hand side from (2,2) to (2,2.0001) and the solution jumps from (2,0) to (1,1).
Common mistakes
Treating matrix multiplication as commutative.AB=BA in general (problem 23), and (AB)−1=B−1A−1, not A−1B−1.
Forgetting that a subspace must contain zero. A line or plane that misses the origin is not a subspace (problem 63).
Assuming det(A+B)=detA+detB. Only products split: det(AB)=detAdetB. And det(kA)=kndetA, not kdetA (problem 50).
Counting rows instead of pivots. Rank is the number of pivots after elimination, not the number of rows (problem 66).
Expecting every matrix to be diagonalizable. A repeated eigenvalue can come with too few eigenvectors (problem 89).
Forming A−1 to solve Ax=b. Elimination or a library solver is faster and more stable (problem 58), and an ill-conditioned matrix loses accuracy either way (problem 101).
Mixing up which side the eigenvector goes on.Av=λv uses column vectors on the right. In row-vector code such as xP for Markov chains, the steady state is a left eigenvector.