%display latex
latex.matrix_delimiters(left="[", right="]")
$\newcommand{\la}{\langle}$ $\newcommand{\ra}{\rangle}$ $\newcommand{\vu}{\mathbf{u}}$ $\newcommand{\vv}{\mathbf{v}}$ $\newcommand{\vw}{\mathbf{w}}$ $\newcommand{\vzz}{\mathbf{z}}$ $\newcommand{\nc}{\newcommand}$ $\nc{\Cc}{\mathbb{C}}$ $\nc{\Rr}{\mathbb{R}}$ $\nc{\Qq}{\mathbb{Q}}$ $\nc{\Nn}{\mathbb{N}}$ $\nc{\cB}{\mathcal{B}}$ $\nc{\cE}{\mathcal{E}}$ $\nc{\cC}{\mathcal{C}}$ $\nc{\cD}{\mathcal{D}}$ $\nc{\mi}{\mathbf{i}}$ $\nc{\sp}[1]{\langle #1 \rangle}$ $\nc{\ol}[1]{\overline{#1} }$ $\nc{\norm}[1]{\left\| #1 \right\|}$ $\nc{\abs}[1]{\left| #1 \right|}$ $\nc{\vz}{\mathbf{0}}$ $\nc{\vo}{\mathbf{1}}$ $\nc{\DMO}{\DeclareMathOperator}$ $\DMO{\tr}{tr}$ $\DMO{\nullsp}{nullsp}$ $\nc{\va}{\mathbf{a}}$ $\nc{\vb}{\mathbf{b}}$ $\nc{\vx}{\mathbf{x}}$ $\nc{\ve}{\mathbf{e}}$ $\nc{\vd}{\mathbf{d}}$ $\nc{\vh}{\mathbf{h}}$ $\nc{\ds}{\displaystyle}$ $\nc{\bm}[1]{\begin{bmatrix} #1 \end{bmatrix}}$ $\nc{\gm}[2]{\bm{\mid & \cdots & \mid \\ #1 & \cdots & #2 \\ \mid & \cdots & \mid}}$ $\nc{\MN}{M_{m \times n}(K)}$ $\nc{\NM}{M_{n \times m}(K)}$ $\nc{\NP}{M_{n \times p}(K)}$ $\nc{\MP}{M_{m \times p}(K)}$ $\nc{\PN}{M_{p \times n}(K)}$ $\nc{\NN}{M_n(K)}$ $\nc{\im}{\mathrm{Im\ }}$ $\nc{\ev}{\mathrm{ev}}$ $\nc{\Hom}{\mathrm{Hom}}$ $\nc{\com}[1]{[\phantom{a}]^{#1}}$ $\nc{\rBD}[1]{ [#1]_{\cB}^{\cD}}$ $\DMO{\id}{id}$ $\DMO{\rk}{rk}$ $\DMO{\nullity}{nullity}$ $\DMO{\End}{End}$ $\DMO{\proj}{proj}$ $\nc{\GL}{\mathrm{GL}}$
Suppose $\det\bm{a & 1 & d\\ b & 1 & e \\ c & 1 & f} = -4$ and $\det\bm{a & 1& d\\ b & 2& e \\ c& 3& f} = -3$.
Then compute the determinant of the following matrices by Properties 1--4 in Notes 10. Even though they were stated for rows but since $\det(A^T) = \det(A)$, so they apply equally well for columns.
By Property 2, $\det\bm{a & 5 & d\\ b & 5 & e \\ c & 5 & f} = 5\det\bm{a & 1 & d\\ b & 1 & e \\ c & 1 & f} = 5(-4) = 20$.
To find $\det\bm{a & -1 & d\\ b & -3 & e \\ c & -5 & f}$ from the given determinants, we need to express $\bm{-1 \\ -3 \\-5}$ as a linear combination of $\bm{1 \\1 \\1}$ and $\bm{1 \\2 \\3}$. Solving $\bm{1 & 1 \\ 1& 2\\ 1& 3}\bm{x \\y} = \bm{-1 \\-3 \\-5}$, we get $\bm{x \\y} = \bm{1 \\-2}$. Therefore, by Property 2 and 3 of Notes 10, $$ \det\bm{a & -1 & d\\ b & -3 & e \\ c & -5 & f} = (1)\det\bm{a & 1 & d\\ b & 1 & e \\ c & 1 & f} + (-2)\det\bm{a & 1& d\\ b & 2& e \\ c& 3& f} = (1)(-4) + (-2)(-3) = 2. $$
Let $A$ be the $n \times n$ matrix with all entries $1$.
Compute the determinant of $M = kA - I_n$. For example, if $n=4, k=7$, then $M$ is the following matrix
M = 7*matrix(4,4,lambda i,j:1) - identity_matrix(4); M
Our strategy is to perform EROs on $M$ to the point that we can compute the determinant of the resulting matrix and then relate it back to the determinant of $M$.
We start by subtracting each row from the row above, i.e. for $2 \le i \le n$, do $-R_i + R_{i-1} \to R_{i-1}$. Let's illustrate this with our example:
M.add_multiple_of_row(0,1,-1); M
Instead of doing it for a number of times by hand, we do it by a for-loop.
for i in [2..M.nrows()-1]:
M.add_multiple_of_row(i-1,i,-1)
M
Next, we eliminate the entries of the last row, by add a situable multiple of each row to the last. That is for $1 \le i \le n-1$, do $(ik)R_i + R_n \to R_n$.
To illustrate, let carry out these operations on our example:
M.add_multiple_of_row(3,0,7); M # 7R_1 +R_4 ->R_4
Then $(2k)R_2 + R_n \to R_n$
M.add_multiple_of_row(3,1,14); M # 14R_2 + R_4 -> R_4
and so on ...
M.add_multiple_of_row(3,2,21); M #21R_3 + R_4 -> R_4
After these operations, we arrive to an upper triangular matrix with all diagonal entries $-1$ except the last one is $nk-1$. Since type III ERO do not change determinant, the determinant of $M$ is the same as the last upper triangular matrix which is $(-1)^{n-1}(nk-1) = (-1)^n(1-nk)$.
Substitute $n=4, k=7$, we conclude that the determinant of our example is $(-1)^4(1-(7)(4)) = -27$.
det(M) #verify
We should mention that there is a more theoretical approach to this problem via eigenspaces and characteristic polynomial in MAT 331.
At this juncture, we can just touch upon this approach. Let $x$ be a variable and the determinant of $xI_n-kA$. Note that it is a polynomial, call it $\chi(x)$, of degree $n$. Since $M = kA-I_n$, so $\chi(1) = \det(-M) =(-1)^n\det(M)$.
Now comes to the part that will be cover in MAT 331: in this case, $\chi(x)$ has two roots $0$ and $nk$ (they are the eigenvalues of $kA$). The eigenspace assoicates to 0 has dimension $n-1$ and the eigenspace associates to $nk$ has dimension 1. It follows from this that $0$ is a root of multiplicity $n-1$ and $nk$ is a simply root (i.e. multiplicity 1) of $\chi(x)$. Thus, $$\chi(x) = x^{n-1}(x-nk)$$ and so $\det(M) = (-1)^n\chi(1) = (-1)^n(1-nk)$. That is exactly what we get from our first approach.
Let's take this opportunity to introduce a function in python/SAGE.
In defining the matrix $M$, I used a command called lambda
.
You can use lambda
wherever you want to give a function but don't bother to give it a specific name.
In other words, you can treat lambda
as a generic name of a function.
For instance, lambda i,j: i-j
defined the function $(i,j)\mapsto i-j$.
So the command matrix(3,3,lambda i,j:i-j)
will produce a $3\times 3$ matrix whose $(i,j)$-entry is $i-j$.
matrix(3,3,lambda i,j:i-j)