Now halfway through the course, we leave behind rectangular matrices and focus on square ones. Our next big topics are determinants and eigenvalues.
课程过半,我们已经可以将长方形矩阵丢置一遍,聚焦于方阵。下一个重要主题是行列式和特征值。
The determinant is a number associated with any square matrix; we’ll write it asor. The determinant encodes a lot of information about the matrix; the matrix is invertible exactly when the determinant is non-zero.
特征值是任何方阵相关的数字特征,记作以及。
特征值蕴涵着大量关于矩阵的信息。
如果矩阵不可逆,则矩阵行列式为0。
Properties
Rather than start with a big formula, we’ll list the properties of the determinant. We already know that; these properties will give us a formula for the determinant of square matrices of all sizes.
比起直接给出难记忆的公式,我们将列出行列式的性质,透过性质我们可以推导出行列式的计算公式。
det
单位矩阵的行列式为1。
If you exchange two rows of a matrix, you reverse the sign of its determinant from positive to negative or from nagative to positive.
如果交换矩阵的两行,矩阵的行列式将会符号反转。
Linear Properties (a) If we multiply one row of a matrix by, the determinant is multiplied by:. (b) The determinant behaves like a linear fucntion on the rows of the matrix:
线性性质:
行列式的某行或某列乘以,比起原行列式放大了倍。
对于单独某行或者某列的加法,可以作行列式分解。
Property 1 tells us that. Property 2 tells us that. The determinant of a permutation matrixis 1 or -1 depending on whetherexchanges an even or odd number of rows.
对于交换矩阵的行列式,取决于交换的行数的奇偶性。
From these three properties we can deduce many others:
从以上三个性质可以推理出各种其他性质。
If two rows of a matrix are equal, its determinant is zero.
若矩阵的两行相等,矩阵的行列式为零。
This is because of property 2, the exchange rule. On the one hand, exchanging the two identical rows does not change the determinant. On the other hand, exchanging the two rows changes the sign of the determinant. Therefore the determinant must be 0.
交换相同的两行,不会改变行列式。另一方面会改变符号。必定行列式为0.
If, subtractingtimes rowfrom rowdoesn’t change the determinant. In two dimensions, the argument look like: The proof for higher dimensional matrices is similar.
矩阵的一行的若干倍加减在另一行上,不会改变行列式。
6.Ifhas a row that is all zeros, then det. We get this from property 3(a) by letting.
矩阵的某行/列全部为0,行列式为零。可以用定理3推导得到。定理4+定理5同样可以得到。
7.The determinant of a triangular matrix is the product of the diagonal entries(pivots).
三角矩阵(包括上跟下)的行列式为主对角线元素之积。
Property 5 tells us that the determinant of the triangular matrix won’t change if we use elimination to convert it to a diagonal matrix with the entrieson its diagonal. Then property 3(a) tells us that the determinant of this diagonal matrix is the producttimes the determinant of the identity matrix, Property 1 completes the argument.
性质5让我们知道,消元法过程中的相减,不会改变方阵行列式的值。
性质3(a)可以把三角矩阵转换为常数乘上单位矩阵。上述等于主对角线元素之积。
Note that we cannot use elimination to get a diagonal matrix if one of theis zero. In that case elimination will give us a row of zeros and property 6 gives us the conclusion we want.
使用消元法时,主对角线出现零时,行列式为零,同样会出现一行全为0。
detexactly whenis singular.
当行列式为零时,意味着矩阵为奇异。
Ifis singular, then we can use elimination to get a row of zeros, and property 6 tells us that the determinant is zero. Ifis not singular, than elimination produces a full set of pivotsand the determinant is(with minus signs from row exchanges).
若矩阵奇异,我们可以利用消元法得到一行全为零。性质6可知,行列式也为零。
若矩阵非奇异,消元法可以获得一组主元不为零。行列式也为这一组主元的积(不为零)。
We now have a very practical formula for the determinant of a non-singular matrix. In fact, the way computers find the determinants of large matrices is to first perform elimination (keeping track of whether the number of row exchanges is odd or even) and then multiply the pivots:
如今我们已经有了非常实用的计算公式。
利用消元法获得主对角线元素。
行列式为主对角线元素之积。
** 实际上matlab计算行列式的方式也就是这样 **
This is very useful. Although the determinant of a sum does not equal the sum of the determinants, it is true that the determinant of a product equals the product of the determinants.
矩阵积的行列式=各个矩阵行列式的积 这一点非常有用。尽管对加法不成立。
For example: because. (Note that ifis singular thendoes not exist andis undefined). Also,and(applying property 3 to each row of the matrix). This reminds us of volume - if we double the length, width and height of a three dimensional box, we increase its volume by a multiple of
性质9
由性质3(b)可以得到。
This lets us translate properties (2, 3, 4, 5, 6) involving rows into statements about columns. For instance, if a column of a matrix is all zeros then the determinant of that matrix is zero.
这一性质可以将性质(2,3,4,5,6)全部扩展至列。
To see why, use elimination to write. The statement becomes. Rule 9 then tells us.
Matrixis a lower triangular matrix with 1’s on the diagonal, so rule 5 tells us that. Becauseis upper triangular, rule 5 tells us that. Thereforeand.
We have one loose end to worry about. Rule 2 told us that a row exchange changes the sign of the determinant. If it’s possible to do seven row exchanges and get the same matrix you would by doing ten row exchanges, then we could prove that the determinant equals its negative.
若交换7次和交换10次的矩阵结果相同,Rule 2的性质就被推翻了
To complete the proof that the determinant is well defined by properties 1, 2 and 3 we’d need to show that the result of an odd number of row exchanges (odd permutation) can never be the same as the result of an even number of row exchange(even permutation).
Determinant formulas and cofactors
Now that we know the properties of the determinant, it’s time to learn some (rather messy) formulas for computing it.
现在已经熟知行列式的性质了,该进一步了解计算的公式了。
Formula for the determinant
We know that the determinant has the following three properties:
Exchanging rows reverses the sign of the determinant.
The determinant is linear in each row separately.
上一节中的十条性质,都是从性质123三条推导得到的。
Last class we listed seven consequances of these properties. We can use these ten properties to find a formula for the determinant of a 2 by 2 matrix:
可以利用几条性质来将二阶行列式的公式推导出来。
By applying property 3 to separate the individual entries of each row we could get a formula for any other square matrix. However, for a 3 by 3 matrix we’ll have to add the determinants of twenty seven different matrices! Many of those determinants are zero. The non-zero pieces are:
利用行列式的线性性质同样可以将3 by 3的行列式分解为若干个比较稀疏的行列式。
方阵可以分解为27个行列式
其中仅有6个矩阵非零
其余21矩阵为零
Each of the non-zero pieces has one entry from each row in each column, as in a permutation matrix. Since the determinant of a permutation matrix is either 1 or -1, we can again use property 3 to find the determinants of each of these summands and obtain our formula.
每个非零向量的成分,每行每列有且仅有一个非零元素,就跟排列矩阵一样。
One way to remember this formula is that the postive terms are products of entries going down and to the right in our original matrix, and the negative terms are products going down and to the left. This rule of thumb doesn’t work for matrices larger than 3 by 3.
正项: going down and to the right
负项: going down and to the left
这里可以大致理解一下。或者直接记国内教材中,所谓画蝴蝶法
The number of parts with non-zero determinants was 2 in the 2 by 2 case, 6 in the 3 by 3 case, and will be 24=4! in the 4 by 4 case.
阶矩阵中,非零项数量为
This is because there areways to choose an element from the first row(i.e. a value for), after which there are onlyways to choose an element from the second row that avoids a zero determinant. Then there arechoices from the third row,from the fourth, and so on.
这是因为,在第一行中选取元素有种方式。
第二行中选取元素有种方式。 ……
The big formula for computing the determinant of any square matrix is:
whereis some permutation of. If we test this on the identity matrix, we find that all the terms are zero except the one corresponding to the trivial permutation.This agrees with the first property:. It’s possible to check all the other properties as well, but we won’t do that here.
是的一种排列组合。
Applying the method of elimination and multiplying the diagonal entries of the result (the pivots) is another good way to find the determinant of a matrix.
** 应用消元法,乘上主对角线元素(主元),是另一种求得行列式的好方法 **
Example
In a matrix with many zero entries, many terms in the formula are zero. We can compute the determinant of: by choosing a non-zero entry from each row and column, multiplying those entries, given the product the appropriate sign, then adding the results. The permutation corresponding to the diagonal running fromtois (4,3,2,1). This contributes 1 to the determinant of the matrix; the contribution is positive because it takes two row exchanges to convert the permutation (4, 3, 2, 1) to the identity (1, 2, 3, 4). Another non-zero term ofcomes from the permutaion (3, 2, 1, 4). This contributes -1 to the sum, because one exchange (of the first and third rows) leads to the identity. These are the only two non-zero terms in the sum, so the determinant is 0. We can confirm this by noting that row 1 minus row 2 plus row 3 minus row 4 equals zero.
这个例子给我们使用 排列法 来计算该行列式:
由于矩阵非零向量比较少,非零分量只有两个。
分别为 排列和
分量的符号跟排列 逆序对 的 奇偶性 相关
逆序对为偶数,正分量。
逆序对为奇数,负分量。
Cofactor formula
Cofactor formula: 翻译作余子式公式
余子式:原方阵某行某列划去后,阶的行列式。
The cofactor formula rewrites the big formula for the determinant of anbymatrix in terms of the determinants of smaller matrices.
余子式公式,将高阶行列式分解为低阶行列式。
In thecase, the formula looks like: This comes from grouping all the multipes ofin the big formula. Each element is multiplied by the cofactors in the parenthese following it.
Note that each cofactors is (plus or minus) the determinant of two by two matrix. That determinant is made up of products of elements in the row and columns NOT containing.
每个余子式,都是由不包含 对应元素 的低一阶矩阵组成。
In general, the cofactorofcan be found by looking at all the terms in the big formula that contain.equalstimes the determinant of thebysquare matrix obtained by removing rowand column. (is positive ifis even and negative ifis odd.)
对应的余子式的计算结果是,所有包含分量之和的非因式。
**等于乘上by的方阵。**
Formatrices, the cofactor formula is: Applying this to amatrix gives us:
Tridiagonal matrix
三对角矩阵
A tridiagonal matrix is one for which the only non-zero entries lie on or adjacent to the diagonal. For example, thetridiagonal matrix of 1’s is:
三对角矩阵的非零元素只存在于主对角线和对角线相邻位置上。
What is the determinant of antridiagonal matrix of 1’s ?
In fact,. We get a sequence which repeats every six terms:
三对角阵的行列式有一个特别特殊的性质:
Cramer’s rule, inverse, volume
We know a formula for a some properties of the determinant. Now we see how the determinant can be used.
这一节开始介绍行列式的性质。
Formula
We know:
Can we get a formula for the inverse of abyorbymatrix?
We expect thatwill be involved, as it is in thebyexample, and by looking at the cofactor matrixwe might guess that cofactors will be involved.
通过观察2阶方阵的逆阵表达式,我们可以推断,行列式的倒数和余子式与取逆公式有关。
In fact: whereis the matrix of cofactors – please notice the transpose!Cofactors of row one ofgo into column 1 of, and then we divide by the determinant.
是由余子式作为元素组成的余子式矩阵。
The determinant ofinvolves products withterms and the cofactor matrix involves products ofterms. andmight cancel each other. This is much easier to see from our formula for the determinant than when using Gauss-Jordan elimination.
从公式可以很明显的看出:与是可以相互消除的。
To more formally verify the formula, we’ll check that. The entry in the first row and first column of the product matrix is: (This is just the cofactor formula for the determinant.) This happens for every entry on the diagonal of.
对 逆矩阵 的定义式进行变形:
等式两边乘上
两边乘上
最后得到的结论就是.
To finish proving that, we just need to check that the off-diagonal entries ofare zero. In the two by two case, multiplying the entries in row 1 ofby the entries in column 2 ofgives. This is the determinant of.
证明在对角线外的元素为零。
对角线外的元素值:等效于: ** 有某两行元素相同的矩阵行列式 **
In higher dimensions, the product of the first row ofand the last column ofequals the determinant of a matrix whose first and last rows are identical. This happens with all the off-diagonal matrices, which confirms that.
This formula helps us answer quesions about how the inverse changes when the matrix changes.
Cramer’s Rule
We know that ifandis nonsingular, then. Applying the formulagives us:
矩阵可逆时,可以得到
用的求解公式代入得到:.
Cramer’s rule gives us another way of looking at this equation. To derive this rule we breakdown into its components. Because theth component ofis a sum of cofactors times some number, it is the determinant of some matrix. whereis the matrix created by starting withand then replacing columnwith, so:
将合并,得到对应的向量。
This agrees with our formula. When taking the determinant ofwe get a sum whose first term istimes the cofactorof. Computing inverse using Cramer’s rule is usually less efficient than using elimination.
Volume
paralledlepiped: 平行六面体。
Claim:is the volume of the box(paralledlepiped) whose edges are the column vectors of. (We could equally well use the row vectors, forming a different box with the same volume.)
If, then the box is a unit cube and its volume is 1. Because this agrees with our claim, we can conclude that the volume obeys determinant property 1.
当方阵,方阵构成了单位正方体。
Ifis an orthogonal matrix then the box is a unit cube in a different orientation with volume. (Becauseis an orthogonal matrix,and so.)
如果方阵,那么矩阵是一个正交矩阵,那么组成六面体也为单位立方体。
以不同的正交基构成了体积为1的单位立方体。
Swapping two columns ofdoes not change the volume of the box or (remembering that) the absolute value of the determinant( property 2). If we show that the volume of the box also obeys property 3 we’ll have provenequals the volume of the box.
交换矩阵的两列向量,不会改变形成六面体的体积。
if we double the length of one column of, we double the volume of the box formed by its columns. Volume satisfies property 3(a). Property 3(b) says that the determinant is linear in the rows of the matrix:
体积的公式满足行列式的线性规则。
Figure 2 illustrates why this should be true.
Although it’s not needed for our proof, we can also see that determinants obey property 4. If two edges of a box are equal, the box flattens out and has no volume.
同样遵循行列式的性质4当列向量或者行向量中:
有两组线性相关
体积会为零(e.g. 折叠为一张平面
Important note: If you know the coordinates for the corners of a box, then computing the volume of the box is as easy as calculating a determinant. In particular, the area of a paralledlogram with edgesandis half the area of that parallelogram, or. The area of a triangle with vertices at,andis:
如果知道corners of box,计算体积也就同计算行列式一样简单了。
二维平面中,两个二维向量形成的四边形面积为二阶矩阵的行列式。
若知道三角形的顶点位置求三角形面积的两种方法:
拓展第三维度,二维面积数值上等于高为1的体积
做差,向量表示平面两边,再计算二阶行列式。
Eigenvalues and eigenvectors
The subject of eigenvalues and eigenvectors will take up most of the rest of the course. We will again be working with square matrices. Eigenvalues are special associated with a matrix and eigenvectors are special vectors.
特征值和特征向量会占据这个课程剩下的大量内容。
特征值是矩阵相关的特殊数值。
特征向量是矩阵相关的特殊向量。
Eigenvectors and eigenvalues
A matrixacts on vectorslike a fuction does, with inputand output. Eigenvectors are vectors for whichis paralled to. In other words: In this equation,is an eigenvector ofandis an eigenvalve of.
定义:矩阵作用于向量,得到结果
特征向量是另与平行的向量.
特征值是与之间的缩放尺度。
Eigenvalue 0
特征值为零时候。
If the eigenvalueequalsthen. Vectors with eigenvalue 0 make up the nullspace of; ifis singular, thenis an eigenvalue of.
当特征值为0时,等效. ** 等效于,特征值为0时,特征向量为零空间的向量 **
矩阵奇异时,特征值是矩阵的一个特征值。
Examples
Supposeis the matrix of a projection onto a plane. For anyin the plane, sois an eigenvector with eigenvalue 1. The eigenvectors ofspan the whole space (but this is not true for every matrix).
The matrixhas an eigenvectorwith eigenvalue 1 and another eigenvectorwith eigenvalue -1. These eigenvectors span the space. They are perpendicular because(as we will prove).
对于例子,二阶矩阵的两个特征向量能够张成整个空间。 此外,两个特征向量,相互垂直(由于矩阵对称)
Anbymatrix will haveeigenvalues, and their sum of the diagonal entries of the matrix:. This sum is the trace of the matrix. For a two by two matrix, if we know one eigenvalue we can use this fact to find the second.
shape为的方阵,有个特征值
所有特征值之和 = 方阵主对角线元素之和
主对角线元素之和,又称为迹trace。
Can we solvefor the eigenvalues and eigenvectors of? Bothandare unknown; we need to be clever to solve this problem:
对特征值的定义式进行变换:
In order forto be an eigenvector,must be singular. In other words,. We can solve this characteristic equation forto getsolutions. If we’re lucky, the solutions are distinct. If not, we have one or more repeated eigenvalues.
观察公式:
要使得向量存在非零解
那么,我们可以把方程的前一部分可以视作矩阵
条件式更变为存在非零解,即nullspace不为0
运气好特征值全部不同。否则,会有重复值。
Once we’ve found an eigenvalue, we can use elimination to find the nullspace of. The vectors in that nullspace are eigenvectors ofwith eigenvalue.
一旦寻找到了特征值,就能利用elimination找到的nullspace。
Calculating eigenvalues and eigenvectors
Let. Then:
二阶矩阵求特征值的行列式系数,可以表示为:迹trace和
Note that the coefficient 6 is the trace (sum of diagonal entries) and 8 is the determinant of. In general, the eigenvalues of a two by two matrix are the solutions to: Just as the trace is the sum of the eigenvalues of a matrix, the product of the eigenvalues of any matrix equals its determinant.
** 特征值的积 = 方阵的行列式 **
For, the eigenvalues areand. We find the eigenvectorforin the nullsapce of.
will be in the nullsapce of. The nullspace is an entire line;could be any vector on that line. A natural choice is.
Note that these eigenvectors are the same as those of. Addingto the matrixadded 3 to each of its eigenvalues and did not chagne its eigenvectors, because.
在矩阵的基础上+nI,得到矩阵
矩阵和矩阵特征向量相同
矩阵和矩阵的特征值上,有个差值n
A caution
Similarly, ifand,. It would be nice if the eigenvalues of a matrix sum were always the sums of the eigenvalues, but this is only true ifandhave the same eigenvectors. The eigenvalues of the productaren’t usually equal to the products, either.
上面的推论,仅当与两矩阵的特征向量相同时,可以满足该等式。
Complex eigenvalues
复特征值
The matrixrotates every vector in the plane by.
旋转矩阵的一个重要特征:反对称(就是和对称矩阵两个极端。
It has traceand determinant. Its only real eigenvector is the zero vector; any other vector’s direction changes when it is multiplied by. How will this affect our eigenvalue calculation?
has solutionsand. If a matrix has a complex eigenvaluethen the complex conjugateis also an eigenvalue of that matrix.
如果特征值中,有复数存在。 那么它的共轭复数,一定也是特征值。
Symmetric matrices have real eigenvalues. For antisymmetric matrices like, for which, all eigenvalues are imaginary.
对称矩阵 的特征值: 全实数。
反对称矩阵 的特征值:纯虚数。
Triangular matrices and repeated eigenvalues
三角矩阵 与 重复特征值
For triangular matrices such as, the eigenvalues are exactly the entires on the diagonal. In this case, the eigenvalues are 3 and 3:
soand. To find the eigenvectors, solve:
to get. There is no independent eigenvector.
重复特征值,将不会带来另外独立的特征向量。
Post title: MIT18.06_6_Determinant and Eigenvalues
Post author: Carpe Tu
Create time: 2022-11-04 13:51:40
Post link: Linear-Algebra/mit18-06-6-determinant-and-eigenvalues/
Copyright notice: All articles in this blog are licensed under BY-NC-SA unless stating additionally.