If P is a projection matrix. What are the possible values of det(P)?
If $P$ is a projection matrix, then we know that $P^T = P$ and that $P^2=P$. We can then take the determinant of both sides of the second equation to obtain that $$\det P^2 = \det P \implies (\det P)(\det P) = \det P \implies (\det P)^2 = \det P$$ There are then two possible values for $\det P$:
A Hadamard matrix H is a matrix with entries ±1 and orthogonal columns. What is the determinant of H as a function of n? (Hadamard matrices are conjectured to exist for every n that is a multiple of 4, but nobody knows if there is such a matrix even for n=668) (See mathoverflow for example.) If you stumble on a Hadamard matrix of size 668 please let us know. (Extremely unlikely don't waste much time looking and definitely not juliabox cycles.)
There is a simple recursive construction for powers of 2, if you would like to play with some easy Hadamard matrices in Julia: (you are not expected to understand the Julia syntax but if you are curious you can look up the ternary operator ( a compact if then else) and the Kronecker product.
using LinearAlgebra
A = [1 1;1 -1]
H(k) = k==1 ? A : kron( H(k-1), A) # Creates a 2ᵏ by 2ᵏ Hadamard matrix
H (generic function with 1 method)
A = H(2);
Since the columns of $H$ are all orthogonal to each other, the product $H^TH$ will be a diagonal matrix. The entries along the diagonal are then the magnitudes squared of each of the columns of $H$. Since every column of $H$ contains only $\pm 1$, every column of $H$ will have magnitude $\sqrt{n}$. Hence $\boxed{H^TH = n I}$.
We can then take the determinant of this relationship to deduce that $\;\; \det(H^TH) = \det (nI) \implies (\det H )^2 = n^n$ $$\implies \boxed{\det H = \pm n^{n/2}}$$
Find a 3x3 matrix with entries 0 and 1 with determinant -2,-1,0, and 1,2. (Okay to use rand(0:1,3,3) if it helps but don't forget using LinearAlgebra)
What is the pattern in the formula for the determinant of S(n) given by the Julia code below? You may see it by inspecting, but ultimately you should figure it out by math.
# using LinearAlgebra
S(n) = SymTridiagonal( fill(3,n), fill(1,n-1))
S (generic function with 1 method)
S(5)
5×5 SymTridiagonal{Int64,Array{Int64,1}}: 3 1 ⋅ ⋅ ⋅ 1 3 1 ⋅ ⋅ ⋅ 1 3 1 ⋅ ⋅ ⋅ 1 3 1 ⋅ ⋅ ⋅ 1 3
[det(S(n)) for n=1:6]
6-element Array{Int64,1}: 3 8 21 55 144 377
Let us denote the determinant of $S(n)$ by $D_n = \det( S(n) )$. Then \begin{align*} D_n &= \begin{vmatrix} 3 & 1 & & & & \\ 1 & 3 & 1 & & & \\ & 1 & 3 & 1 & & \\ & & \cdot & \cdot & \cdot & \\ & & & \cdot & \cdot & 1 \\ & & & & 1 & 3 \end{vmatrix} \\ &= 3 \times \begin{vmatrix} 3 & 1 & & & \\ 1 & 3 & 1 & & \\ & \cdot & \cdot & \cdot & \\ & & \cdot & \cdot & 1 \\ & & & 1 & 3 \end{vmatrix} -1\times \begin{vmatrix} 1 & 1 & & & \\ & 3 & 1 & & \\ & \cdot & \cdot & \cdot & \\ & & \cdot & \cdot & 1 \\ & & & 1 & 3 \end{vmatrix} \\ &= 3D_{n-1} -1\times \left(1\times \begin{vmatrix} 3 & 1 & & & \\ 1 & 3 & 1 & & \\ & & \cdot & \cdot & 1 \\ & & & 1 & 3 \end{vmatrix} -1\times \begin{vmatrix} 0 & 1 & & \\ 0 & \cdot & \cdot & \\ 0 & \cdot & \cdot & 1 \\ 0 & & 1 & 3 \end{vmatrix}\right)\\ &= 3D_{n-1} - D_{n-2} \end{align*}
The recurrence relation $$\boxed{D_n = 3D_{n-1} - D_{n-2}}$$ is the relationship between determinants for $S(n)$.
It is not required for this problem, but we can solve this difference equation explicitly, using techniques you may have seen in 18.03, or elsewhere. The general solution to this difference equation is $$D_n = a\left(\frac{3+\sqrt{5}}{2}\right)^n + b\left(\frac{3-\sqrt{5}}{2}\right)^n$$ The coefficients $a,b$ are determined by the conditions that $D_1 = 3$ and $D_2 = 8$.
If you know all 16 cofactors of a 4x4 invertible matrix A, how would you find A?
We know that we can find the inverse of $A$ as $$A^{-1} = \frac{C^T}{\det A}.$$ Where $C$ is the $4\times 4$ matrix of cofactors. If we can express $\det A$ in terms of $C$, we can then obtain $A^{-1}$ just in terms of the cofactors. Once we have $A^{-1}$, we can invert this matrix to find $A$.
We can multiply both sides of the above equation by $A$ to obtain $$I = \frac{AC^T}{\det A} \;\; \implies \;\; AC^T = (\det A) I .$$ We can then take the determinant of this equation: \begin{align*} \det (AC^T) &= \det ((\det A) I)\\ \implies (\det A)(\det C^T) &= (\det A)^4 \\ \implies \det C^T &= (\det A)^{3} \end{align*}
and finally using the fact that $\det C = \det C^T$ for any matrix, we have that $\det C = (\det A)^{3}$. We can invert this equation to write that
$$\boxed{\det A = (\det C)^{1/3)}}$$We can then find $A^{-1}$ just from the cofactors of $A$. Hence we can find $A$ just from its cofactors via
$$\boxed{ A = (\det C)^{1/3}(C^T)^{-1}}$$A square matrix is said to be upper-Hessenberg if it has non-zeros in the upper triangle and the diagonal below the main diagonal. If A is square upper Hessenberg, does the determinant of A depend on the entry in the top right? If so, how?
A $n\times n$ upper-Hessenberg matrix has the form
$$A = \begin{pmatrix} a_{11} & a_{12} & a_{13} & \cdots & a_{1n} \\ a_{21} & a_{22} & a_{23} & \cdots & a_{2n} \\ 0 & a_{32} & a_{33} & \cdots & a_{3n}\\ 0 & 0 & \ddots & \ddots & \vdots \\ 0 & 0 & \cdots & a_{n(n-1)} & a_{nn} \end{pmatrix}$$The determinant of this matrix can be obtain using the cofactor expansion: $$\det A = a_{11}C_{11} + a_{12}C_{12} + ... + a_{1n}C_{1n}$$ None of the cofactors will depend on the upper right entry $a_{1n}$, since they are all calculated by taking the determinant of a submatrix which is obtained by removing the first row of $A$. Therefore the only part of $\det A$ that depends on $a_{1n}$ is the last term in the cofactor expansion of $\det A$. Hence $\det A$ will depend linearly on $a_{1n}$.
We can actually calculate the cofactor $C_{1n}$ explicitly, since $$C_{1n}=(-)^{1+n}\det M_{1n}.$$ Now $M_{1n}$ is the submatrix obtained by removing the first row and the last column of $A$. But this matrix is upper triangular, and so $\det M_{1n} = \prod_{i=1}^{n-1} a_{(i+1)i}$
This means that $$\partial(\det(A))/\partial(a_{1n}) =C_{1n}=(-)^{1+n}\prod_{i=1}^{n-1} a_{(i+1)i} $$
What is $\partial(\det(A))/\partial(A_{11})$ Hint: use the cofactor expansion?
The determinant of a matrix can be obtain using the cofactor expansion: $$\det A = A_{11}C_{11} + A_{12}C_{12} + ... + A_{1n}C_{1n}$$ None of the cofactors will depend on the entry $A_{11}$, since they are all calculated by taking the determinant of a submatrix which is obtained by removing the first row of $A$. Therefore the only part of $\det A$ that depends on $A_{11}$ is the first term in the cofactor expansion of $\det A$.
Hence $$\boxed{\partial(\det(A))/\partial(A_{11}) = C_{11}} $$