第 19 章
行列式的显式公式:大公式与代数余子式
用置换把行列式写成 n! 项之和,再用代数余子式把它降阶;最后用三对角矩阵演示递推与周期 6 的规律。
Determinant Formulas: The Big Formula and Cofactors
Write the determinant as a sum over n! permutations, then reduce it to smaller determinants with cofactors; finish with a tridiagonal example whose sequence has period six.
篇内目录
- What this lecture delivers
- Timeline
- The big formula: from row splitting to permutations
- Splitting the case
- The case and the survivors
- Where the three-by-three mnemonic breaks
- A example: only two nonzero terms
- Cofactors: reducing to
- Grouping the big formula
- Definition
- The cofactor expansion
- How the three formulas divide the work
- The tridiagonal example
- Core review
- Common misconceptions
- Check your understanding
- How this connects
这一讲要做什么
上一讲用三条性质推出了行列式的全部行为,但没有给出显式公式。这一讲补上公式,而且给两个:大公式(按置换展开, 项)和代数余子式公式(降阶展开, 化成 阶)。
两个公式都不适合手算大矩阵,但它们是理解行列式结构的钥匙。实际计算仍然用上一讲的结论:消元后把主元乘起来。
时间轴
| 时间 | 内容 |
|---|---|
| 0:00 | 第二讲:行列式的显式公式 |
| 3:15 | 对角矩阵的行列式 |
| 6:25 | 把每一行拆成只有一个非零项 |
| 9:32 | 3×3 的六项展开 |
| 12:33 | 项的符号与列顺序 |
| 15:39 | 4×4 反对角矩阵的例子 |
| 18:52 | 一般公式:n! 项求和 |
| 22:02 | 大公式为什么不实用 |
| 28:08 | 按第一行把项分组 |
| 31:19 | 含 的两项 |
| 34:24 | 含 的项与符号 |
| 37:34 | 符号 |
| 40:47 | 另一条引入行列式的路径 |
| 43:51 | 代数余子式公式 |
| 47:02 | 余子式与符号的 2×2 例子 |
| 50:21 | 余子式矩阵的构造 |
大公式:从拆行到置换
二阶是怎么拆出来的
把第一行拆成 ,再对第二行做同样的拆分,得到四个矩阵:
继续拆第二行,会出现四个 行列式。其中两个含零列,直接为零;剩下
第二个之所以是负号,是因为它需要一次行交换才能变成对角形。
三阶与「幸存项」
三阶时,每一行拆成三块,一共产生 个矩阵。绝大多数含零列,只有每行每列各取一个元素的那些会留下。
这样的取法有多少种?第一行有 3 列可选,第二行只剩 2 列,第三行只剩 1 列,共 种。每一种对应列号的一个排列。
以排列 为例:
剩下的行列式是一个置换矩阵的行列式,等于 ,因为把第 2、3 行交换一次就回到单位矩阵。
一般地,设 是 的一个排列,记 为把它排回自然顺序所需的交换次数的奇偶性(偶为 ,奇为 ),则
这就是大公式。项数是 :,,,。
一个容易被口诀误导的地方
三阶时,主对角线方向的三项带正号、副对角线方向的三项带负号,于是很多人记住「斜着乘」。但这条规则只对三阶成立。
四阶的副对角线元素乘积其实带正号:把第 1 行与第 4 行交换、第 2 行与第 3 行交换,两次交换后得到单位矩阵,所以符号是 。
口诀失效的根本原因是:符号由排列的奇偶性决定,而不是由「往哪个方向画线」决定。
四阶例子:24 项里只有两项非零
考虑一个含大量零的四阶矩阵(课堂上现写的例子)。按大公式逐行逐列选元素,只有两条完整路径:
- 排列 :乘积为 ,需要两次交换,符号 。
- 排列 :乘积为 ,需要一次交换,符号 。
其余 22 项都因为取到零而消失。总和为 ,所以矩阵奇异。
用行关系验证:第 1 行加第 3 行得到全 1 行,第 2 行加第 4 行也得到全 1 行,因此
零空间里也有对应的向量 。大公式给出数值,行关系给出原因,两者互相印证。
代数余子式:把 n 阶降成 n-1 阶
从大公式分组
把大公式按第一行的元素分组:所有含 的项、所有含 的项,等等。
含 的那一组,剩下的因子恰好是「删掉第 1 行第 1 列后」的 阶行列式:
含 的那一组,剩下的是删掉第 1 行第 2 列的行列式,但整体多一个负号。把这个符号并入系数,就得到代数余子式。
定义
对元素 ,删去第 行与第 列,得到 阶矩阵 (称为余子式)。代数余子式定义为
符号呈棋盘状:
余子式展开公式
沿任意一行展开:
沿任意一列同样成立:
列版本成立的原因是 。
二阶验证:
三种公式的分工
| 公式 | 形式 | 特点 |
|---|---|---|
| 主元公式 | (带符号) | 计算时最实用,复杂工作已在消元中完成 |
| 大公式 | 项之和 | 结构最清楚,计算量最大 |
| 余子式 | 沿一行/列展开 | 介于两者之间,适合有大量零的矩阵 |
三对角矩阵的例子
设 是 阶三对角矩阵,主对角线全为 1,上下两条次对角线也全为 1,其余为 0。例如
沿第一行做余子式展开。第一个元素 的余子式是 ;第二个元素 的余子式,删掉第 1 行第 2 列后左上角出现一个零,展开只剩一个 阶的三对角块,符号为负。因此
初值:
递推得到
周期为 6。所以
这个例子说明两件事:余子式展开可以把高阶问题化成递推;递推序列可能出现周期性,而不是单调增长。
补充: 周期 6 可以用特征方程解释。递推 的特征根是 ,对应周期 6。课堂上没有展开这一步。
核心回顾
- 大公式按置换展开,共 项,符号由置换奇偶性决定。
- 三阶的「对角线口诀」不能推广到四阶及以上。
- 代数余子式把 阶行列式降为 阶;符号按 棋盘分布。
- 沿任意行或列展开都成立。
- 三对角全 1 矩阵满足二阶递推,行列式序列周期为 6。
常见误区
- 把三阶对角线法则用在四阶。四阶副对角线的符号是正的。
- 忘记余子式的符号。 已包含 ,不要再手动加减。
- 认为余子式展开能降低计算量。一般矩阵仍然是 ,只有大量零时才有优势。
- 把余子式 与代数余子式 混用。前者是行列式,后者带符号。
理解检验
1. 四阶行列式一共有多少项?其中正负号各多少?
参考答案: 项,对应 个列号的排列。符号由置换奇偶性决定,偶排列与奇排列各占一半,所以正号 项、负号 项。一般地, 时各有 项。
2. 为什么三阶的斜线法则不能用于四阶?请用副对角线例子说明。
参考答案:三阶斜线法则只是「符号 主对角线为正、副对角线为负」这一巧合的描述。四阶取副对角线元素 ,对应排列 :把第 1、4 行交换、第 2、3 行交换,两次交换回到单位矩阵,所以 ,这一项带正号,与斜线法则的「副对角线取负」相反。符号只由排列奇偶性决定,与元素在图上画线的方向无关。
3. 写出 行列式沿第二行展开的公式,并标出每一项的符号。
参考答案:沿第 2 行展开,符号由 给出: 为负, 为正, 为负。于是
其中 是删去第 2 行、第 列后的 矩阵。例如 的余子式是 ,前面要加负号。
4. 在三对角矩阵的递推中,第二项的负号从哪里来?
参考答案:沿第一行展开,第一行是 。第一项 给出 ;第二项是 ,它的代数余子式带符号 ,所以贡献 。删去第 1 行第 2 列后,左上角出现一个零;再沿那一行展开,只剩右下角的 阶三对角块。于是负号来自余子式符号 ,而不是来自元素本身。
5. 若 、,求 。
参考答案:由递推 ,取 :
这与序列 的周期 6 一致:。
与前后课程的关系
上一讲用性质定义了行列式;这一讲给出两种显式表达。下一讲用余子式求逆矩阵(伴随矩阵)、用行列式表示 Cramer 法则,并把行列式解释为体积。之后课程进入特征值与对角化。
What this lecture delivers
The previous lecture derived every behavior of the determinant from three properties but gave no explicit formula. This lecture supplies two: the big formula (a sum over permutations, with terms) and the cofactor formula (expansion that reduces an determinant to ).
Neither is practical for large matrices, but both reveal the structure. Actual computation still uses the previous lecture's recipe: eliminate, then multiply the pivots.
Timeline
| Time | Topic |
|---|---|
| 0:00 | Second lecture on determinants: explicit formulas |
| 3:15 | Determinants of diagonal matrices |
| 6:25 | Splitting each row into one nonzero entry |
| 9:32 | The six terms in the 3×3 case |
| 12:33 | Signs of terms and column order |
| 15:39 | A 4×4 anti-diagonal example |
| 18:52 | The general formula: a sum over terms |
| 22:02 | Why the big formula is impractical |
| 28:08 | Grouping terms by the first row |
| 31:19 | The two terms containing |
| 34:24 | The terms with and their signs |
| 37:34 | The sign |
| 40:47 | An alternative route to the determinant |
| 43:51 | The cofactor formula |
| 47:02 | A 2×2 cofactor example |
| 50:21 | Building the cofactor matrix |
The big formula: from row splitting to permutations
Splitting the case
Split the first row into and then split the second row the same way. Four matrices appear:
Two of the four resulting determinants contain a zero column and vanish. The survivors are
The second carries a minus because one row exchange turns it into diagonal form.
The case and the survivors
Splitting each of three rows into three pieces produces matrices. Most die on a zero column. The survivors are exactly those that take one entry from each row and each column.
How many such choices? Three for the first row, two for the second, one for the third: . Each corresponds to a permutation of the column indices.
For the permutation :
The remaining determinant is that of a permutation matrix and equals , since one exchange of rows 2 and 3 restores the identity.
In general, for a permutation of , let be for an even number of exchanges and for an odd number. Then
This is the big formula. It has terms: , , , .
Where the three-by-three mnemonic breaks
In the case the three products along the main diagonal carry plus signs and the three along the anti-diagonal carry minus signs, which invites the mnemonic "multiply along the diagonals". That rule holds only for .
For , the anti-diagonal product actually carries a plus sign: swapping rows 1 and 4 and then rows 2 and 3 restores the identity, two exchanges, so the sign is .
The mnemonic fails because the sign comes from permutation parity, not from which way a line is drawn.
A example: only two nonzero terms
Take a matrix with many zeros (the lecture writes one on the spot). Scanning one entry per row and column leaves only two complete paths:
- permutation : product , two exchanges, sign ;
- permutation : product , one exchange, sign .
The other 22 terms vanish. The total is , so the matrix is singular.
A row relation confirms it: row 1 plus row 3 is the all-ones row, and row 2 plus row 4 is also the all-ones row, hence
The null space also contains . The formula gives the number; the row relation gives the reason.
Cofactors: reducing to
Grouping the big formula
Group the big formula by the entries of the first row. The group containing has as its remaining factor the determinant of the matrix left after deleting row 1 and column 1:
The group containing leaves the determinant after deleting row 1 and column 2, but with an extra minus sign. Absorbing that sign into the coefficient produces the cofactor.
Definition
For , delete row and column to get the minor . The cofactor is
The signs form a checkerboard:
The cofactor expansion
Along any row:
Along any column:
The column version holds because .
Check on :
How the three formulas divide the work
| Formula | Form | Character |
|---|---|---|
| Pivots | with a sign | Most practical; the work is hidden in elimination |
| Big formula | Sum of terms | Clearest structure, largest computation |
| Cofactors | Expand along a row or column | In between; best when many zeros |
The tridiagonal example
Let be the tridiagonal matrix with ones on the main diagonal and on the two adjacent diagonals, and zeros elsewhere:
Expand along the first row. The first 1 has cofactor . The second 1 has a cofactor whose matrix, after deleting row 1 and column 2, has a zero in the upper-left corner; expanding further leaves a block identical to , with a minus sign. Therefore
With initial values
the sequence is
The period is six. Hence
The example shows two things: cofactor expansion turns a high-order problem into a recurrence, and the resulting sequence can be periodic rather than growing.
Background: The period of six follows from the characteristic equation of , whose roots are . The lecture does not develop this.
Core review
- The big formula sums over permutations, terms, signed by permutation parity.
- The three-by-three diagonal mnemonic does not generalize.
- Cofactors reduce to , with signs given by .
- Expansion works along any row or any column.
- The all-ones tridiagonal matrix satisfies a two-term recurrence and has period six.
Common misconceptions
- Applying the three-by-three diagonal rule to four-by-four. The anti-diagonal sign is positive in the case.
- Forgetting the cofactor sign. already includes ; do not add another sign.
- Expecting cofactor expansion to be cheap. For a general matrix it is still factorial; it helps only when many entries are zero.
- Confusing the minor with the cofactor. The minor is a determinant; the cofactor carries the sign.
Check your understanding
1. How many terms does a determinant have, and how many are positive?
Reference answer: terms, one per permutation of the column indices. The sign is the parity of the permutation, and even and odd permutations are equally many, so terms are positive and negative. In general, for , each sign occurs times.
2. Why does the three-by-three diagonal rule fail at four-by-four? Use the anti-diagonal as the example.
Reference answer: The three-by-three rule merely describes the coincidence that, at order three, main-diagonal products come out positive and anti-diagonal products negative. At order four take the anti-diagonal product , i.e. the permutation : swapping rows and returns the identity in two swaps, so and the term is positive — the opposite of what the rule predicts. The sign depends only on permutation parity, not on which way a line is drawn.
3. Write the expansion of a determinant along its second row, with signs marked.
Reference answer: Expanding along row 2, the signs are : minus for , plus for , minus for . Hence
where is the matrix obtained by deleting row 2 and column . For instance the cofactor of is preceded by a minus sign.
4. In the tridiagonal recurrence, where does the minus sign on the second term come from?
Reference answer: Expand along the first row, which is . The first entry contributes . The second entry is , whose cofactor carries , so it contributes . Deleting row 1 and column 2 leaves a zero in the top-left corner; expanding along that row leaves only the bottom-right tridiagonal block. The minus sign comes from the cofactor sign , not from the entry.
5. If and , find .
Reference answer: With and ,
This matches the period-6 sequence : indeed .
How this connects
The previous lecture defined the determinant through properties; this one gives two explicit expressions. The next lecture uses cofactors to invert a matrix (the adjugate), states Cramer's rule, and interprets the determinant as volume, before the course moves to eigenvalues and diagonalization.