# What am I doing wrong when trying to find a determinant of this 4x4

I have to find the determinant of this 4x4 matrix:

$\begin{bmatrix} 5 & -7 & 2 & 2 \\ 0 & 3 & 0 & -4 \\ -5 & -8 & 0 & 3 \\ 0 & -5 & 0 & -6 \\ \end{bmatrix}$

Here is my working which seems wrong according to the solutions. What am i doing wrong?: And here is the solution: What you are doing wrong is precisely what the solution said you were doing wrong. The $2$ was alright, since that's the same as $2\cdot(-1)^{1+3},$ but the $-5$ was not, since $$-5\cdot(-1)^{2+1}=-5\cdot-1=5.$$ Keep in mind that we have an alternating sign factor as we move along a row/column, and that the starting sign depends on the row/column that we're in.
Your $3\times3$ determinant has to have a $-(-5)$ in the front. Hope you can see that from the formula of a determinant for a $3\times 3$ matrix.
Define the permutation matrices $P_k$ by $P_1 e_2 = e_3, P_1 e_3 = e_2$, and $P_2 e_1 = e_3, P_2 e_2 = e_1, P_2 e_3 = e_2$ (the other basis vectors mapped to themselves). It is easy to verify that $\det P_1 = -1, \det P_2 = +1$.
Then $P_1 A P_2 = \begin{bmatrix} 2 & 5 & -7 & 2 \\ 0 & -5 & -8 & 3 \\ 0 & 0 & 3 & -4 \\ 0 & 0 & 5 & -6\end{bmatrix}$, and $\det (P_1 A P_2) = -20$, hence $\det A = 20$.