Computing the determinant of an $n \times n$ matrix

67 Views Asked by At

I am having a problem with computing the determinant of the following $n \times n$ matrix. Can you help me?

$$A = \begin{bmatrix}1 & 1 & \cdots & 1 & 0 & 1 \\ 1 & \kern3mu\raise1mu{.}\kern3mu\raise6mu{.}\kern3mu\raise12mu{.} & 1 & 0 & 1 & 1 \\ \vdots & \kern3mu\raise1mu{.}\kern3mu\raise6mu{.}\kern3mu\raise12mu{.} & \kern3mu\raise1mu{.}\kern3mu\raise6mu{.}\kern3mu\raise12mu{.} & \kern3mu\raise1mu{.}\kern3mu\raise6mu{.}\kern3mu\raise12mu{.} & \kern3mu\raise1mu{.}\kern3mu\raise6mu{.}\kern3mu\raise12mu{.} & \vdots \\ 1 & 0 & 1 & 1 & \kern3mu\raise1mu{.}\kern3mu\raise6mu{.}\kern3mu\raise12mu{.} & 1 \\ 0 & 1 & 1 & \kern3mu\raise1mu{.}\kern3mu\raise6mu{.}\kern3mu\raise12mu{.} & 1 & 1 \\ 1 & 1 & \cdots & 1 & 1 & 1\end{bmatrix}$$

1

There are 1 best solutions below

0
On

Since adding multiples of any row of a matrix to another row leaves the determinant unchanged, we can subtract the last row of the matrix from all of the other row to obtain the matrix $$ \det A = \begin{vmatrix} 1 & 1 & \cdots & 1 & 0 & 1 \\ 1 & \ddots & 1 & 0 & 1 & 1 \\ \vdots & \ddots & \ddots & \ddots & \ddots & \vdots \\ 1 & 0 & 1 & 1 & \ddots & 1 \\ 0 & 1 & 1 & \ddots & 1 & 1 \\ 1 & 1 & \cdots & 1 & 1 & 1 \\ \end{vmatrix}=\begin{vmatrix} 0 & 0 & \cdots & 0 & -1 & 0 \\ 0 & \ddots & 0 & -1 & 0 & 0 \\ \vdots & \ddots & \ddots & \ddots & \ddots & \vdots \\ 0 & -1 & 0 & 0 & \ddots & 0 \\ -1 & 0 & 0 & \ddots & 0 & 0 \\ 1 & 1 & \cdots & 1 & 1 & 1 \\ \end{vmatrix} $$

Now the top $n-1$ row contain a $-1$ in the $(n-1)$th position, and all zeros elsewhere. We can now subtract each of these rows in turn from the last row to transform it into a row of zeros with a $1$ in the $n$th position. Again, this does not change the value of the determinant:

$$ \det A = \begin{vmatrix} 0 & 0 & \cdots & 0 & -1 & 0 \\ 0 & \ddots & 0 & -1 & 0 & 0 \\ \vdots & \ddots & \ddots & \ddots & \ddots & \vdots \\ 0 & -1 & 0 & 0 & \ddots & 0 \\ -1 & 0 & 0 & \ddots & 0 & 0 \\ 0 & 0 & \cdots & 0 & 0 & 1 \\ \end{vmatrix} $$

We can then multiply each of the upper rows by $-1$ to change those $-1$s to $1$s. Multiplying any given row of a matrix by a scalar multiplies the determinant of the matrix by the same factor, so this will update the determinant by $(-1)^{n-1}$:

$$ \det A = (-1)^{n-1} \begin{vmatrix} 0 & 0 & \cdots & 0 & 1 & 0 \\ 0 & \ddots & 0 & 1 & 0 & 0 \\ \vdots & \ddots & \ddots & \ddots & \ddots & \vdots \\ 0 & 1 & 0 & 0 & \ddots & 0 \\ 1 & 0 & 0 & \ddots & 0 & 0 \\ 0 & 0 & \cdots & 0 & 0 & 1 \\ \end{vmatrix} $$

Swap the bottom row with the $(n-1)$th row, then swap the $(n-1)$th with the $(n-2)$th, and so on and so forth until the bottom row is at the top of the matrix. This operation involves $n-1$ row exchanges, and each row exchange scale the determinant by a factor of $-1$, so the result is $$ \det A = (-1)^{n-1} (-1)^{n-1}\begin{vmatrix} 0 & 0 & \cdots & 0 & 0 & 1 \\ 0 & 0 & \cdots & 0 & 1 & 0 \\ 0 & \ddots & 0 & 1 & 0 & 0 \\ \vdots & \ddots & \ddots & \ddots & \ddots & \vdots \\ 0 & 1 & 0 & 0 & \ddots & 0 \\ 1 & 0 & 0 & \ddots & 0 & 0 \\ \end{vmatrix} = \begin{vmatrix} 0 & 0 & \cdots & 0 & 0 & 1 \\ 0 & 0 & \cdots & 0 & 1 & 0 \\ 0 & \ddots & 0 & 1 & 0 & 0 \\ \vdots & \ddots & \ddots & \ddots & \ddots & \vdots \\ 0 & 1 & 0 & 0 & \ddots & 0 \\ 1 & 0 & 0 & \ddots & 0 & 0 \\ \end{vmatrix} $$ Now we go in for the kill. Let's convert this matrix into the $n \times n$ identity matrix. When $n$ is even, this will require swapping the top $n/2$ rows with the bottom $n/2$ rows, which will change the determinant by a factor of $(-1)^{n/2}$. When $n$ is odd, we can see that $(\frac{n+1}{2})$th row is already where it need to be, so we need only perform $\frac{n-1}{2}$ row exchanges. Again, this changes the determinant by a factor of $(-1)^{\frac{n-1}{2}}$. Hence, $$ \det A = \begin{cases} (-1)^\frac{n}{2}, & \text{ whenever $n$ is even} \\ (-1)^{\frac{n-1}{2}}, & \text { whenever $n$ is odd} \end{cases}. $$ which can be given even more simply as $$ \det A = (-1)^{\left\lfloor \frac{n}{2} \right\rfloor} $$ where $\lfloor \cdot \rfloor$ is the greatest integer function.