CS223 // Final Exam // Term 232
Dark
Final Exam (Term 232)
Gauss-Jordan, parameter cases, transposes, LU solving, determinant tricks, the four fundamental subspaces, eigen-decomposition, Gram-Schmidt and QR.
Score 0 / 40
Time left 00:00
Start timer
Check all
Show all solutions
Reset
Question 1: Linear equations and matrix algebra 16 PTS
1
Solve by Gauss-Jordan elimination (reduced row echelon form).$$\begin{cases}-2x_1 + 3x_2 - 4x_3 = -2 \\ x_1 - 2x_2 + 2x_3 = 2 \\ 3x_1 + x_2 - x_3 = 1\end{cases}$$
3 pts
Fractions, decimals, sqrt(…) and lists separated by commas all work.
Check
Show solution
Worked solution
$R_1 \leftarrow R_1/(-2)$, $R_2 \leftarrow R_2 - R_1$, $R_3 \leftarrow R_3 - 3R_1$, $R_2 \leftarrow -2R_2$.
$R_1 \leftarrow R_1 + \tfrac32R_2$, $R_3 \leftarrow R_3 - \tfrac{11}{2}R_2$, $R_3 \leftarrow R_3/(-7)$, $R_1 \leftarrow R_1 - 2R_3$.
RREF: $$\left[\begin{array}{ccc|c}1 & 0 & 0 & \tfrac47 \\ 0 & 1 & 0 & -2 \\ 0 & 0 & 1 & -\tfrac97\end{array}\right]$$
Check in row 1: $-2(\tfrac47) + 3(-2) - 4(-\tfrac97) = \tfrac{-8 - 42 + 36}{7} = -2$.
Answer: $x_1 = \tfrac47,\ x_2 = -2,\ x_3 = -\tfrac97$
2a
For which values of $a$ does the system have a unique solution?$$\begin{cases}x_1 + 2x_2 + x_3 = 3 \\ -x_1 + ax_2 + 4x_3 = -2 \\ 2x_1 - 3x_2 + ax_3 = b\end{cases}$$
1.5 pts
Worked solution
$\det A = 1(a^2 + 12) - 2(-a - 8) + 1(3 - 2a) = a^2 + 31$.
$a^2 + 31 \geq 31 > 0$ for every real $a$, so the coefficient matrix is always invertible.
Answer: Unique for every real $a$.
Note on the original key: The official key writes $a \neq \pm i\sqrt{31}$. That is the same statement, since $\pm i\sqrt{31}$ are not real.
2b
Find the pairs $(a, b)$ for which the system has more than one solution.
1.5 pts
Worked solution
Row reduction ends in $\left[\,0 \;\; 0 \;\; a^2 + 31 \mid ab - 6a + 2b - 5\,\right]$.
More than one solution needs $a^2 + 31 = 0$, which has no real solution.
Answer: No real pair.
Note on the original key: The key lists complex pairs: $a = \pm i\sqrt{31}$ with $b = \tfrac{11 + 6i\sqrt{31}}{2 + i\sqrt{31}}$ or $\tfrac{5 - 6i\sqrt{31}}{2 - i\sqrt{31}}$. Over the reals, no pair exists.
3a
$A = \begin{bmatrix}-1 & 2 & -3 \\ 2 & 1 & -1 \\ -2 & 3 & 1\end{bmatrix}$, $B = \begin{bmatrix}1 & -2 \\ -1 & 3 \\ -3 & 3\end{bmatrix}$. Let $C = B^TA^T$. Find $C$.
3 pts
Fractions, decimals, sqrt(…) and lists separated by commas all work.
Check
Show solution
Worked solution
$C = B^TA^T = \begin{bmatrix}1 & -1 & -3 \\ -2 & 3 & 3\end{bmatrix}\begin{bmatrix}-1 & 2 & -2 \\ 2 & 1 & 3 \\ -3 & -1 & 1\end{bmatrix} = \begin{bmatrix}6 & 4 & -8 \\ -1 & -4 & 16\end{bmatrix}$.
Answer: $C = \begin{bmatrix}6 & 4 & -8 \\ -1 & -4 & 16\end{bmatrix}$
3b
Write $C$ in terms of $A$ and $B$.
2 pts
Worked solution
The transpose of a product reverses the order: $(AB)^T = B^TA^T$.
Answer: $C = (AB)^T$
4
Solve the system using the given factorization $A = LU$.$$\begin{bmatrix}1 & -2 & 1 \\ -1 & 3 & 2 \\ 1 & 0 & 1\end{bmatrix}\begin{bmatrix}x_1\\x_2\\x_3\end{bmatrix} = \begin{bmatrix}3 \\ -1 \\ 2\end{bmatrix},\qquad \begin{bmatrix}1 & -2 & 1 \\ -1 & 3 & 2 \\ 1 & 0 & 1\end{bmatrix} = \begin{bmatrix}1 & 0 & 0 \\ -1 & 1 & 0 \\ 1 & 2 & 1\end{bmatrix}\begin{bmatrix}1 & -2 & 1 \\ 0 & 1 & 3 \\ 0 & 0 & -6\end{bmatrix}$$
3 pts
Fractions, decimals, sqrt(…) and lists separated by commas all work.
Check
Show solution
Worked solution
Let $U\mathbf x = \mathbf z$ and solve $L\mathbf z = \mathbf b$ forward: $z_1 = 3$, $z_2 = -1 + 3 = 2$, $z_3 = 2 - 3 - 4 = -5$.
Solve $U\mathbf x = \mathbf z$ backward: $-6x_3 = -5 \Rightarrow x_3 = \tfrac56$; $x_2 + 3x_3 = 2 \Rightarrow x_2 = -\tfrac12$;
$x_1 - 2x_2 + x_3 = 3 \Rightarrow x_1 = 3 - 1 - \tfrac56 = \tfrac76$.
Answer: $\mathbf x = \left(\tfrac76,\ -\tfrac12,\ \tfrac56\right)$
5
Which values of $a$ and $b$ make $\begin{bmatrix}3 & -2 & 1 \\ 0 & a-2 & 3 \\ 0 & 0 & b+1\end{bmatrix}$ singular?
2 pts
Worked solution
Upper triangular: $\det = 3(a - 2)(b + 1)$.
The product is zero when either factor is zero.
Answer: Singular exactly when $a = 2$ or $b = -1$ (or both).
Question 2: Determinants 4 PTS
1
Find $\det A$ for $A = \begin{bmatrix}2 & 3 & -1 & 4 \\ 1 & -2 & 3 & 0 \\ 2 & -1 & 0 & -2 \\ -3 & 2 & -1 & 3\end{bmatrix}$ given that $\begin{vmatrix}6 & -4 & 2 & -6 \\ 3 & -3 & 3 & -2 \\ 3 & -6 & 9 & 0 \\ 2 & 3 & -1 & 4\end{vmatrix} = -42$.
2 pts
Fractions, decimals, sqrt(…) and lists separated by commas all work.
Check
Show solution
Worked solution
Undo the operations that turn the given matrix into $A$, tracking the determinant:
Swap $R_1, R_4$: $-1 \times (-42) = 42$.
Scale $R_4$ by $-\tfrac12$: $42 \times (-\tfrac12) = -21$.
Swap $R_2, R_3$: $21$. Scale $R_2$ by $\tfrac13$: $7$.
$R_3 \leftarrow R_3 - R_2$ leaves it unchanged: $7$.
Answer: $\det A = 7$
2
Find $\det A$ by cofactor expansion based on row 2 and column 3, where $A = \begin{bmatrix}-2 & 0 & 1 & -2 \\ 0 & 0 & 2 & 0 \\ -1 & 6 & 0 & -3 \\ -2 & 1 & 0 & -2\end{bmatrix}$.
2 pts
Fractions, decimals, sqrt(…) and lists separated by commas all work.
Check
Show solution
Worked solution
Row 2 has a single nonzero entry, $a_{23} = 2$.
$\det A = (-1)^{2+3}\cdot 2 \cdot \begin{vmatrix}-2 & 0 & -2 \\ -1 & 6 & -3 \\ -2 & 1 & -2\end{vmatrix}$.
The $3\times3$ minor is $-2(-12 + 3) - 0 + (-2)(-1 + 12) = 18 - 22 = -4$.
$\det A = -2 \cdot (-4) = 8$.
Answer: $\det A = 8$
Question 3: Vector spaces 10 PTS
Let $\mathbf v_1 = \begin{bmatrix}1 \\ -3 \\ \tfrac12\end{bmatrix}$, $\mathbf v_2 = \begin{bmatrix}1 \\ 1 \\ -1\end{bmatrix}$, $\mathbf v_3 = \begin{bmatrix}-1 \\ 2 \\ -2\end{bmatrix}$ and $A = \begin{bmatrix}\mathbf v_1 & \mathbf v_2 & \mathbf v_3\end{bmatrix}$.
1
Are these vectors linearly independent?
2 pts
Worked solution
$\det A = -\tfrac{15}{2} \neq 0$, so $A\mathbf x = \mathbf 0$ has only the trivial solution.
Answer: Yes.
2
Find the null space and the nullity of $A$.
2 pts
Fractions, decimals, sqrt(…) and lists separated by commas all work.
Check
Show solution
Worked solution
Only the trivial solution, so $\operatorname{Nul}A = \{\mathbf 0\}$.
Answer: $\operatorname{Nul}A = \{\mathbf 0\}$, nullity $0$
Note on the original key: The key calls the null space "empty". A null space always contains the zero vector, so the precise answer is {0}, with dimension 0.
3
Find the column space and rank of $A$.
2 pts
Fractions, decimals, sqrt(…) and lists separated by commas all work.
Check
Show solution
Worked solution
rank $= 3 - $ nullity $= 3$, so the three columns are a basis of $\operatorname{Col}A = \mathbb R^3$.
Answer: rank $3$, $\operatorname{Col}A = \operatorname{Span}\{\mathbf v_1, \mathbf v_2, \mathbf v_3\} = \mathbb R^3$
4
Find the row space of $A$.
2 pts
Worked solution
$A$ reduces to $I_3$, whose rows are the standard basis vectors.
Answer: $\operatorname{Row}A = \mathbb R^3$, basis $\{(1,0,0), (0,1,0), (0,0,1)\}$
How did you do? Full marks Half Missed it
5
Find the left null space of $A$ (the solutions of $A^T\mathbf x = \mathbf 0$).
2 pts
Fractions, decimals, sqrt(…) and lists separated by commas all work.
Check
Show solution
Worked solution
A square matrix with independent columns also has independent rows, so $A^T$ is invertible.
$A^T\mathbf x = \mathbf 0$ has only $\mathbf x = \mathbf 0$.
Answer: Left null space $= \{\mathbf 0\}$
Question 4: Eigenvalues and eigenvectors 6 PTS
$$A = \begin{bmatrix}4 & 1 & -1 \\ 2 & 5 & -2 \\ 1 & 1 & 2\end{bmatrix}$$
1
Find the eigenvalues of $A$.
2 pts
Fractions, decimals, sqrt(…) and lists separated by commas all work.
Check
Show solution
Worked solution
$\det(A - \lambda I) = -\lambda^3 + 11\lambda^2 - 39\lambda + 45 = -(\lambda - 3)^2(\lambda - 5)$.
Answer: $\lambda_1 = 3$ (multiplicity 2), $\lambda_2 = 5$
2
Find the eigenvector for the largest eigenvalue.
2 pts
Fractions, decimals, sqrt(…) and lists separated by commas all work.
Check
Show solution
Worked solution
$A - 5I = \begin{bmatrix}-1 & 1 & -1 \\ 2 & 0 & -2 \\ 1 & 1 & -3\end{bmatrix}$ reduces to $x_1 = x_3$, $x_2 = 2x_3$.
Answer: $\mathbf v = \alpha(1, 2, 1)$, $\alpha \neq 0$
3
Can you find $A^2$ using the eigen-decomposition $A = SDS^{-1}$?
2 pts
Worked solution
$A - 3I = \begin{bmatrix}1 & 1 & -1 \\ 2 & 2 & -2 \\ 1 & 1 & -1\end{bmatrix}$ has rank 1, so the eigenspace for $\lambda = 3$ is 2-dimensional: $x_1 = -x_2 + x_3$ gives $(-1, 1, 0)$ and $(1, 0, 1)$.
With $(1, 2, 1)$ for $\lambda = 5$ that is three independent eigenvectors: $A$ is diagonalizable.
$$S = \begin{bmatrix}-1 & 1 & 1 \\ 1 & 0 & 2 \\ 0 & 1 & 1\end{bmatrix},\quad D = \begin{bmatrix}3 & 0 & 0 \\ 0 & 3 & 0 \\ 0 & 0 & 5\end{bmatrix},\quad A^2 = SD^2S^{-1} = \begin{bmatrix}17 & 8 & -8 \\ 16 & 25 & -16 \\ 8 & 8 & 1\end{bmatrix}$$
Answer: Yes.
Note on the original key: The official key answers No, claiming the eigenvector matrix has two identical columns. That is wrong: a repeated eigenvalue only blocks diagonalization when its eigenspace is too small, and here it has dimension 2. You can check the result: squaring A directly gives the same matrix.
Question 5: Orthogonality and least squares 4 PTS
$$A = \begin{bmatrix}1 & -1 & 2 \\ -1 & 1 & 0 \\ 1 & 2 & -1\end{bmatrix}$$
1
Orthogonalize the columns of $A$ with the Gram-Schmidt process.
2 pts
Fractions, decimals, sqrt(…) and lists separated by commas all work.
Check
Show solution
Worked solution
$\mathbf u_1 = \mathbf a_1 = (1, -1, 1)$.
$\mathbf a_2\cdot\mathbf u_1 = -1 - 1 + 2 = 0$, so $\mathbf u_2 = \mathbf a_2 = (-1, 1, 2)$.
$\mathbf u_3 = \mathbf a_3 - \tfrac{\mathbf a_3\cdot\mathbf u_1}{\mathbf u_1\cdot\mathbf u_1}\mathbf u_1 - \tfrac{\mathbf a_3\cdot\mathbf u_2}{\mathbf u_2\cdot\mathbf u_2}\mathbf u_2 = (2, 0, -1) - \tfrac13(1, -1, 1) + \tfrac46(-1, 1, 2) = (1, 1, 0)$.
Normalize: $\mathbf e_1 = \tfrac{1}{\sqrt3}(1, -1, 1)$, $\mathbf e_2 = \tfrac{1}{\sqrt6}(-1, 1, 2)$, $\mathbf e_3 = \tfrac{1}{\sqrt2}(1, 1, 0)$.
Answer: Orthonormal columns $\mathbf e_1, \mathbf e_2, \mathbf e_3$ as above
2
Using that result, find the QR decomposition of $A$.
2 pts
Type sqrt(3) or √3; decimals also work.
Check
Show solution
Worked solution
$Q = \begin{bmatrix}\mathbf e_1 & \mathbf e_2 & \mathbf e_3\end{bmatrix}$ and, since $Q^TQ = I$, $R = Q^TA$.
$R_{ij} = \mathbf e_i\cdot\mathbf a_j$: $R_{11} = \sqrt3$, $R_{12} = 0$, $R_{13} = \tfrac{1}{\sqrt3}$, $R_{22} = \sqrt6$, $R_{23} = -\tfrac{4}{\sqrt6}$, $R_{33} = \sqrt2$.
$$Q = \begin{bmatrix}\tfrac{\sqrt3}{3} & -\tfrac{\sqrt6}{6} & \tfrac{\sqrt2}{2} \\ -\tfrac{\sqrt3}{3} & \tfrac{\sqrt6}{6} & \tfrac{\sqrt2}{2} \\ \tfrac{\sqrt3}{3} & \tfrac{\sqrt6}{3} & 0\end{bmatrix},\quad R = \begin{bmatrix}\sqrt3 & 0 & \tfrac{\sqrt3}{3} \\ 0 & \sqrt6 & -\tfrac{2\sqrt6}{3} \\ 0 & 0 & \sqrt2\end{bmatrix}$$
Answer: $A = QR$ with $Q$, $R$ as above
Result:
Every part is marked. Auto-checked parts count what you typed; written parts count your own marks. Use Reset to try again.