# Homework Help: Determinant nxn.

1. Dec 12, 2015

### cdummie

1. The problem statement, all variables and given/known data
I have to solve the following determinant
$D_n=\begin{vmatrix} 1 & 1 & 1 & \cdots & 1 & 1 & 1 \\ 1 & 1 & 1 & \cdots & 1 & 2 & 1 \\ 1 & 1 & 1 & \cdots & 2 & 1 & 1 \\ \vdots & \vdots & \vdots & \ddots & \vdots & \vdots & \vdots \\ 1 & 2 & 1 & \cdots & 1 & 1 & 1 \\ 1 & 1 & 1 & \cdots & 1 & 1 & 0 \end{vmatrix}$

2. Relevant equations

3. The attempt at a solution
So my idea was to multiply the last row by -1 and add it to every other row, that way, i had the following determinant:
$D_n= \begin{vmatrix} 0 & 0 & 0 & \cdots & 0 & 0 & 1 \\ 0 & 0 & 0 & \cdots & 0 & 1 & 1 \\ 0 & 0 & 0 & \cdots & 1 & 0 & 1 \\ \vdots & \vdots & \vdots & \ddots & \vdots & \vdots & \vdots \\ 0 & 1 & 0 & \cdots & 0 & 0 & 1 \\ 1 & 1 & 1 & \cdots & 1 & 1 & 0 \end{vmatrix}$

So i have determinant with all zeros above diagonal, so solution to this should be product of all elements of diagonal (i should keep in mind that sign changes since this isn't "regular" diagonal), so i ended up with: $D_n=(-1)^{\frac{n(n+1)}{2}}$. Is this correct?

2. Dec 12, 2015

### geoffrey159

I don't think you are correct. Unless I'm wrong $D_3 = -1$, but with your answer you get 1.
You don't change the determinant by adding to a column a multiple of another column, and you multiply the determinant by $-1$ by exchanging 2 columns. So after your transformation, you exchange columns $(i,n+1-i)$ for $i = 1...\lfloor n/2 \rfloor$ so that you have the determinant of a diagonal (EDIT: TRIANGULAR sorry) matrix that has only 1's on the diagonal, and $\lfloor n/2 \rfloor$ transpositions.

Last edited: Dec 12, 2015
3. Dec 12, 2015

### cdummie

I don't understand what you mean, could you explain me this part?

4. Dec 12, 2015

### geoffrey159

In your attempt to a solution, you wrote

$D_n= \det(C_1,...,C_n) = \begin{vmatrix} 0 & 0 & 0 & \cdots & 0 & 0 & 1 \\ 0 & 0 & 0 & \cdots & 0 & 1 & 1 \\ 0 & 0 & 0 & \cdots & 1 & 0 & 1 \\ \vdots & \vdots & \vdots & \ddots & \vdots & \vdots & \vdots \\ 0 & 1 & 0 & \cdots & 0 & 0 & 1 \\ 1 & 1 & 1 & \cdots & 1 & 1 & 0 \end{vmatrix}$

Now each time you exchange two columns, you multiply the determinant by -1. So that by permuting columns $i$ and $n+1 - i$ for all $i = 1... \lfloor n/2 \rfloor$, you get

$D_n = (-1) ^ {\lfloor n/2 \rfloor } \det(C_n,C_{n-1},...,C_1)$

and $\det(C_n,C_{n-1},...,C_1)$ is very easy to compute.