Skip to main content

MATH 345: Linear Algebra and Optimization

Section 2.7 Exercises

Exercise tags. The tags below identify the primary outcomes and competency types for each exercise group. Individual problems may also involve earlier outcomes.

Subsection Systems, geometry, and row reduction

Primary outcomes. U2-LO1, U2-LO2. Competencies. P+R.
  • Nicholson 1.1.19
     1 
    math.libretexts.org/Bookshelves/Linear_Algebra/Linear_Algebra_with_Applications_(Nicholson)/01%3A_Systems_of_Linear_Equations/1.01%3A_Solutions_and_Elementary_Operations/1.1E%3A_Exercises_for_Section_1.1
  • Nicholson 1.2.1(b,d)
     2 
    math.libretexts.org/Bookshelves/Linear_Algebra/Linear_Algebra_with_Applications_(Nicholson)/01%3A_Systems_of_Linear_Equations/1.02%3A_Gaussian_Elimination/1.2E%3A_Solutions_and_Elementary_Operations_Exercises
  • Nicholson 1.2.3(b)
     3 
    math.libretexts.org/Bookshelves/Linear_Algebra/Linear_Algebra_with_Applications_(Nicholson)/01%3A_Systems_of_Linear_Equations/1.02%3A_Gaussian_Elimination/1.2E%3A_Solutions_and_Elementary_Operations_Exercises
  • Nicholson 1.2.5(b,d)
     4 
    math.libretexts.org/Bookshelves/Linear_Algebra/Linear_Algebra_with_Applications_(Nicholson)/01%3A_Systems_of_Linear_Equations/1.02%3A_Gaussian_Elimination/1.2E%3A_Solutions_and_Elementary_Operations_Exercises
  • Nicholson 1.2.8(b)
     5 
    math.libretexts.org/Bookshelves/Linear_Algebra/Linear_Algebra_with_Applications_(Nicholson)/01%3A_Systems_of_Linear_Equations/1.02%3A_Gaussian_Elimination/1.2E%3A_Solutions_and_Elementary_Operations_Exercises
  • Nicholson 1.2.10(b,d)
     6 
    math.libretexts.org/Bookshelves/Linear_Algebra/Linear_Algebra_with_Applications_(Nicholson)/01%3A_Systems_of_Linear_Equations/1.02%3A_Gaussian_Elimination/1.2E%3A_Solutions_and_Elementary_Operations_Exercises
  • Nicholson 1.2.18
     7 
    math.libretexts.org/Bookshelves/Linear_Algebra/Linear_Algebra_with_Applications_(Nicholson)/01%3A_Systems_of_Linear_Equations/1.02%3A_Gaussian_Elimination/1.2E%3A_Solutions_and_Elementary_Operations_Exercises
  • Nicholson 1.3.3(b)
     8 
    math.libretexts.org/Bookshelves/Linear_Algebra/Linear_Algebra_with_Applications_(Nicholson)/01%3A_Systems_of_Linear_Equations/1.03%3A_Homogeneous_Equations/1.3E%3A_Homogeneous_Equations
  • Nicholson 1.3.5(b)
     9 
    math.libretexts.org/Bookshelves/Linear_Algebra/Linear_Algebra_with_Applications_(Nicholson)/01%3A_Systems_of_Linear_Equations/1.03%3A_Homogeneous_Equations/1.3E%3A_Homogeneous_Equations
  • Nicholson 1.3.7(b,d)
     10 
    math.libretexts.org/Bookshelves/Linear_Algebra/Linear_Algebra_with_Applications_(Nicholson)/01%3A_Systems_of_Linear_Equations/1.03%3A_Homogeneous_Equations/1.3E%3A_Homogeneous_Equations

Subsection Subspaces

Primary outcomes. U2-LO3, U2-LO4. Competencies. P+C+J.
  • Nicholson 5.1.1(d,f)
     11 
    math.libretexts.org/Bookshelves/Linear_Algebra/Linear_Algebra_with_Applications_(Nicholson)/05%3A_Vector_Space_R/5.01%3A_Subspaces_and_Spanning/5.1E%3A_Subspaces_and_Spanning_Exercises
  • Nicholson 5.1.2(b,d)
     12 
    math.libretexts.org/Bookshelves/Linear_Algebra/Linear_Algebra_with_Applications_(Nicholson)/05%3A_Vector_Space_R/5.01%3A_Subspaces_and_Spanning/5.1E%3A_Subspaces_and_Spanning_Exercises

Subsection Independence, bases, and rank

Primary outcomes. U2-LO4. Competencies. P+J.
  • Nicholson 5.2.3(b)
     13 
    math.libretexts.org/Bookshelves/Linear_Algebra/Linear_Algebra_with_Applications_(Nicholson)/05%3A_Vector_Space_R/5.02%3A_Independence_and_Dimension/5.2E%3A_Independence_and_Dimension_Exercises
  • Nicholson 5.2.5(b)
     14 
    math.libretexts.org/Bookshelves/Linear_Algebra/Linear_Algebra_with_Applications_(Nicholson)/05%3A_Vector_Space_R/5.02%3A_Independence_and_Dimension/5.2E%3A_Independence_and_Dimension_Exercises
  • Nicholson 5.2.6(f)
     15 
    math.libretexts.org/Bookshelves/Linear_Algebra/Linear_Algebra_with_Applications_(Nicholson)/05%3A_Vector_Space_R/5.02%3A_Independence_and_Dimension/5.2E%3A_Independence_and_Dimension_Exercises
  • Nicholson 5.2.16(b)
     16 
    math.libretexts.org/Bookshelves/Linear_Algebra/Linear_Algebra_with_Applications_(Nicholson)/05%3A_Vector_Space_R/5.02%3A_Independence_and_Dimension/5.2E%3A_Independence_and_Dimension_Exercises

Subsection Rank and nullity

Primary outcomes. U2-LO3, U2-LO4, U2-LO6. Competencies. P+C.
  • Nicholson 5.4.1(b)
     17 
    math.libretexts.org/Bookshelves/Linear_Algebra/Linear_Algebra_with_Applications_(Nicholson)/05%3A_Vector_Space_R/5.04%3A_Rank_of_a_Matrix/5.4E%3A_Rank_of_a_Matrix_Exercises
  • Nicholson 5.4.2(b)
     18 
    math.libretexts.org/Bookshelves/Linear_Algebra/Linear_Algebra_with_Applications_(Nicholson)/05%3A_Vector_Space_R/5.04%3A_Rank_of_a_Matrix/5.4E%3A_Rank_of_a_Matrix_Exercises
  • Nicholson 5.4.7(b)
     19 
    math.libretexts.org/Bookshelves/Linear_Algebra/Linear_Algebra_with_Applications_(Nicholson)/05%3A_Vector_Space_R/5.04%3A_Rank_of_a_Matrix/5.4E%3A_Rank_of_a_Matrix_Exercises

Subsection Inverses and determinants

Primary outcomes. U2-LO5, U2-LO7. Competencies. P+C.
  • Nicholson 2.4.2(b)
     20 
    math.libretexts.org/Bookshelves/Linear_Algebra/Linear_Algebra_with_Applications_(Nicholson)/02%3A_Matrix_Algebra/2.04%3A_Matrix_Inverses/2.4E%3A_Matrix_Inverses_Exercises
  • Nicholson 2.4.3(b)
     21 
    math.libretexts.org/Bookshelves/Linear_Algebra/Linear_Algebra_with_Applications_(Nicholson)/02%3A_Matrix_Algebra/2.04%3A_Matrix_Inverses/2.4E%3A_Matrix_Inverses_Exercises
  • Nicholson 2.4.5(h)
     22 
    math.libretexts.org/Bookshelves/Linear_Algebra/Linear_Algebra_with_Applications_(Nicholson)/02%3A_Matrix_Algebra/2.04%3A_Matrix_Inverses/2.4E%3A_Matrix_Inverses_Exercises
  • Nicholson 3.2.3(b)
     23 
    math.libretexts.org/Bookshelves/Linear_Algebra/Linear_Algebra_with_Applications_(Nicholson)/03%3A_Determinants_and_Diagonalization/3.02%3A_Determinants_and_Matrix_Inverses/3.2E%3A_Determinants_and_Matrix_Inverses_Exercises
  • Nicholson 3.2.4(b)
     24 
    math.libretexts.org/Bookshelves/Linear_Algebra/Linear_Algebra_with_Applications_(Nicholson)/03%3A_Determinants_and_Diagonalization/3.02%3A_Determinants_and_Matrix_Inverses/3.2E%3A_Determinants_and_Matrix_Inverses_Exercises
  • Nicholson 3.2.6(b)
     25 
    math.libretexts.org/Bookshelves/Linear_Algebra/Linear_Algebra_with_Applications_(Nicholson)/03%3A_Determinants_and_Diagonalization/3.02%3A_Determinants_and_Matrix_Inverses/3.2E%3A_Determinants_and_Matrix_Inverses_Exercises
  • Nicholson 3.1.1(h)
     26 
    math.libretexts.org/Bookshelves/Linear_Algebra/Linear_Algebra_with_Applications_(Nicholson)/03%3A_Determinants_and_Diagonalization/3.01%3A_The_Cofactor_Expansion/3.1E%3A_The_Cofactor_Expansion_Exercises
  • Nicholson 3.1.5(b)
     27 
    math.libretexts.org/Bookshelves/Linear_Algebra/Linear_Algebra_with_Applications_(Nicholson)/03%3A_Determinants_and_Diagonalization/3.01%3A_The_Cofactor_Expansion/3.1E%3A_The_Cofactor_Expansion_Exercises
  • Nicholson 3.1.7(b)
     28 
    math.libretexts.org/Bookshelves/Linear_Algebra/Linear_Algebra_with_Applications_(Nicholson)/03%3A_Determinants_and_Diagonalization/3.01%3A_The_Cofactor_Expansion/3.1E%3A_The_Cofactor_Expansion_Exercises
  • Nicholson 3.1.16(b)
     29 
    math.libretexts.org/Bookshelves/Linear_Algebra/Linear_Algebra_with_Applications_(Nicholson)/03%3A_Determinants_and_Diagonalization/3.01%3A_The_Cofactor_Expansion/3.1E%3A_The_Cofactor_Expansion_Exercises

Subsection Additional applied and computational problems

These exercises connect the main Unit 2 ideas through short applied computations: reachable outputs, forgotten directions, row reduction, subspaces, rank, nullity, redundant features, inverses, determinants, and code interpretation. Solutions are collected in Appendix C.2.

Checkpoint 2.7.1. Projection and forgotten height in code.

A sensor records only horizontal position. It keeps the first two coordinates and drops height.
import numpy as np

P = np.array([
    [1, 0, 0],
    [0, 1, 0],
])

x = np.array([2, 1, 5])
z = np.array([0, 0, 1])

rank = int(np.linalg.matrix_rank(P))
nullity = P.shape[1] - rank

P @ x, P @ (x + 6*z), P @ z, rank, nullity
Output:
(array([2, 1]), array([2, 1]), array([0, 0]), 2, 1)
  1. What does \(P\) do to an input vector?
  2. Why do \(P\mathbf{x}\) and \(P(\mathbf{x}+6\mathbf{z})\) agree?
  3. What does \(P\mathbf{z}=\mathbf{0}\) say about the direction \(\mathbf{z}\text{?}\)
  4. Interpret the rank and nullity.
  5. Why can the original input not be recovered uniquely from the output?
Tags. [U2-LO3, U2-LO6 | C+R+T | Core]

Checkpoint 2.7.2. Reachable outputs from augmented rref.

\begin{equation*} A= \begin{bmatrix} 1\amp0\\ 0\amp1\\ 1\amp1 \end{bmatrix}, \qquad \mathbf{b}_1= \begin{bmatrix} 1\\ 2\\ 3 \end{bmatrix}, \qquad \mathbf{b}_2= \begin{bmatrix} 1\\ 2\\ 4 \end{bmatrix}. \end{equation*}
The following code row-reduces the augmented matrices for
\begin{equation*} A\mathbf{x}=\mathbf{b}_1 \qquad\text{and}\qquad A\mathbf{x}=\mathbf{b}_2. \end{equation*}
import sympy as sp

M1 = sp.Matrix([
    [1, 0, 1],
    [0, 1, 2],
    [1, 1, 3],
])

M2 = sp.Matrix([
    [1, 0, 1],
    [0, 1, 2],
    [1, 1, 4],
])

M1.rref(), M2.rref()
Output:
((Matrix([
[1, 0, 1],
[0, 1, 2],
[0, 0, 0]]), (0, 1)),
 (Matrix([
[1, 0, 0],
[0, 1, 0],
[0, 0, 1]]), (0, 1, 2)))
Read the two rref matrices as
\begin{equation*} \left[ \begin{array}{cc|c} 1\amp0\amp1\\ 0\amp1\amp2\\ 0\amp0\amp0 \end{array} \right], \qquad \left[ \begin{array}{cc|c} 1\amp0\amp0\\ 0\amp1\amp0\\ 0\amp0\amp1 \end{array} \right]. \end{equation*}
  1. Which target vector is reachable?
  2. Which target vector is not reachable?
  3. What row shows inconsistency?
  4. What does a pivot to the right of the vertical line mean?
  5. For the reachable target, give one input \(\mathbf{x}\text{.}\)
Tags. [U2-LO1, U2-LO2, U2-LO3 | C+R+T | Core]

Checkpoint 2.7.3. Line of intersection from an rref output.

Consider the two planes
\begin{equation*} x+y+z=1, \qquad -x+2y-3z=-1. \end{equation*}
The following code row-reduces the augmented matrix for the system.
import sympy as sp

M = sp.Matrix([
    [1, 1, 1, 1],
    [-1, 2, -3, -1],
])

M.rref()
Output:
(Matrix([
[1, 0,  5/3, 1],
[0, 1, -2/3, 0]]), (0, 1))
Read the rref matrix as
\begin{equation*} \left[ \begin{array}{ccc|c} 1\amp0\amp5/3\amp1\\ 0\amp1\amp-2/3\amp0 \end{array} \right]. \end{equation*}
  1. Which variable is free?
  2. Write \(x\) and \(y\) in terms of \(z\text{.}\)
  3. Let \(z=t\text{.}\) Write the solution set in parametric vector form.
  4. Why is the solution set a line?
  5. How does this connect to the intersection of two planes?
Tags. [U2-LO1, U2-LO2 | P+R+T | Core]

Checkpoint 2.7.4. Plane through three points from a null-space computation.

\begin{equation*} P=(1,1,-2), \qquad Q=(0,2,1), \qquad R=(-1,-1,0). \end{equation*}
Two displacement vectors in the plane are
\begin{equation*} \overrightarrow{PQ} = \begin{bmatrix} -1\\ 1\\ 3 \end{bmatrix}, \qquad \overrightarrow{PR} = \begin{bmatrix} -2\\ -2\\ 2 \end{bmatrix}. \end{equation*}
A normal vector \(\mathbf{n}\) must be perpendicular to both displacement vectors. The following code solves for such directions.
import sympy as sp

M = sp.Matrix([
    [-1, 1, 3],
    [-2, -2, 2],
])

M.nullspace()
Output:
[Matrix([
[ 2],
[-1],
[ 1]])]
  1. What do the rows of \(M\) represent?
  2. Why does a vector in \(\operatorname{null}(M)\) give a normal vector to the plane?
  3. Use the output to choose a normal vector \(\mathbf{n}\text{.}\)
  4. Write an equation of the plane.
Tags. [U2-LO1, U2-LO2, U2-LO3 | P+R+T | Core]

Checkpoint 2.7.5. Reading a null-space basis in code.

The following code asks SymPy for a basis of a null space.
import sympy as sp

A = sp.Matrix([
    [1, 2, 3],
    [2, 4, 6],
    [0, 1, 1],
])

A.nullspace()
Output:
[Matrix([
[-1],
[-1],
[ 1]])]
\begin{equation*} \mathbf{z} = \begin{bmatrix} -1\\ -1\\ 1 \end{bmatrix}. \end{equation*}
  1. Is \(\mathbf{z}\) an input direction or an output direction?
  2. Verify that \(A\mathbf{z}=\mathbf{0}\text{.}\)
  3. If \(A\mathbf{x}=\mathbf{y}\text{,}\) compute \(A(\mathbf{x}+t\mathbf{z})\text{.}\)
  4. What does this say about uniqueness of inputs?
Tags. [U2-LO3, U2-LO6 | C+R+T | Core]

Checkpoint 2.7.6. Redundant square-footage features in code.

Rows represent houses. The columns are first-level area, second-level area, and total area, measured in hundreds of square feet.
import numpy as np

X = np.array([
    [9, 7, 16],
    [11, 9, 20],
    [14, 0, 14],
    [8, 8, 16],
])

z = np.array([1, 1, -1])
c = np.array([3, 1, 0])
c_alt = np.array([2, 0, 1])

rank = int(np.linalg.matrix_rank(X))

X @ z, rank, X @ c, X @ c_alt
Output:
(array([0, 0, 0, 0]), 2, array([34, 42, 42, 32]), array([34, 42, 42, 32]))
  1. What feature relation does \(X\mathbf{z}=\mathbf{0}\) show?
  2. What does \(\operatorname{rank}(X)=2\) say about the three feature columns?
  3. Why do \(X\mathbf{c}\) and \(X\mathbf{c}_{\mathrm{alt}}\) agree?
  4. What warning does this give about interpreting individual coefficients?
  5. In this example, why is it not clear whether first-level area, second-level area, or total area is the β€œmost important” feature?
Tags. [U2-LO3, U2-LO6 | C+M+T | Core]

Checkpoint 2.7.7. Difference matrix: levels versus changes.

The following matrix computes consecutive differences in a short time series.
import numpy as np

D = np.array([
    [-1, 1, 0, 0],
    [0, -1, 1, 0],
    [0, 0, -1, 1],
])

x = np.array([2, 5, 9, 10])
ones = np.ones(4, dtype=int)

D @ x, D @ (x + 10*ones), D @ ones, int(np.linalg.matrix_rank(D))
Output:
(array([3, 4, 1]), array([3, 4, 1]), array([0, 0, 0]), 3)
  1. What does \(D\mathbf{x}\) measure?
  2. Why do \(D\mathbf{x}\) and \(D(\mathbf{x}+10\mathbf{1})\) agree?
  3. What input direction does \(D\) forget?
  4. What does the rank say about the three output differences?
  5. What is the nullity of \(D\text{?}\)
Tags. [U2-LO3, U2-LO6 | C+R+T | Core]

Checkpoint 2.7.8. Debugging a column-space basis from code.

A student computes an rref and pivot columns.
import sympy as sp

A = sp.Matrix([
    [1, 2, 3],
    [2, 4, 6],
    [0, 1, 1],
])

R, pivots = A.rref()
R, pivots
Output:
(Matrix([
[1, 0, 1],
[0, 1, 1],
[0, 0, 0]]), (0, 1))
The student says:
\begin{equation*} \text{``Columns 1 and 2 of }R\text{ are a basis for }\operatorname{col}(A).\text{''} \end{equation*}
  1. What do the pivot indices (0, 1) mean in mathematical column numbering?
  2. What is wrong with using columns of \(R\) as a basis for \(\operatorname{col}(A)\text{?}\)
  3. Which matrix should supply the basis vectors?
  4. Write a basis for \(\operatorname{col}(A)\text{.}\)
Tags. [U2-LO3, U2-LO4 | C+J+T | Core]

Checkpoint 2.7.10. Reading an inverse-computation output.

The following code row-reduces \([A\mid I_3]\text{.}\)
import sympy as sp

A = sp.Matrix([
    [1, 1, 4],
    [2, 3, 2],
    [0, 0, 1],
])

M = A.row_join(sp.eye(3))
M.rref()
Output:
(Matrix([
[1, 0, 0,  3, -1, -10],
[0, 1, 0, -2,  1,   6],
[0, 0, 1,  0,  0,   1]]), (0, 1, 2))
Read the rref matrix as
\begin{equation*} \left[ \begin{array}{ccc|ccc} 1\amp0\amp0\amp3\amp-1\amp-10\\ 0\amp1\amp0\amp-2\amp1\amp6\\ 0\amp0\amp1\amp0\amp0\amp1 \end{array} \right]. \end{equation*}
  1. What does the left side of the vertical line show?
  2. Is \(A\) invertible?
  3. Read off \(A^{-1}\text{.}\)
  4. Why does row-reducing \([A\mid I_3]\) give the inverse?
Tags. [U2-LO5, U2-LO7 | C+R+T | Core]