Determinant of a matrix Having some problems with a determinant of a 4x4 matrix M.
$
M =
\left( {\begin{array}{cc}
1 & 2 & 3 &-1 \\
0 & 1 & 2 & 2 \\
1 &1 &0 &0 \\
3&1&2&0
\end{array} } \right)
$
Went along and developed it according to the 4th column. So I end up with two matrixes A and B.
$
A = -1 \cdot det 
\left( {\begin{array}{cc}
0 & 1 & 2 \\
1 & 1 & 0  \\
3 &1 &2  \\
\end{array} } \right)
$
$
B = 2 \cdot det
\left( {\begin{array}{cc}
1 & 2 & 3 \\
1 & 1 & 0  \\
3 &1 &2  \\
\end{array} } \right)
$
I get $A= (-1) \cdot((0 \cdot1\cdot2)+(1\cdot0\cdot3)+(2\cdot1\cdot1)-(3\cdot1\cdot2)-(1\cdot2\cdot2)-(1\cdot1\cdot0)) \\$
$A=(-1) \cdot(-6)=6$
$B= 2 \cdot((1\cdot1\cdot2)+(2\cdot0\cdot3)+(3\cdot1\cdot1)-(3\cdot1\cdot3)-(1\cdot2\cdot2)-(1\cdot1\cdot0))
\\$
$B = 2\cdot8=16$
$A+B=22$ 
which is wrong. Where is my mistake?
The correct answer should be $-22$ but I don't get why my solution keeps being positive.
Edit: im such a moron: A = 1* det and B = -2 * det. Everythings clearing up while in bed. Hehe!
 A: The formula to calculate the determinant is given by 
$$\sum_{\sigma \in S_n} (-1)^{\sigma} a_{1\sigma(1)} \times \cdots \times a_{n \sigma(n)},$$
if you want me to explain the whole formula, I can but the important bit right now is the $(-1)^{\sigma}$ which refers to the sign of each entry you are expanding by.
First, you have expanded by element $a_{1,4}$ and so the sign should be $(-1)^{1 + 4} = -1$ and so your determinant of $A$ should be
$$(-1) \cdot (-1) \cdot (-6) = -6.$$
So, your sign for when expanding by row $4$ column $2$ is going to be $(-1)^6 = 1$.
Another mistake you have made is that the determinant of $B$ isn't $16$, it's $-16$.
A: You are expanding down the fourth column, which means that the cofactor on entry $ \ a_{14}  = -1 \ $ is negative and the cofactor on entry $ \ a_{24} = 2 \ $ is positive.  You should have
$$ [ (-1) \cdot (-1) \cdot ( 2 - 6 - 2 ) ] \ + \ [ (+1) \cdot 2 \cdot ( 2 + 3 - 9 - 4 ) ] $$
$$ = \ (-6) \ + \ (-16) \ = \ -22 \ . $$
A:  Your mistake was that you forgot the $(-1)^{i+j}$ for the cofactors.
