# Linear Algebra/Exploration/Solutions
## Solutions

    This exercise is recommended for all readers.

### Problem 1

Evaluate the determinant of each.
* ${\begin{pmatrix}3&1\\-1&1\end{pmatrix}}$
* ${\begin{pmatrix}2&0&1\\3&1&1\\-1&0&1\end{pmatrix}}$
* ${\begin{pmatrix}4&0&1\\0&0&1\\1&3&-1\end{pmatrix}}$

### Answer

* $4$
* $3$
* $-12$

### Problem 2

Evaluate the determinant of each.
* ${\begin{pmatrix}2&0\\-1&3\end{pmatrix}}$
* ${\begin{pmatrix}2&1&1\\0&5&-2\\1&-3&4\end{pmatrix}}$
* ${\begin{pmatrix}2&3&4\\5&6&7\\8&9&1\end{pmatrix}}$

### Answer

* $6$
* $21$
* $27$
    This exercise is recommended for all readers.

### Problem 3

Verify that the determinant of an upper-triangular $3\!\times \!3$ matrix is the product down the diagonal.
    $\det({\begin{pmatrix}a&b&c\\0&e&f\\0&0&i\end{pmatrix}})=aei$
Do lower-triangular matrices work the same way?

### Answer

For the first, apply the formula in this section, note that any term with a $d$, $g$, or $h$ is zero, and simplify. Lower-triangular matrices work the same way.
    This exercise is recommended for all readers.

### Problem 4

Use the determinant to decide if each is singular or nonsingular.
* ${\begin{pmatrix}2&1\\3&1\end{pmatrix}}$
* ${\begin{pmatrix}0&1\\1&-1\end{pmatrix}}$
* ${\begin{pmatrix}4&2\\2&1\end{pmatrix}}$

### Answer

* Nonsingular, the determinant is $-1$.
* Nonsingular, the determinant is $-1$.
* Singular, the determinant is $0$.

### Problem 5

Singular or nonsingular? Use the determinant to decide.
* ${\begin{pmatrix}2&1&1\\3&2&2\\0&1&4\end{pmatrix}}$
* ${\begin{pmatrix}1&0&1\\2&1&1\\4&1&3\end{pmatrix}}$
* ${\begin{pmatrix}2&1&0\\3&-2&0\\1&0&0\end{pmatrix}}$

### Answer

* Nonsingular, the determinant is $3$.
* Singular, the determinant is $0$.
* Singular, the determinant is $0$.
    This exercise is recommended for all readers.

### Problem 6

Each pair of matrices differ by one row operation. Use this operation to compare $\det(A)$ with $\det(B)$.
* $A={\begin{pmatrix}1&2\\2&3\end{pmatrix}}$ $B={\begin{pmatrix}1&2\\0&-1\end{pmatrix}}$
* $A={\begin{pmatrix}3&1&0\\0&0&1\\0&1&2\end{pmatrix}}$ $B={\begin{pmatrix}3&1&0\\0&1&2\\0&0&1\end{pmatrix}}$
* $A={\begin{pmatrix}1&-1&3\\2&2&-6\\1&0&4\end{pmatrix}}$ $B={\begin{pmatrix}1&-1&3\\1&1&-3\\1&0&4\end{pmatrix}}$

### Answer

* $\det(B)=\det(A)$ via $-2\rho _{1}+\rho _{2}$
* $\det(B)=-\det(A)$ via $\rho _{2}\leftrightarrow \rho _{3}$
* $\det(B)=(1/2)\cdot \det(A)$ via $(1/2)\rho _{2}$

### Problem 7

Show this.
    $\det({\begin{pmatrix}1&1&1\\a&b&c\\a^{2}&b^{2}&c^{2}\end{pmatrix}})=(b-a)(c-a)(c-b)$

### Answer

Using the formula for the determinant of a $3\!\times \!3$ matrix we expand the left side
    $1\cdot b\cdot c^{2}+1\cdot c\cdot a^{2}+1\cdot a\cdot b^{2}-b^{2}\cdot c\cdot 1-c^{2}\cdot a\cdot 1-a^{2}\cdot b\cdot 1$
and by distributing we expand the right side.
    $(bc-ba-ac+a^{2})\cdot (c-b)=c^{2}b-b^{2}c-bac+b^{2}a-ac^{2}+acb+a^{2}c-a^{2}b$
Now we can just check that the two are equal. (Remark. This is the $3\!\times \!3$ case of Vandermonde's determinant which arises in applications).
    This exercise is recommended for all readers.

### Problem 8

Which real numbers $x$ make this matrix singular?
    ${\begin{pmatrix}12-x&4\\8&8-x\end{pmatrix}}$

### Answer

This equation
    $0=\det({\begin{pmatrix}12-x&4\\8&8-x\end{pmatrix}})=64-20x+x^{2}=(x-16)(x-4)$
has roots $x=16$ and $x=4$.

### Problem 9

Do the Gaussian reduction to check the formula for $3\!\times \!3$ matrices stated in the preamble to this section.
${\begin{pmatrix}a&b&c\\d&e&f\\g&h&i\end{pmatrix}}$ is nonsingular iff $aei+bfg+cdh-hfa-idb-gec\neq 0$

### Answer

We first reduce the matrix to echelon form. To begin, assume that $a\neq 0$ and that $ae-bd\neq 0$.
    ${\begin{array}{rcl}{\xrightarrow[]{(1/a)\rho _{1}}}\;{\begin{pmatrix}1&b/a&c/a\\d&e&f\\g&h&i\end{pmatrix}}&{\xrightarrow[{-g\rho _{1}+\rho _{3}}]{-d\rho _{1}+\rho _{2}}}&{\begin{pmatrix}1&b/a&c/a\\0&(ae-bd)/a&(af-cd)/a\\0&(ah-bg)/a&(ai-cg)/a\end{pmatrix}}\\&{\xrightarrow[]{(a/(ae-bd))\rho _{2}}}&{\begin{pmatrix}1&b/a&c/a\\0&1&(af-cd)/(ae-bd)\\0&(ah-bg)/a&(ai-cg)/a\end{pmatrix}}\end{array}}$
This step finishes the calculation.
    ${\xrightarrow[]{((ah-bg)/a)\rho _{2}+\rho _{3}}}{\begin{pmatrix}1&b/a&c/a\\0&1&(af-cd)/(ae-bd)\\0&0&(aei+bgf+cdh-hfa-idb-gec)/(ae-bd)\end{pmatrix}}$
Now assuming that $a\neq 0$ and $ae-bd\neq 0$, the original matrix is nonsingular if and only if the $3,3$ entry above is nonzero. That is, under the assumptions, the original matrix is nonsingular if and only if $aei+bgf+cdh-hfa-idb-gec\neq 0$, as required.
We finish by running down what happens if the assumptions that were taken for convienence in the prior paragraph do not hold. First, if $a\neq 0$ but $ae-bd=0$ then we can swap
    ${\begin{pmatrix}1&b/a&c/a\\0&0&(af-cd)/a\\0&(ah-bg)/a&(ai-cg)/a\end{pmatrix}}{\xrightarrow[]{\rho _{2}\leftrightarrow \rho _{3}}}{\begin{pmatrix}1&b/a&c/a\\0&(ah-bg)/a&(ai-cg)/a\\0&0&(af-cd)/a\end{pmatrix}}$
and conclude that the matrix is nonsingular if and only if either $ah-bg=0$ or $af-cd=0$. The condition "$ah-bg=0$ or $af-cd=0$" is equivalent to the condition "$(ah-bg)(af-cd)=0$". Multiplying out and using the case assumption that $ae-bd=0$ to substitute $ae$ for $bd$ gives this.
    $0=ahaf-ahcd-bgaf+bgcd=ahaf-ahcd-bgaf+aegc=a(haf-hcd-bgf+egc)$
Since $a\neq 0$, we have that the matrix is nonsingular if and only if $haf-hcd-bgf+egc=0$. Therefore, in this $a\neq 0$ and $ae-bd=0$ case, the matrix is nonsingular when $haf-hcd-bgf+egc-i(ae-bd)=0$.
The remaining cases are routine. Do the $a=0$ but $d\neq 0$ case and the $a=0$ and $d=0$ but $g\neq 0$ case by first swapping rows and then going on as above. The $a=0$, $d=0$, and $g=0$ case is easy— that matrix is singular since the columns form a linearly dependent set, and the determinant comes out to be zero.

### Problem 10

Show that the equation of a line in $\mathbb {R} ^{2}$ thru $(x_{1},y_{1})$ and $(x_{2},y_{2})$ is expressed by this determinant.
    $\det({\begin{pmatrix}x&y&1\\x_{1}&y_{1}&1\\x_{2}&y_{2}&1\end{pmatrix}})=0\qquad x_{1}\neq x_{2}$

### Answer

Figuring the determinant and doing some algebra gives this.
    ${\begin{array}{rl}0&=y_{1}x+x_{2}y+x_{1}y_{2}-y_{2}x-x_{1}y-x_{2}y_{1}\\(x_{2}-x_{1})\cdot y&=(y_{2}-y_{1})\cdot x+x_{2}y_{1}-x_{1}y_{2}\\y&={\frac {y_{2}-y_{1}}{x_{2}-x_{1}}}\cdot x+{\frac {x_{2}y_{1}-x_{1}y_{2}}{x_{2}-x_{1}}}\end{array}}$
Note that this is the equation of a line (in particular, in contains the familiar expression for the slope), and note that $(x_{1},y_{1})$ and $(x_{2},y_{2})$ satisfy it.
    This exercise is recommended for all readers.

### Problem 11

Many people know this mnemonic for the determinant of a $3\!\times \!3$ matrix: first repeat the first two columns and then sum the products on the forward diagonals and subtract the products on the backward diagonals. That is, first write
    $\left({\begin{array}{ccc|cc}h_{1,1}&h_{1,2}&h_{1,3}&h_{1,1}&h_{1,2}\\h_{2,1}&h_{2,2}&h_{2,3}&h_{2,1}&h_{2,2}\\h_{3,1}&h_{3,2}&h_{3,3}&h_{3,1}&h_{3,2}\end{array}}\right)$
and then calculate this.
    ${\begin{array}{l}h_{1,1}h_{2,2}h_{3,3}+h_{1,2}h_{2,3}h_{3,1}+h_{1,3}h_{2,1}h_{3,2}\\\quad -h_{3,1}h_{2,2}h_{1,3}-h_{3,2}h_{2,3}h_{1,1}-h_{3,3}h_{2,1}h_{1,2}\end{array}}$
* Check that this agrees with the formula given in the preamble to this section.
* Does it extend to other-sized determinants?

### Answer

* The comparison with the formula given in the preamble to this section is easy.
* While it holds for $2\!\times \!2$ matrices it does not hold for $4\!\times \!4$ matrices. An example is that this matrix is singular because the second and third rows are equal but following the scheme of the mnemonic does not give zero.
    ${\begin{array}{rl}\left({\begin{array}{cc|c}h_{1,1}&h_{1,2}&h_{1,1}\\h_{2,1}&h_{2,2}&h_{2,1}\end{array}}\right)&={\begin{array}{l}h_{1,1}h_{2,2}+h_{1,2}h_{2,1}\\\quad -h_{2,1}h_{1,2}-h_{2,2}h_{1,1}\end{array}}\\&=h_{1,1}h_{2,2}-h_{1,2}h_{2,1}\end{array}}$
    ${\begin{pmatrix}1&0&0&1\\0&1&1&0\\0&1&1&0\\-1&0&0&1\end{pmatrix}}$
    $\left({\begin{array}{cccc|ccc}1&0&0&1&1&0&0\\0&1&1&0&0&1&1\\0&1&1&0&0&1&1\\-1&0&0&1&-1&0&0\end{array}}\right)={\begin{array}{l}1+0+0+0\\\quad -(-1)-0-0-0\end{array}}$

### Problem 12

The cross product of the vectors
    ${\vec {x}}={\begin{pmatrix}x_{1}\\x_{2}\\x_{3}\end{pmatrix}}\qquad {\vec {y}}={\begin{pmatrix}y_{1}\\y_{2}\\y_{3}\end{pmatrix}}$
is the vector computed as this determinant.
    ${\vec {x}}\times {\vec {y}}=\det({\begin{pmatrix}{\vec {e}}_{1}&{\vec {e}}_{2}&{\vec {e}}_{3}\\x_{1}&x_{2}&x_{3}\\y_{1}&y_{2}&y_{3}\end{pmatrix}})$
Note that the first row is composed of vectors, the vectors from the standard basis for $\mathbb {R} ^{3}$. Show that the cross product of two vectors is perpendicular to each vector.

### Answer

The determinant is $(x_{2}y_{3}-x_{3}y_{2}){\vec {e}}_{1}+(x_{3}y_{1}-x_{1}y_{3}){\vec {e}}_{2}+(x_{1}y_{2}-x_{2}y_{1}){\vec {e}}_{3}$. To check perpendicularity, we check that the dot product with the first vector is zero
    ${\begin{pmatrix}x_{1}\\x_{2}\\x_{3}\end{pmatrix}}\cdot {\begin{pmatrix}x_{2}y_{3}-x_{3}y_{2}\\x_{3}y_{1}-x_{1}y_{3}\\x_{1}y_{2}-x_{2}y_{1}\end{pmatrix}}=x_{1}x_{2}y_{3}-x_{1}x_{3}y_{2}+x_{2}x_{3}y_{1}-x_{1}x_{2}y_{3}+x_{1}x_{3}y_{2}-x_{2}x_{3}y_{1}=0$
and the dot product with the second vector is also zero.
    ${\begin{pmatrix}y_{1}\\y_{2}\\y_{3}\end{pmatrix}}\cdot {\begin{pmatrix}x_{2}y_{3}-x_{3}y_{2}\\x_{3}y_{1}-x_{1}y_{3}\\x_{1}y_{2}-x_{2}y_{1}\end{pmatrix}}=x_{2}y_{1}y_{3}-x_{3}y_{1}y_{2}+x_{3}y_{1}y_{2}-x_{1}y_{2}y_{3}+x_{1}y_{2}y_{3}-x_{2}y_{1}y_{3}=0$

### Problem 13

Prove that each statement holds for $2\!\times \!2$ matrices.
* The determinant of a product is the product of the determinants $\det(ST)=\det(S)\cdot \det(T)$.
* If $T$ is invertible then the determinant of the inverse is the inverse of the determinant $\det(T^{-1})=(\,\det(T)\,)^{-1}$.
Matrices $T$ and $T^{\prime }$ are similar if there is a nonsingular matrix $P$ such that $T^{\prime }=PTP^{-1}$. (This definition is in Chapter Five.) Show that similar $2\!\times \!2$ matrices have the same determinant.

### Answer

* Plug and chug: the determinant of the product is this while the product of the determinants is this. Verification that they are equal is easy.
    ${\begin{array}{rl}\det({\begin{pmatrix}a&b\\c&d\end{pmatrix}}{\begin{pmatrix}w&x\\y&z\end{pmatrix}})&=\det({\begin{pmatrix}aw+by&ax+bz\\cw+dy&cx+dz\end{pmatrix}})\\&={\begin{array}{l}acwx+adwz+bcxy+bdyz\\\quad -acwx-bcwz-adxy-bdyz\end{array}}\end{array}}$
    $\det({\begin{pmatrix}a&b\\c&d\end{pmatrix}})\cdot \det({\begin{pmatrix}w&x\\y&z\end{pmatrix}})=(ad-bc)\cdot (wz-xy)$
* Use the prior item.
That similar matrices have the same determinant is immediate from the above two: $\det(PTP^{-1})=\det(P)\cdot \det(T)\cdot \det(P^{-1})$.
    This exercise is recommended for all readers.

### Problem 14

Prove that the area of this region in the plane
is equal to the value of this determinant.
    $\det({\begin{pmatrix}x_{1}&x_{2}\\y_{1}&y_{2}\end{pmatrix}})$
Compare with this.
    $\det({\begin{pmatrix}x_{2}&x_{1}\\y_{2}&y_{1}\end{pmatrix}})$

### Answer

One way is to count these areas
by taking the area of the entire rectangle and subtracting the area of $A$ the upper-left rectangle, $B$ the upper-middle triangle, $D$ the upper-right triangle, $C$ the lower-left triangle, $E$ the lower-middle triangle, and $F$ the lower-right rectangle
$(x_{1}+x_{2})(y_{1}+y_{2})-x_{2}y_{1}-(1/2)x_{1}y_{1}-(1/2)x_{2}y_{2}-(1/2)x_{2}y_{2}-(1/2)x_{1}y_{1}-x_{2}y_{1}$. Simplification gives the determinant formula.
This determinant is the negative of the one above; the formula distinguishes whether the second column is counterclockwise from the first.

### Problem 15

Prove that for $2\!\times \!2$ matrices, the determinant of a matrix equals the determinant of its transpose. Does that also hold for $3\!\times \!3$ matrices?

### Answer

The computation for $2\!\times \!2$ matrices, using the formula quoted in the preamble, is easy. It does also hold for $3\!\times \!3$ matrices; the computation is routine.
    This exercise is recommended for all readers.

### Problem 16

Is the determinant function linear — is $\det(x\cdot T+y\cdot S)=x\cdot \det(T)+y\cdot \det(S)$?

### Answer

No. Recall that constants come out one row at a time.
    $\det({\begin{pmatrix}2&4\\2&6\\\end{pmatrix}})=2\cdot \det({\begin{pmatrix}1&2\\2&6\\\end{pmatrix}})=2\cdot 2\cdot \det({\begin{pmatrix}1&2\\1&3\\\end{pmatrix}})$
This contradicts linearity (here we didn't need $S$, i.e., we can take $S$ to be the zero matrix).

### Problem 17

Show that if $A$ is $3\!\times \!3$ then $\det(c\cdot A)=c^{3}\cdot \det(A)$ for any scalar $c$.

### Answer

Bring out the $c$'s one row at a time.

### Problem 18

Which real numbers $\theta$ make
    ${\begin{pmatrix}\cos \theta &-\sin \theta \\\sin \theta &\cos \theta \end{pmatrix}}$
singular? Explain geometrically.

### Answer

There are no real numbers $\theta$ that make the matrix singular because the determinant of the matrix $\cos ^{2}\theta +\sin ^{2}\theta$ is never $0$, it equals $1$ for all $\theta$. Geometrically, with respect to the standard basis, this matrix represents a rotation of the plane through an angle of $\theta$. Each such map is one-to-one — for one thing, it is invertible.

### ? Problem 19

If a third order determinant has elements $1$, $2$, ..., $9$, what is the maximum value it may have? (Haggett & Saunders 1955)

### Answer

This is how the answer was given in the cited source. Let $P$ be the sum of the three positive terms of the determinant and $-N$ the sum of the three negative terms. The maximum value of $P$ is
    $9\cdot 8\cdot 7+6\cdot 5\cdot 4+3\cdot 2\cdot 1=630.$
The minimum value of $N$ consistent with $P$ is
    $9\cdot 6\cdot 1+8\cdot 5\cdot 2+7\cdot 4\cdot 3=218.$
Any change in $P$ would result in lowering that sum by more than $4$. Therefore $412$ the maximum value for the determinant and one form for the determinant is
    ${\begin{vmatrix}9&4&2\\3&8&6\\5&1&7\end{vmatrix}}.$

## References

* Haggett, Vern (proposer); Saunders, F. W. (solver) (1955), "Elementary problem 1135", American Mathematical Monthly, American Mathematical Society, 62 (5): 257 {{citation}}: Unknown parameter |month= ignored (help)