The basic idea is to write the matrix $A$ as $L + U$ where $L$ is lower-triangular and $U$ is strictly upper triangular. $L$ contains the diagonal elements and all the elements below the diagonal from $A$ while $U$ contains only those elements of $A$ that lie above the diagonal. Then, the iteration step for unknowns $x$ may be written as $$ x_{i}^{(k+1)} = \frac{1}{a_{ii}}\left[ b_i - \sum_{j=1}^{i-1}a_{ij}x_j^{(k+1)} - \sum_{j=i+1}^{n}a_{ij}x_j^{(k)}\right] $$ The iteration step terminates in the standard way.
Please complete the problems from the previous lab before you attempt this one.
Finally, solve the following system of equations using all the implemented methods. Compare the results on the accuracy, precision and number of iterations for convergence
$$\begin{eqnarray*} 12x_1-x_2-x_3-x_4-x_5-x_6-x_7-3x_8-x_9-x_{10} & = & 70 \\ -x_1+10x_2-x_3-x_4-x_5-3x_6-x_7-x_8-x_9-x_{10} & = & 0 \\ -x_1-x_2+7x_3-2x_7+x_8+x_9+x_{10} & = & 32 \\ -2x_1+x_2-x_3+15x_4-5x_5-x_6-2x_8+3x_9-x_{10} & = & 8 \\ x_1+x_2+x_3+x_4-22x_5+x_6+x_7+x_8-4x_9+x_{10} & = & 22 \\ -3x_1-3x_2-x_4+9x_6 & = & 0 \\ 5x_1-3x_2-2x_3-2x_4+3x_6+15x_7-x_8-3x_9-x_{10} & = & 106\\ x_1-2x_2+x_3-2x_4+x_5-2x_6+x_7+25x_8-x_9+x_{10} & = & 30\\ x_1+x_2+x_3+x_4+x_5-x_6-x_7-x_8+18x_9-x_{10} & = & 5 \\ -x_1-x_2-x_3-x_4+x_5+x_6+x_7+x_8+x_9+10x_{10} & = & 69 \end{eqnarray*}$$