Exercise: mixed review
Goal
- Self-test on all the skills from these exercises mixed together, in random order.
- Practise picking the right rule for each problem without being told which.
- Build confidence with small numbers and clean answers before the eigenvalue units.
The method
This page is a grab-bag. Each problem uses one of the skills from the earlier exercises. A quick reminder of the toolbox:
- Dimensions. An \(m\times n\) matrix has \(m\) rows and \(n\) columns.
- Addition / scalar. Add matrices entrywise (same size); a scalar multiplies every entry.
- Matrix × vector. Each output entry is a row dotted with the vector.
- Matrix × matrix. Entry \((i,j)\) is row \(i\) of the left dotted with column \(j\) of the right.
- Transpose. \(A^\top\) turns rows into columns.
- Determinant. \(\det\begin{bmatrix} a & b \\ c & d \end{bmatrix} = ad - bc\); it is \(0\) exactly when the columns are parallel (no inverse).
- 2×2 inverse. Row-reduce \([A \mid I]\) until the left half is \(I\); the right half is then \(A^{-1}\) (see Exercise: the 2×2 inverse). A zero row on the left means \(A\) is singular: no inverse.
- Solve a 2×2 system. \(\mathbf{x} = A^{-1}\mathbf{b}\), where \(\mathbf{x} = (x, y)\).
Tiny worked example (matrix × vector). \[ \begin{bmatrix} 1 & 2 \\ 0 & 3 \end{bmatrix} \begin{bmatrix} 4 \\ 1 \end{bmatrix} = \begin{bmatrix} (1)(4)+(2)(1) \\ (0)(4)+(3)(1) \end{bmatrix} = \begin{bmatrix} 6 \\ 3 \end{bmatrix}. \]
Problems
Do them in order; resist peeking at the solutions.
(Dimensions) How many rows and columns does \(\begin{bmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \end{bmatrix}\) have?
(Addition) Compute \(\begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix} + \begin{bmatrix} 5 & 0 \\ 1 & 2 \end{bmatrix}.\)
(Determinant) \(\det\begin{bmatrix} 3 & 2 \\ 1 & 4 \end{bmatrix}.\)
(Scalar) Compute \(3\begin{bmatrix} 1 & 0 \\ 2 & 1 \end{bmatrix}.\)
(Transpose) Write the transpose of \(\begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix}.\)
(Matrix × vector) Compute \(\begin{bmatrix} 2 & 0 \\ 1 & 3 \end{bmatrix}\begin{bmatrix} 1 \\ 2 \end{bmatrix}.\)
(2×2 inverse) Find the inverse of \(\begin{bmatrix} 2 & 1 \\ 1 & 1 \end{bmatrix}.\)
(Transpose) Write the transpose of \(\begin{bmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \end{bmatrix}.\)
(Singular?) Does \(\begin{bmatrix} 2 & 4 \\ 1 & 2 \end{bmatrix}\) have an inverse?
(Matrix × matrix) Compute \(\begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix}\begin{bmatrix} 5 & 6 \\ 7 & 8 \end{bmatrix}.\)
(Matrix × matrix) Compute \(\begin{bmatrix} 1 & 2 \\ 0 & 1 \end{bmatrix}\begin{bmatrix} 3 & 0 \\ 1 & 4 \end{bmatrix}.\)
(Solve a system) Solve \(A\mathbf{x} = \mathbf{b}\) with \(A = \begin{bmatrix} 2 & 1 \\ 1 & 1 \end{bmatrix}\), \(\mathbf{b} = \begin{bmatrix} 5 \\ 3 \end{bmatrix}\).
(Matrix × vector) Compute \(\begin{bmatrix} 1 & 1 \\ 2 & 3 \end{bmatrix}\begin{bmatrix} 2 \\ 1 \end{bmatrix}.\)
(Determinant, 3×3, optional) \(\det\begin{bmatrix} 1 & 0 & 2 \\ 0 & 3 & 0 \\ 1 & 0 & 1 \end{bmatrix}.\)
(2×2 inverse) Find the inverse of \(\begin{bmatrix} 4 & 2 \\ 1 & 1 \end{bmatrix}.\)
(Solve a system) Solve \(A\mathbf{x} = \mathbf{b}\) with \(A = \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix}\), \(\mathbf{b} = \begin{bmatrix} 5 \\ 11 \end{bmatrix}\).
Check in R
Build matrices with matrix, multiply with %*%, transpose with t, take determinants with det, and invert or solve with solve.
A <- matrix(c(1, 2,
3, 4), nrow = 2, byrow = TRUE)
dim(A)
# [1] 2 2
t(A)
# [,1] [,2]
# [1,] 1 3
# [2,] 2 4
det(matrix(c(3, 2, 1, 4), nrow = 2, byrow = TRUE))
# [1] 10
solve(matrix(c(2, 1, 1, 1), nrow = 2, byrow = TRUE), c(5, 3))
# [1] 2 1 (x = 2, y = 1)Hints
Read the label in bold before each problem — it names the skill. Then recall the matching one-line rule from “The method”.
For matrix×vector and matrix×matrix, the output entry is “row of the left \(\cdot\) column of the right”: multiply matching entries and add.
The first row becomes the first column, the second row becomes the second column, and so on. An \(m\times n\) matrix becomes \(n\times m\).
Get \(A^{-1}\) by row-reducing \([A \mid I]\), then \(\mathbf{x} = A^{-1}\mathbf{b}\) is a matrix-times-vector product. (Row-reducing \([A \mid \mathbf{b}]\) directly works too.)
Expand along the row (or column) with the most zeros to kill terms early. The signs along the top row are \(+,\,-,\,+\).
Step-by-step solutions
Problem 1. It has 2 rows and 3 columns, so it is a \(2\times3\) matrix.
Problem 2. Add entrywise: \[ \begin{bmatrix} 1+5 & 2+0 \\ 3+1 & 4+2 \end{bmatrix} = \begin{bmatrix} 6 & 2 \\ 4 & 6 \end{bmatrix}. \]
Problem 3. \((3)(4) - (2)(1) = 12 - 2 = 10.\)
Problem 4. Multiply every entry by \(3\): \[ \begin{bmatrix} 3(1) & 3(0) \\ 3(2) & 3(1) \end{bmatrix} = \begin{bmatrix} 3 & 0 \\ 6 & 3 \end{bmatrix}. \]
Problem 5. Rows become columns: \[ \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix}^\top = \begin{bmatrix} 1 & 3 \\ 2 & 4 \end{bmatrix}. \]
Problem 6. \[ \begin{bmatrix} (2)(1)+(0)(2) \\ (1)(1)+(3)(2) \end{bmatrix} = \begin{bmatrix} 2 \\ 7 \end{bmatrix}. \]
Problem 7. This is the worked example of Exercise: the 2×2 inverse: \[ \left[\begin{array}{cc|cc} 2 & 1 & 1 & 0 \\ 1 & 1 & 0 & 1 \end{array}\right] \xrightarrow{\;\text{R2}\,-\,\frac12\text{R1}\;} \left[\begin{array}{cc|cc} 2 & 1 & 1 & 0 \\ 0 & \tfrac12 & -\tfrac12 & 1 \end{array}\right] \xrightarrow{\;2\,\text{R2}\;} \left[\begin{array}{cc|cc} 2 & 1 & 1 & 0 \\ 0 & 1 & -1 & 2 \end{array}\right] \] \[ \xrightarrow{\;\text{R1}\,-\,\text{R2}\;} \left[\begin{array}{cc|cc} 2 & 0 & 2 & -2 \\ 0 & 1 & -1 & 2 \end{array}\right] \xrightarrow{\;\frac12\text{R1}\;} \left[\begin{array}{cc|cc} 1 & 0 & 1 & -1 \\ 0 & 1 & -1 & 2 \end{array}\right], \qquad A^{-1} = \begin{bmatrix} 1 & -1 \\ -1 & 2 \end{bmatrix}. \]
Problem 8. The \(2\times3\) becomes \(3\times2\): \[ \begin{bmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \end{bmatrix}^\top = \begin{bmatrix} 1 & 4 \\ 2 & 5 \\ 3 & 6 \end{bmatrix}. \]
Problem 9. No. The second column \((4, 2)\) is twice the first \((2, 1)\): the columns are parallel. Row reduction shows it too: \(\left[\begin{array}{cc|cc} 2 & 4 & 1 & 0 \\ 1 & 2 & 0 & 1 \end{array}\right]
\xrightarrow{\;\text{R2}\,-\,\frac12\text{R1}\;}
\left[\begin{array}{cc|cc} 2 & 4 & 1 & 0 \\ 0 & 0 & -\tfrac12 & 1 \end{array}\right]\) has a zero row on the left, so \(I\) can never be reached. The matrix is singular and solve() gives an error. The determinant agrees: \((2)(2)-(4)(1) = 0\).
Problem 10. Multiplying by the identity returns the other matrix unchanged: \[ \begin{bmatrix} 5 & 6 \\ 7 & 8 \end{bmatrix}. \] (Check one entry: row 1 of \(I\) dotted with column 1 is \((1)(5)+(0)(7)=5\).)
Problem 11. \[ \begin{bmatrix} (1)(3)+(2)(1) & (1)(0)+(2)(4) \\ (0)(3)+(1)(1) & (0)(0)+(1)(4) \end{bmatrix} = \begin{bmatrix} 5 & 8 \\ 1 & 4 \end{bmatrix}. \]
Problem 12. \(A\) is the matrix of Problem 7, so \(A^{-1} = \begin{bmatrix} 1 & -1 \\ -1 & 2 \end{bmatrix}\). Then \[ \mathbf{x} = A^{-1}\mathbf{b} = \begin{bmatrix} 1 & -1 \\ -1 & 2 \end{bmatrix} \begin{bmatrix} 5 \\ 3 \end{bmatrix} = \begin{bmatrix} (1)(5)+(-1)(3) \\ (-1)(5)+(2)(3) \end{bmatrix} = \begin{bmatrix} 2 \\ 1 \end{bmatrix}. \] So \(x = 2,\ y = 1\).
Problem 13. \[ \begin{bmatrix} (1)(2)+(1)(1) \\ (2)(2)+(3)(1) \end{bmatrix} = \begin{bmatrix} 3 \\ 7 \end{bmatrix}. \]
Problem 14. Expand along the top row \(1, 0, 2\) (the \(0\) kills its term): \[ 1\det\begin{bmatrix} 3 & 0 \\ 0 & 1 \end{bmatrix} - 0 + 2\det\begin{bmatrix} 0 & 3 \\ 1 & 0 \end{bmatrix}. \] First minor: \((3)(1)-(0)(0) = 3\). Third minor: \((0)(0)-(3)(1) = -3\). So \(1(3) - 0 + 2(-3) = 3 - 6 = -3.\)
Problem 15. \[ \left[\begin{array}{cc|cc} 4 & 2 & 1 & 0 \\ 1 & 1 & 0 & 1 \end{array}\right] \xrightarrow{\;\text{R2}\,-\,\frac14\text{R1}\;} \left[\begin{array}{cc|cc} 4 & 2 & 1 & 0 \\ 0 & \tfrac12 & -\tfrac14 & 1 \end{array}\right] \xrightarrow{\;2\,\text{R2}\;} \left[\begin{array}{cc|cc} 4 & 2 & 1 & 0 \\ 0 & 1 & -\tfrac12 & 2 \end{array}\right] \] \[ \xrightarrow{\;\text{R1}\,-\,2\text{R2}\;} \left[\begin{array}{cc|cc} 4 & 0 & 2 & -4 \\ 0 & 1 & -\tfrac12 & 2 \end{array}\right] \xrightarrow{\;\frac14\text{R1}\;} \left[\begin{array}{cc|cc} 1 & 0 & \tfrac12 & -1 \\ 0 & 1 & -\tfrac12 & 2 \end{array}\right], \qquad A^{-1} = \begin{bmatrix} \tfrac{1}{2} & -1 \\ -\tfrac{1}{2} & 2 \end{bmatrix}. \]
Problem 16. First the inverse: \[ \left[\begin{array}{cc|cc} 1 & 2 & 1 & 0 \\ 3 & 4 & 0 & 1 \end{array}\right] \xrightarrow{\;\text{R2}\,-\,3\text{R1}\;} \left[\begin{array}{cc|cc} 1 & 2 & 1 & 0 \\ 0 & -2 & -3 & 1 \end{array}\right] \xrightarrow{\;-\frac12\text{R2}\;} \left[\begin{array}{cc|cc} 1 & 2 & 1 & 0 \\ 0 & 1 & \tfrac32 & -\tfrac12 \end{array}\right] \] \[ \xrightarrow{\;\text{R1}\,-\,2\text{R2}\;} \left[\begin{array}{cc|cc} 1 & 0 & -2 & 1 \\ 0 & 1 & \tfrac32 & -\tfrac12 \end{array}\right], \qquad A^{-1} = \begin{bmatrix} -2 & 1 \\ \tfrac{3}{2} & -\tfrac{1}{2} \end{bmatrix}. \] Then \[ \mathbf{x} = A^{-1}\mathbf{b} = \begin{bmatrix} -2 & 1 \\ \tfrac{3}{2} & -\tfrac{1}{2} \end{bmatrix} \begin{bmatrix} 5 \\ 11 \end{bmatrix} = \begin{bmatrix} (-2)(5)+(1)(11) \\ (\tfrac{3}{2})(5)+(-\tfrac{1}{2})(11) \end{bmatrix} = \begin{bmatrix} 1 \\ 2 \end{bmatrix}. \] So \(x = 1,\ y = 2\). (Check: \(1 + 2(2) = 5\) and \(3(1) + 4(2) = 11\). Both hold.)