Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
linear_algebra:03_gaussian_elimination [2014/01/20 12:50] marje |
linear_algebra:03_gaussian_elimination [2014/12/14 00:12] jaan [3. Gaussian elimination algorithm] |
||
---|---|---|---|
Line 40: | Line 40: | ||
<box 100% round blue> | <box 100% round blue> | ||
- | Following operations with a matrix are called **elementary row operations**: | + | The following operations with a matrix are called **elementary row operations**: |
- Switching two rows. | - Switching two rows. | ||
- Multiplying a row by a nonzero constant. | - Multiplying a row by a nonzero constant. | ||
Line 91: | Line 91: | ||
- | In therms of the augmented matrix, the first elementary row operation means that we can reorder | + | In terms of the augmented matrix, the first elementary row operation means that we can reorder |
equations within the system.\\ | equations within the system.\\ | ||
The second elementary row operation means that we can multiply an equation with some constant, i.e. | The second elementary row operation means that we can multiply an equation with some constant, i.e. | ||
Line 281: | Line 281: | ||
<WRAP task> | <WRAP task> | ||
Verify the step in IPython by using the functions you created for elementary row operations | Verify the step in IPython by using the functions you created for elementary row operations | ||
- | (e.g., [[gaussian_elimination#el_row_op|swap_rows]] and | + | (e.g., [[03_gaussian_elimination#el_row_op|swap_rows]] and |
[[03_gaussian_elimination#el_row_op|add_row_multiples]]).\\ | [[03_gaussian_elimination#el_row_op|add_row_multiples]]).\\ | ||
</WRAP> | </WRAP> | ||
Line 778: | Line 778: | ||
Analyse the result: what should be changed in order to obtain the final augmented matrix from above.\\ | Analyse the result: what should be changed in order to obtain the final augmented matrix from above.\\ | ||
- | </WRAP> | ||
<hidden **Solution**> | <hidden **Solution**> | ||
Line 861: | Line 860: | ||
Do you get the correct answer? ++Answer | The final augmented matrix is $\left(\begin{array}{rrrr|r}1&-\frac{3}{2}&-\frac{1}{2}&\frac{5}{2}&\frac{1}{2}\\0&0&0&1&0\\0&0&0&0&0\end{array}\right)$ ++ | Do you get the correct answer? ++Answer | The final augmented matrix is $\left(\begin{array}{rrrr|r}1&-\frac{3}{2}&-\frac{1}{2}&\frac{5}{2}&\frac{1}{2}\\0&0&0&1&0\\0&0&0&0&0\end{array}\right)$ ++ | ||
- | </WRAP> | + | </WRAP>\\ |
As you can see, the simple Gaussian elimination algorithm does not work in such a case. Next we will generalize | As you can see, the simple Gaussian elimination algorithm does not work in such a case. Next we will generalize | ||
Line 903: | Line 902: | ||
if $r=n$ and $a_{ii}=1$ for every $i=1,\dots,n$, then **the system has a unique solution**. The solution is | if $r=n$ and $a_{ii}=1$ for every $i=1,\dots,n$, then **the system has a unique solution**. The solution is | ||
the last column of the augmented matrix, | the last column of the augmented matrix, | ||
- | see [[gaussian_elimination#simple_gaussian|simple Gaussian elimination algorithm]]. | + | see [[03_gaussian_elimination#simple_gaussian|simple Gaussian elimination algorithm]]. |
If $r<n$, then **the system has more than one solution**. In the case of solving such a system over $\mathbb{R}$ | If $r<n$, then **the system has more than one solution**. In the case of solving such a system over $\mathbb{R}$ | ||
Line 926: | Line 925: | ||
decide weather it has unique solution or not. | decide weather it has unique solution or not. | ||
- | |$\left(\begin{array}{rrrrr|r}1&0&0&5&8&0\\0&0&1&2&7&0\\0&0&0&0&0&1\end{array}\right)$ | $\left(\begin{array}{rrrrr|r}1&0&6&5&8&2\\0&0&2&2&7&3\end{array}\right)$ | $\left(\begin{array}{rrr|r}1&0&0&3\\0&1&0&-2\\0&0&1&10\\0&0&0&0\end{array}\right)$ | $\left(\begin{array}{rrrrr|r}1&0&0&0&0&3\\0&0&9&1&0&-3\\0&1&-2&0&0&2\\0&0&0&0&1&5\end{array}\right)$ | | + | |$\left(\begin{array}{rrrrr|r}1&0&0&5&8&0\\0&0&1&2&7&0\\0&0&0&0&0&1\end{array}\right)$ | $\left(\begin{array}{rrrrr|r}1&0&6&5&8&2\\0&0&2&2&7&3\end{array}\right)$ | |
- | |++Answer | This one is. However, the system has no solution. ++ | ++Answer | This one is not. The entry $a_{23}=2$ but in case of general Gaussian elimination algorithm there should be $1$. By multiplying the second row by $\frac{1}{2}$ we obtain the desired final form of Gaussian elimination. The system has more then one solution. ++ | ++Answer | No, since the last row consists of only zeros. If we drop the last row, then the augmented matrix is in the needed form. The system has precisely one solution. ++ | ++Answer | No. The 3rd and 2nd row should be switched and instead of $9$ there should be $1$ and instead of $-2$ there should be $0$. ++ | | + | |++Answer | This one is. However, the system has no solution. ++ | ++Answer | This one is not. The entry $a_{23}=2$ but in case of general Gaussian elimination algorithm there should be $1$. By multiplying the second row by $\frac{1}{2}$ we obtain the desired final form of Gaussian elimination. The system has more then one solution. ++ | |
+ | |$\left(\begin{array}{rrr|r}1&0&0&3\\0&1&0&-2\\0&0&1&10\\0&0&0&0\end{array}\right)$ | $\left(\begin{array}{rrrrr|r}1&0&0&0&0&3\\0&0&9&1&0&-3\\0&1&-2&0&0&2\\0&0&0&0&1&5\end{array}\right)$ | | ||
+ | | ++Answer | No, since the last row consists of only zeros. If we drop the last row, then the augmented matrix is in the needed form. The system has precisely one solution. ++ | ++Answer | No. The 3rd and 2nd row should be switched and instead of $9$ there should be $1$ and instead of $-2$ there should be $0$. ++ | | ||
</WRAP> | </WRAP> | ||