Solution (source code)

= Solution

<Gaussian elimination> without row exchanges gives the <LU decomposition>
$$
A=LU,
\qquad
L=\begin{pmatrix}
1&0&0&0\\
2&1&0&0\\
1&1&1&0\\
-2&-1&-1&1
\end{pmatrix},
\qquad
U=\begin{pmatrix}
3&2&-3&-3\\
0&-1&-1&-2\\
0&0&-2&1\\
0&0&0&-1
\end{pmatrix}.
$$
Because $L$ has unit diagonal and $U$ is <upper triangular matrix>[upper triangular],
$$
\boxed{\det A=\det L\det U=3(-1)(-2)(-1)=-6}.
$$

Solving the two triangular systems gives
$$
Ly=b
\quad\Longrightarrow\quad
y=(3,-3,-1,-1)^T,
$$
and
$$
Ux=y
\quad\Longrightarrow\quad
\boxed{x=(3,0,1,1)^T}.
$$