<s>[INST] 5 linear equations in 5 unknowns I need an example of 5 linearly independent equations with 5 variables. How can I write such a equation set. As an example:
                      0   0    0    0   1   |   -4
                      0   0    1   -1   0   |    3
                      1   0    0    0   1   |    2
                      0   7   -8    0   0   |  -14
                      2   0    0    0   0   |    2

But this is wrong. I need to build a correct one.
 [/INST] Begin with a 5x5 random matrix, with positive diagonal. For example,
$$
A=\begin{pmatrix}
1&0&-3&2&4\\
5&6&7&8&-9\\
1&1&1&1&1\\
0&0&0&1&0\\
2&-3&2&-3&4
\end{pmatrix}
$$
Then compute the absolute row sums (i.e. sum up the absolute values of the entries in each row):
\begin{align}
1+0+3+2+4=10\\
5+6+7+8+9=35\\
1+1+1+1+1=5\\
0+0+0+1+0=1\\
2+3+2+3+4=14.
\end{align}
Add these row sums to the diagonal of $A$:
$$
A=\begin{pmatrix}
1+10&0&-3&2&4\\
5&6+35&7&8&-9\\
1&1&1+5&1&1\\
0&0&0&1+1&0\\
2&-3&2&-3&4+14
\end{pmatrix}.
$$
The rows of $A$ are then linearly independent. If you want to make $A$ looks more random, further scramble the rows or columns of $A$. Then form a random but nice looking solution vector $x$ (so that you may control the look of the solution). Compute $b=Ax$ and let the coefficients of $b$ be the numbers on the RHS of the equations. The resulting system will always have a unique solution, which is your nice $x$.
</s>