Calculate the determinant of the $2n \times 2n$ matrix with entries equal to zero on the main diagonal, equal to $1$ below and equal to $-1$ above. I'll denote this matrix $A_{2n}$.
So for example you have $A_{2} = \begin{bmatrix} 0 & -1 \\ 1 & 0 \\ \end{bmatrix} $ and $A_{4}= \begin{bmatrix} 0 & -1 & -1 &-1 \\ 1 & 0 & -1 & -1\\ 1 & 1 & 0 & -1 \\ 1 & 1 & 1 & 0\\ \end{bmatrix} $
From trying it out by hand I think you have $\det(A_{2n})=1$ for all odd $n$ , or $=-1$ for all even $n$.
Can anyone come up with some way to prove this?
From doing these two examples my algorithm seems to be something like this:
- Switch the first and second rows (multiplies det by $-1$)
- If the matrix is now upper triangular, calculate the determinant by product of main diagonal.
- If not, make a new pivot and clear that column below.
- Swap the third and fourth rows (multiplies det by $-1$).
- Repeat from 2.