Consider the following system of linear algebraic equations 𝐴𝑥=𝑏:
[1 1 3 [ X = [2
5 3 1 Y 3
2 3 1] Z] -1]
Solve the system using (you can compare your solution with MATLAB)
1. Cramer’s Rule
2. Gauss elimination without pivoting
3. Gauss-Jordan elimination
4. LU factorization
"A=\\begin{pmatrix}\n 1 & 1&3 \\\\\n 5&3&1\\\\\n2&3&1\n\\end{pmatrix}, x=\\begin{pmatrix}\n x \\\\\n y\\\\z\n\\end{pmatrix},b=\\begin{pmatrix}\n 2 \\\\\n 3\\\\-1\n\\end{pmatrix}"
1. Cramer’s Rule
"\\Delta=\\begin{vmatrix}\n 1 & 1&3 \\\\\n 5&3&1\\\\\n2&3&1\n\\end{vmatrix}=3+2+45-18-5-3=24\\\\\n\\Delta_x=\\begin{vmatrix}\n 2 & 1&3 \\\\\n 3&3&1\\\\\n-1&3&1\n\\end{vmatrix}=6-1+27+9-3-6=32\\\\\n\\Delta_y=\\begin{vmatrix}\n 1 & 2&3 \\\\\n 5&3&1\\\\\n2&-1&1\n\\end{vmatrix}=3+4-15-18-10+1=-35"
"\\Delta_z=\\begin{vmatrix}\n 1 & 1&2 \\\\\n 5&3&3\\\\\n2&3&-1\n\\end{vmatrix}=-3+6+30-12+5-9=17"
"x=\\frac{\\Delta _1}{\\Delta}=\\frac{32}{24}=\\frac{4}{3}\\\\\ny=\\frac{\\Delta _2}{\\Delta}=\\frac{-35}{24}=-\\frac{35}{24}\\\\\nz=\\frac{\\Delta _3}{\\Delta}=\\frac{17}{24}"
2. Gauss elimination without pivoting
"\\begin{pmatrix}\n 1 & 1&3 &|&2\\\\\n 5&3&1&|&3\\\\\n2&3&1&|&-1\n\\end{pmatrix}\\to"
2r+1r(-5)
3r+1r(-2)
"\\begin{pmatrix}\n 1 & 1&3 &|&2\\\\\n 0&-2&-14&|&-7\\\\\n0&1&-5&|&-5\n\\end{pmatrix}\\to"
2r"\\leftrightarrow" 3r
"\\begin{pmatrix}\n 1 & 1&3 &|&2\\\\\n0&1&-5&|&-5\\\\\n 0&0&-24&|&-17\\\\\n\\end{pmatrix}"
"x+y+3z=2\\\\\n-2y-14z=-7\\\\\n-24z=-17\\mapsto z=\\frac{17}{24}"
"-2y-14\\cdot\\frac{17}{24}=-7\\mapsto x_2=-\\frac{35}{24}\\\\\nx-\\frac{35}{24}+3\\cdot\\frac{17}{24}=2\\mapsto x=\\frac{3}{4}"
3. Gauss-Jordan elimination
"\\begin{pmatrix}\n 1 & 1&3 &|&2\\\\\n 5&3&1&|&3\\\\\n2&3&1&|&-1\n\\end{pmatrix}\\to"
2r+1r(-5)
3r+1r(-2)
"\\begin{pmatrix}\n 1 & 1&3 &|&2\\\\\n 0&-2&-14&|&-7\\\\\n0&1&-5&|&-5\n\\end{pmatrix}\\to"
2r"\\leftrightarrow" 3r
"\\begin{pmatrix}\n 1 & 1&3 &|&2\\\\\n0&1&-5&|&-5\\\\\n 0&-2&-14&|&-7\n\\end{pmatrix}\\to"
3r+2r(2)
"\\begin{pmatrix}\n 1 & 1&3 &|&2\\\\\n0&1&-5&|&-5\\\\\n 0&0&-24&|&-17\\\\\n\n\\end{pmatrix}\\to"
3r("\\frac{-1}{24}" )
"\\begin{pmatrix}\n 1 & 1&3 &|&2\\\\\n 0&1&-5&|&-5\\\\\n0&0&1&|&\\frac{17}{24}\n\\end{pmatrix}\\to"
2r+3r(5)
1r+3r(-3)
"\\begin{pmatrix}\n 1 & 1&0 &|&-\\frac{3}{24}\\\\\n 0&1&0&|&-\\frac{35}{24}\\\\\n0&0&1&|&\\frac{17}{24}\n\\end{pmatrix}\\to"
1r+2r(-1)
"\\begin{pmatrix}\n 1 & 0&0 &|&\\frac{32}{24}\\\\\n 0&1&0&|&-\\frac{35}{24}\\\\\n0&0&1&|&\\frac{17}{24}\n\\end{pmatrix}"
"x=\\frac{32}{24}=\\frac{4}{3}, y=-\\frac{35}{24}, z=\\frac{17}{24}"
4. LU factorization
"L=\\begin{pmatrix}\n 1 & 0&0 \\\\\n 5 & 1&0\\\\\n2&-\\frac{1}{2}&1\n\\end{pmatrix}"
5: 2:
"\\begin{pmatrix}\n 1 & 1&3 \\\\\n 0&-2&-14\\\\\n0&1&-5\n\\end{pmatrix}"
"-\\frac{1}{2}" :
"\\begin{pmatrix}\n 1 & 1&3 \\\\\n 0&-2&-14\\\\\n0&0&-12\n\\end{pmatrix}=U"
"LY=B\\\\"
"\\begin{pmatrix}\n 1 & 0&0 \\\\\n 5 & 1&0\\\\\n2&-\\frac{1}{2}&1\n\\end{pmatrix}\\begin{pmatrix}\n y_1\\\\\n y_2\\\\\ny_3\n\\end{pmatrix}=\\begin{pmatrix}\n 2\\\\\n 3\\\\\n-1\n\\end{pmatrix}"
"y_1=2\\\\\n5y_1+y_2=3\\mapsto y_2=-7\\\\\n2y_1-\\frac{1}{2}y_2+y_3=-1\\mapsto y_3=-\\frac{17}{2}"
"UX=Y\\\\"
"\\begin{pmatrix}\n 1 & 1&3 \\\\\n 0&-2&-14\\\\\n0&0&-12\n\\end{pmatrix}\\begin{pmatrix}\n x \\\\\n y\\\\z\n\\end{pmatrix}=\\begin{pmatrix}\n 2 \\\\\n -7\\\\-\\frac{17}{2}\n\\end{pmatrix}"
"x+y+3z=2\\mapsto x=-\\frac{32}{24} \\\\\n-2y-14z=-7\\mapsto y=-\\frac{35}{24}\\\\\n-12z=-\\frac{17}{2}\\mapsto z=\\frac{17}{24}"
Comments
Leave a comment