“矩阵代数初步”(Introduction to MATRIX ALGEBRA)课程由Prof. A.K.Kaw(University of South Florida)设计并讲授。
PDF格式学习笔记下载(Academia.edu)
第7章课程讲义下载(PDF)

Summary

  • For a nonsingular matrix $[A]$ on which one can always write it as $$[A] = [L][U]$$ where $[L]$ is a lower triangular matrix, $[U]$ is a upper triangular matrix.
  • Note that not all matrices have LU decomposition, such as $\begin{bmatrix}0& 2\\ 2& 0\end{bmatrix}$. $$\begin{bmatrix}0& 2\\ 2& 0\end{bmatrix}=\begin{bmatrix}1& 0\\ a& 1\end{bmatrix} \begin{bmatrix}b& c\\ 0& d\end{bmatrix} \Rightarrow \begin{cases} b=0\\ ab=2\end{cases}$$ which is contradiction.
  • If one is solving a set of equations $$[A][X]=[B]$$ then $$LUX=B$$ $$\Rightarrow L^{-1}LUX=L^{-1}B$$ $$\Rightarrow UX=L^{-1}B=Y$$ then we have $$\begin{cases}LY=B\\ UX=Y\end{cases}$$ So we can solve the first equation for $[Y]$by using forward substitution and then use the second equation to calculate the solution vector $[X]$ by back substitution.
  • For instance, solve the following set of equations: $$\begin{bmatrix}1& 2& 3\\ 2& 1& -4\\ 1& 5& 2\end{bmatrix}\cdot \begin{bmatrix} x\\ y\\ z \end{bmatrix} = \begin{bmatrix} 14\\ -8\\ 17\end{bmatrix}$$ Applying LU decomposition on the coefficient matrix,
    • Firstly write down an identity matrix (the same size as the coefficient matrix) on the left and the coefficient matrix on the right. $$L\leftarrow\begin{bmatrix}1& 0& 0\\ 0& 1& 0\\ 0& 0& 1 \end{bmatrix} \begin{bmatrix}1& 2& 3\\ 2& 1& -4\\ 1& 5& 2\end{bmatrix}\rightarrow U$$
    • Then applying elementary row operation on the right while simultaneously updating successive columns of the matrix on the left. For example, if we are doing $R_1 + m R_2$ on the right then we will do $C_2-mC_1$ on the left. That is, we will keep the equivalent of the product. $$\begin{bmatrix}1& 0& 0\\ 0& 1& 0\\ 0& 0& 1 \end{bmatrix} \begin{bmatrix}1& 2& 3\\ 2& 1& -4\\ 1& 5& 2\end{bmatrix}$$ $$\Rightarrow\begin{cases}R_2-2R_1 \\ C_1+2C_2\end{cases} \begin{bmatrix}1& 0& 0\\ 2& 1& 0\\ 0& 0& 1 \end{bmatrix} \begin{bmatrix}1& 2& 3\\ 0& -3& -10\\ 1& 5& 2\end{bmatrix}$$ $$\Rightarrow\begin{cases}R_3-R_1 \\ C_1+C_3\end{cases} \begin{bmatrix}1& 0& 0\\ 2& 1& 0\\ 1& 0& 1 \end{bmatrix} \begin{bmatrix}1& 2& 3\\ 0& -3& -10\\ 0& 3& -1\end{bmatrix}$$ $$\Rightarrow\begin{cases}R_3+R_2 \\ C_2-C_3\end{cases} \begin{bmatrix}1& 0& 0\\ 2& 1& 0\\ 1& -1& 1 \end{bmatrix} \begin{bmatrix}1& 2& 3\\ 0& -3& -10\\ 0& 0& -11\end{bmatrix}$$ Thus far, the right matrix is an upper triangular matrix (i.e. $U$) and the left one is a lower triangular matrix (i.e. $L$).
    • Solving $[L][Y]=[B]$, that is $$\begin{bmatrix}1& 0& 0\\ 2& 1& 0\\ 1& -1& 1 \end{bmatrix}\cdot Y=\begin{bmatrix} 14\\ -8\\ 17\end{bmatrix}\Rightarrow Y=\begin{bmatrix}14\\ -36\\ -33\end{bmatrix}$$
    • Solving $[U][X]=[Y]$, that is $$\begin{bmatrix}1& 2& 3\\ 0& -3& -10\\ 0& 0& -11\end{bmatrix}\cdot \begin{bmatrix} x\\ y\\ z \end{bmatrix} = \begin{bmatrix}14\\ -36\\ -33\end{bmatrix}$$ $$ \Rightarrow\begin{cases}x=1\\ y=2 \\ z=3\end{cases}$$

Selected Problems

1. Find the $[L]$ and $[U]$ matrices of the following matrix $$\begin{bmatrix}25& 5& 4\\ 75& 7& 16\\ 12.5& 12& 22 \end{bmatrix}$$

Solution:
$$\begin{bmatrix}1& 0& 0\\ 0& 1& 0\\ 0& 0& 1 \end{bmatrix}\begin{bmatrix}25& 5& 4\\ 75& 7& 16\\ 12.5& 12& 22 \end{bmatrix}$$ $$\Rightarrow \begin{cases}R_2-3R_1\\ R_3-{1\over2}R_1\\ C_1+3C_2\\ C_1+{1\over2}C_3\end{cases} \begin{bmatrix}1& 0& 0\\ 3& 1& 0\\ {1\over2}& 0& 1 \end{bmatrix} \begin{bmatrix}25& 5& 4\\ 0& -8& 4\\ 0& 9.5& 20 \end{bmatrix}$$ $$\Rightarrow \begin{cases}R_3+{19\over16}R_2\\C_2-{19\over16}C_3\end{cases} \begin{bmatrix}1& 0& 0\\ 3& 1& 0\\ {1\over2}& -{19\over16}& 1 \end{bmatrix} \begin{bmatrix}25& 5& 4\\ 0& -8& 4\\ 0& 0& {99\over4} \end{bmatrix}$$ That is, $$L= \begin{bmatrix}1& 0& 0\\ 3& 1& 0\\ {1\over2}& -{19\over16}& 1 \end{bmatrix},\ U = \begin{bmatrix}25& 5& 4\\ 0& -8& 4\\ 0& 0& {99\over4} \end{bmatrix}.$$

2. Using LU decomposition to solve: $$\begin{cases} 4x_1 + x_2 - x_3 = -2\\ 5x_1+x_2+2x_3=4\\ 6x_1+x_2+x_3=6 \end{cases}$$

Solution:
$$\begin{bmatrix}1& 0& 0\\ 0& 1& 0\\ 0& 0& 1 \end{bmatrix} \begin{bmatrix}4& 1& -1\\ 5& 1& 2\\ 6& 1& 1\end{bmatrix}$$ $$\Rightarrow \begin{cases}R_2-{5\over4}R_1\\ R_3-{3\over2}R_1\\ C_1+{5\over4}C_2\\ C_1+{3\over2}C_3\end{cases} \begin{bmatrix}1& 0& 0\\ {5\over4}& 1& 0\\ {3\over2}& 0& 1 \end{bmatrix} \begin{bmatrix}4& 1& -1\\ 0& -{1\over4}& {13\over4}\\ 0& -{1\over2}& {5\over2}\end{bmatrix}$$ $$\Rightarrow \begin{cases}R_3-2R_2\\ C_2+2C_3\end{cases} \begin{bmatrix}1& 0& 0\\ {5\over4}& 1& 0\\ {3\over2}& 2& 1 \end{bmatrix} \begin{bmatrix}4& 1& -1\\ 0& -{1\over4}& {13\over4}\\ 0&0& -4\end{bmatrix}$$ That is, $$L = \begin{bmatrix}1& 0& 0\\ {5\over4}& 1& 0\\ {3\over2}& 2& 1 \end{bmatrix},\ U= \begin{bmatrix}4& 1& -1\\ 0& -{1\over4}& {13\over4}\\ 0&0& -4\end{bmatrix}.$$ Then we solve $[L][Y]=[B]$, $$\begin{bmatrix}1& 0& 0\\ {5\over4}& 1& 0\\ {3\over2}& 2& 1 \end{bmatrix}\cdot Y=\begin{bmatrix}-2\\4\\6\end{bmatrix} \Rightarrow Y=\begin{bmatrix}-2\\{13\over2}\\ -4\end{bmatrix}$$ Finally, we solve $[U][X]=[Y]$, $$\begin{bmatrix}4& 1& -1\\ 0& -{1\over4}& {13\over4}\\ 0&0& -4\end{bmatrix}\cdot X= \begin{bmatrix}-2\\{13\over2}\\ -4\end{bmatrix}\Rightarrow X=\begin{bmatrix}3\\-13\\1\end{bmatrix}$$ Thus the solution is $$\begin{cases}x_1 = 3\\ x_2 = -13\\ x_3 = 1\end{cases}$$

3. Find the inverse of $$[A]=\begin{bmatrix}3& 4& 1\\ 2& -7& -1\\ 8& 1& 5\end{bmatrix}$$

Solution:

To find the inverse of a matrix, actually it is to solve a set of equations: $$\begin{cases}AX_1=[1, 0, 0]^{T}\\ AX_2 = [0, 1, 0]^{T}\\ AX_3 = [0, 0, 1]^{T} \end{cases}$$ Firstly, we will find the $[L]$ and $[U]$. $$\begin{bmatrix}1& 0& 0\\ 0& 1& 0\\ 0& 0& 1 \end{bmatrix} \begin{bmatrix}3& 4& 1\\ 2& -7& -1\\ 8& 1& 5\end{bmatrix}$$ $$\Rightarrow \begin{cases}R_2-{2\over3}R_1\\ R_3-{8\over3}R_1\\ C_1+{2\over3}C_2\\ C_1+{8\over3}C_3\end{cases} \begin{bmatrix}1& 0& 0\\ {2\over3}& 1& 0\\ {8\over3}& 0& 1 \end{bmatrix} \begin{bmatrix}3& 4& 1\\ 0& -{29\over3}& -{5\over3}\\ 0& -{29\over3}& {7\over3}\end{bmatrix}$$ $$\Rightarrow \begin{cases}R_3-R_2\\ C_2+C_3\end{cases} \begin{bmatrix}1& 0& 0\\ {2\over3}& 1& 0\\ {8\over3}& 1& 1 \end{bmatrix} \begin{bmatrix}3& 4& 1\\ 0& -{29\over3}& -{5\over3}\\ 0&0& 4\end{bmatrix}$$ That is, $$L = \begin{bmatrix}1& 0& 0\\ {2\over3}& 1& 0\\ {8\over3}& 1& 1 \end{bmatrix},\ U= \begin{bmatrix}3& 4& 1\\ 0& -{29\over3}& -{5\over3}\\ 0&0& 4\end{bmatrix}.$$ Then we solve $[L][Y]=[I]$, note that there are three columns of $[Y]$: $$LY_1 = \begin{bmatrix}1& 0& 0\\ {2\over3}& 1& 0\\ {8\over3}& 1& 1 \end{bmatrix} \cdot Y_1 = \begin{bmatrix}1\\0\\0\end{bmatrix} \Rightarrow Y_1=\left[1, -{2\over3}, -2\right]^{T}$$ $$LY_2 = \begin{bmatrix}1& 0& 0\\ {2\over3}& 1& 0\\ {8\over3}& 1& 1 \end{bmatrix} \cdot Y_2 = \begin{bmatrix}0\\1\\0\end{bmatrix} \Rightarrow Y_2=\left[0, 1, -1\right]^{T}$$ $$LY_3 = \begin{bmatrix}1& 0& 0\\ {2\over3}& 1& 0\\ {8\over3}& 1& 1 \end{bmatrix} \cdot Y_3 = \begin{bmatrix}0\\0\\1\end{bmatrix} \Rightarrow Y_3=\left[0, 0, 1\right]^{T}$$ Finally we can solve $[X]$ by $[U][X]=[Y]$: $$UX_1=Y_1\Rightarrow \begin{bmatrix}3& 4& 1\\ 0& -{29\over3}& -{5\over3}\\ 0&0& 4\end{bmatrix} \cdot X_1 = \begin{bmatrix}1\\ -{2\over3}\\ -2\end{bmatrix}\Rightarrow X_1= \left[{17\over58}, {9\over58}, -{1\over2}\right]^{T}$$ $$UX_2=Y_2\Rightarrow \begin{bmatrix}3& 4& 1\\ 0& -{29\over3}& -{5\over3}\\ 0&0& 4\end{bmatrix} \cdot X_2 = \begin{bmatrix}0\\ 1\\ -1\end{bmatrix}\Rightarrow X_2= \left[{19\over116}, -{7\over116}, -{1\over4}\right]^{T}$$ $$UX_3=Y_3\Rightarrow \begin{bmatrix}3& 4& 1\\ 0& -{29\over3}& -{5\over3}\\ 0&0& 4\end{bmatrix} \cdot X_3 = \begin{bmatrix}0\\ 0\\ 1\end{bmatrix}\Rightarrow X_3= \left[-{3\over116}, -{5\over116}, {1\over4}\right]^{T}$$ Thus the inverse of the original matrix is $$[A]^{-1} = \begin{bmatrix}{17\over58} & {19\over116} & -{3\over116}\\ {9\over58} & -{7\over116} & -{5\over116}\\ -{1\over2} & -{1\over4} & {1\over4}\end{bmatrix}$$

A.Kaw矩阵代数初步学习笔记 7. LU Decomposition的更多相关文章

  1. A.Kaw矩阵代数初步学习笔记 10. Eigenvalues and Eigenvectors

    “矩阵代数初步”(Introduction to MATRIX ALGEBRA)课程由Prof. A.K.Kaw(University of South Florida)设计并讲授. PDF格式学习笔 ...

  2. A.Kaw矩阵代数初步学习笔记 9. Adequacy of Solutions

    “矩阵代数初步”(Introduction to MATRIX ALGEBRA)课程由Prof. A.K.Kaw(University of South Florida)设计并讲授. PDF格式学习笔 ...

  3. A.Kaw矩阵代数初步学习笔记 8. Gauss-Seidel Method

    “矩阵代数初步”(Introduction to MATRIX ALGEBRA)课程由Prof. A.K.Kaw(University of South Florida)设计并讲授. PDF格式学习笔 ...

  4. A.Kaw矩阵代数初步学习笔记 6. Gaussian Elimination

    “矩阵代数初步”(Introduction to MATRIX ALGEBRA)课程由Prof. A.K.Kaw(University of South Florida)设计并讲授. PDF格式学习笔 ...

  5. A.Kaw矩阵代数初步学习笔记 5. System of Equations

    “矩阵代数初步”(Introduction to MATRIX ALGEBRA)课程由Prof. A.K.Kaw(University of South Florida)设计并讲授. PDF格式学习笔 ...

  6. A.Kaw矩阵代数初步学习笔记 4. Unary Matrix Operations

    “矩阵代数初步”(Introduction to MATRIX ALGEBRA)课程由Prof. A.K.Kaw(University of South Florida)设计并讲授. PDF格式学习笔 ...

  7. A.Kaw矩阵代数初步学习笔记 3. Binary Matrix Operations

    “矩阵代数初步”(Introduction to MATRIX ALGEBRA)课程由Prof. A.K.Kaw(University of South Florida)设计并讲授. PDF格式学习笔 ...

  8. A.Kaw矩阵代数初步学习笔记 2. Vectors

    “矩阵代数初步”(Introduction to MATRIX ALGEBRA)课程由Prof. A.K.Kaw(University of South Florida)设计并讲授. PDF格式学习笔 ...

  9. A.Kaw矩阵代数初步学习笔记 1. Introduction

    “矩阵代数初步”(Introduction to MATRIX ALGEBRA)课程由Prof. A.K.Kaw(University of South Florida)设计并讲授. PDF格式学习笔 ...

随机推荐

  1. typedef 和define的区别

    总结一下typedef和#define的区别 1.概念 #define 它在编译预处理时进行简单的替换,不作正确性检查.它是预处理指令. typedef 它在自己的作用域内给一个已经存在的类型一个别名 ...

  2. SQL2005SP4补丁安装时错误: -2146233087 MSDTC 无法读取配置信息。。。错误代码1603的解决办法

    是在安装slq2005sp3和sp4补丁的时候碰到的问题. 起先是碰到的错误1603的问题,但网上搜索的1603的解决办法都试过了,google也用了,外文论坛也读了,依然没有能解决这个问题. 其实一 ...

  3. C#调用百度静态地图

    来深圳一年多了,感觉深圳的IT氛围确实比长沙好,工作和生活节奏比较快,适合于学习.来深后一直在现在所在的公司,部门从开始4个人,发展到现在10来人了,感觉还是不错的. 发现自己很少写博客了,倒不是学得 ...

  4. 怎样修改 Openstack Horizon(Dashboard)的显示界面 (一)

    Openstack 有很多项目,比如 nova 是虚拟机管理,neutron 是虚拟网络管理, glance 是存储管理,而 horizon 是负责 Openstack 的统一界面.horizon 的 ...

  5. Spark源码在Eclipse中部署/编译/运行

    (1)下载Spark源码 到官方网站下载:Openfire.Spark.Smack,其中Spark只能使用SVN下载,源码的文件夹分别对应Openfire.Spark和Smack. 直接下载Openf ...

  6. What is GSLB

    Global Server Load Balancing 中文:全局负载均衡 SLB(Server load balancing)是对集群内物理主机的负载均衡,而GSLB是对物理集群的负载均衡.这里的 ...

  7. Java--笔记(4)

    31.中间件是一种独立的系统软件或服务程序,分布式应用软件借助这种软件在不同的技术之间共享资源.中间件位于客户机/ 服务器的操作系统之上,管理计算机资源和网络通讯.是连接两个独立应用程序或独立系统的软 ...

  8. A+B

    Problem Description Calculate A + B. Input Each line will contain two integers A and B. Process to e ...

  9. Swift开发小技巧--private访问修饰符报错的情况

    1.Swift中的访问修饰符(三个,作用:用来修饰属性,方法和类) public : 最大权限 -- 可以在当前framework和其他framework中访问 internal : 默认的权限 -- ...

  10. 一个很好的UML工具

    访问地址:www.visual-paradigm.com 工具使用帮助文档地址: http://www.visual-paradigm.com/support/documents/vpumluserg ...