2020年5月31日 星期日

行列式的餘因子遞迴定義:從2階行列式與Cramer法則談起

南京大學數學系的朱富海教授在其文章〈问题引导的代数学: 行列式的多样性〉中討論了行列式的諸多定義方式,非常值得一讀。特別是其中
问题 2 三元一次线性方程组
$$\left\{ \begin{eqnarray*} a_{11} x_1 +a_{12} x_2 + a_{13} x_3 &=&b_1 \\ a_{21} x_1 +a_{22} x_2 + a_{23} x_3 &=&b_2 \\ a_{31} x_1 +a_{32} x_2 + a_{33} x_3 &=&b_3 \end{eqnarray*} \right.$$
有唯一解, 求解的表达式.这个问题稍微复杂了一点, 可以利用消元法化为二元一次方程组, 不过我更喜欢利用二元情形的结论: 把$x_1$看作已知的, 利用后两个方程求出$x_2, x_3$ (用二阶行列式来表达), 再代入第一个方程解出$x_1$. $x_1$的表达式是一个分式, 分子分母有共性, 引入三阶行列式就更能看出整齐性, 甚至猜出了三元情形的 Cramer 法则.
這真是個精闢的看法!觀點恰好與典型的解線性方程組的順序相反。一般慣用的Gauss消去法是由上而下,依序對$x_1, x_2, \cdots, x_n$消元,然後再代回求解。 朱教授此處所言,卻是先考慮排除掉$x_1$,以Cramer公式處理$n-1$元線性方程組後,再代回解出$x_1$,非常的有遞迴的味道!

實際上正是這樣的處理手法,可以自然的導出行列式的餘因子降階定義法!

有名的炸漢堡(Friedberg)線性代數,介紹n階行列式時,就是用餘因子降階法來定義。但是一個問題是,完全不說明這個定義怎麼來的,就是從天而降,讓人摸不著腦袋。我實在很反感這種教學方式。

約定:以下解方程組的過程中,一概考慮非奇異的情況。

1. 2階行列式與Cramer法則 


考慮2元線性方程組$\left\{ \begin{eqnarray*} a_{11}x_1 + a_{12}x_2 &=& b_1 \\ a_{21}x_1 + a_{22}x_2 &=& b_2 \end{eqnarray*} \right.$,對其中的第2式$a_{21}x_1 + a_{22}x_2 = b_2$,以$x_1$表示出$x_2$解得$x_2 = \frac{1}{a_{22}} \left( b_2 - a_{21}x_1 \right)$,代回原方程組中的第1式,得
$$\begin{eqnarray*}a_{11} x_1 + a_{12} \cdot \frac{1}{a_{22}} \left( b_2 - a_{21}x_1 \right) &=& b_1, \\ a_{11} a_{22} x_1 + a_{12} \left( b_2 - a_{21}x_1 \right) &=& a_{22} b_1, \\ \left( a_{11} a_{22} - a_{12} a_{21} \right)x_1 &=& b_1 a_{22} - b_2 a_{12}, \end{eqnarray*}$$
當$a_{11} a_{22} - a_{12} a_{21} \ne 0$時,可解得
$$x_1 = \frac{b_1 a_{22} - b_2 a_{12}}{a_{11} a_{22} - a_{12} a_{21}}.$$
仔細觀察分子與分母的結構,非常的類似。定義2階行列式 (determinant of order 2)
$$\left| \begin{array}{cc} a & b \\ c  & d \end{array} \right| = ad - bc.$$
於是$x_1$可改寫為
$$x_1 = \frac{\left| \begin{array}{cc} b_1 & a_{12} \\ b_2  & a_{22} \end{array} \right|}{\left| \begin{array}{cc} a_{11} & a_{12} \\ a_{21} & a_{22} \end{array} \right|}.$$
為了解出$x_2$,如果將$x_1$的式子代回原方程組,會遭遇複雜的運算。我們可以換個思路。由於加法具有交換律,我們可以考慮將原來的方程組變形為
$$\left\{ \begin{eqnarray*} a_{12}x_2 + a_{11}x_1 &=& b_1 \\ a_{22}x_2 + a_{21}x_1 &=& b_2 \end{eqnarray*} \right. .$$
這個方程組當然與原本的方程組是同解的!接著依樣畫葫蘆,可以求得
$$x_2 = \frac{\left| \begin{array}{cc} b_1 & a_{11} \\ b_2  & a_{21} \end{array} \right|}{\left| \begin{array}{cc} a_{12} & a_{11} \\ a_{22} & a_{21} \end{array} \right|}.$$
儘管$x_1, x_2$乍看有點不同,但其實他們有相同的分母。在此我們要先插記一個2階行列式的性質:

性質  2階行列式中,對調column後,新行列式值為原行列式值添上一負號。

[證]. $\left| \begin{array}{cc} b & a \\ d & c \end{array} \right| = bc - ad = -(ad - bc) = -\left| \begin{array}{cc} a & b \\ c & d \end{array} \right|.$
(證明終了)

有了這個性質後,我們就可以重新計算$x_2$如下:
$$x_2 = \frac{\left| \begin{array}{cc} b_1 & a_{11} \\ b_2  & a_{21} \end{array} \right|}{\left| \begin{array}{cc} a_{12} & a_{11} \\ a_{22} & a_{21} \end{array} \right|} = \frac{ - \left| \begin{array}{cc} a_{11} & b_1 \\ a_{21}  & b_2 \end{array} \right|}{ - \left| \begin{array}{cc} a_{11} & a_{12} \\ a_{21} & a_{22} \end{array} \right|} = \frac{\left| \begin{array}{cc} a_{11} & b_1 \\ a_{21}  & b_2 \end{array} \right|}{\left| \begin{array}{cc} a_{11} & a_{12} \\ a_{21} & a_{22} \end{array} \right|}.$$
因此我們稱2階行列式$\left| \begin{array}{cc} a_{11} & a_{12} \\ a_{21} & a_{22} \end{array} \right|$為線性方程組$\left\{ \begin{eqnarray*} a_{11}x_1 + a_{12}x_2 &=& b_1 \\ a_{21}x_1 + a_{22}x_2 &=& b_2 \end{eqnarray*} \right.$的係數行列式,記為$D^{(2)}$。而行列式$\left| \begin{array}{cc} b_1 & a_{12} \\ b_2  & a_{22} \end{array} \right|$與$\left| \begin{array}{cc} a_{11} & b_1 \\ a_{21}  & b_2 \end{array} \right|$則分別記為$D^{(2)}_1$與$D^{(2)}_2$,從而得到2階線性方程組的Cramer公式:
$$x_1 = \frac{D^{(2)}_1}{D^{(2)}}, x_2 = \frac{D^{(2)}_2}{D^{(2)}}.$$
此處再提醒,行列式$D^{(2)}_1$是用常數項$\begin{eqnarray*} b_1 \\ b_2 \end{eqnarray*}$替換掉係數行列式$D^{(2)}$的column 1而得到,$D^{(2)}_2$則是用常數項$\begin{eqnarray*} b_1 \\ b_2 \end{eqnarray*}$替換掉係數行列式$D^{(2)}$的column 2而得。

G. Cramer (1704-1752)
Cramer法則首次的公開是在此書的附錄


紅線框起的部分就是2階線性方程組的Cramer法則,只是當年沒有採用行列式記號。下面跟著的是3階的情況。



2. 用2階Cramer法則解3階線性方程組,用2階行列式導出3階行列式  


現在考慮3階線性方程組
$$\left\{ \begin{eqnarray*} a_{11}x_1 + a_{12}x_2 + a_{13}x_3 &=& b_1 \\ a_{21}x_1 + a_{22}x_2 + a_{23}x_3 &=& b_2 \\ a_{31}x_1 + a_{32}x_2 + a_{33}x_3 &=& b_3 \end{eqnarray*} \right. .$$
首先針對其中的第2式與第3式,改寫作
$$\left\{ \begin{eqnarray*} a_{22}x_2 + a_{23}x_3 &=& b_2 - a_{21}x_1 \\ a_{32}x_2 + a_{33}x_3 &=& b_3 - a_{31}x_1 \end{eqnarray*} \right. .$$
然後使用2階線性方程組的Cramer法則,得到
$$x_2 = \frac{\left| \begin{array}{cc} b_2 - a_{21}x_1 & a_{23} \\ b_3 - a_{31}x_1 & a_{33} \end{array} \right|}{\left| \begin{array}{cc} a_{22} & a_{23} \\ a_{32} & a_{33} \end{array} \right|} = \frac{\left| \begin{array}{cc} b_2 & a_{23} \\ b_3 & a_{33} \end{array} \right| - x_1 \left| \begin{array}{cc} a_{21} & a_{23} \\ a_{31} & a_{33} \end{array} \right|}{\left| \begin{array}{cc} a_{22} & a_{23} \\ a_{32} & a_{33} \end{array} \right|},$$
以及
$$x_3 = \frac{\left| \begin{array}{cc} a_{22} & b_2 - a_{21}x_1 \\ a_{32} & b_3 - a_{31}x_1 \end{array} \right|}{\left| \begin{array}{cc} a_{22} & a_{23} \\ a_{32} & a_{33} \end{array} \right|} = \frac{\left| \begin{array}{cc} a_{22} & b_2 \\ a_{32} & b_3 \end{array} \right| - x_1 \left| \begin{array}{cc} a_{22} & a_{21} \\ a_{32} & a_{31} \end{array} \right|}{\left| \begin{array}{cc} a_{22} & a_{23} \\ a_{32} & a_{33} \end{array} \right|}.$$
代回原方程組中的第1式,
$$a_{11} x_1 + a_{12} \frac{\left| \begin{array}{cc} b_2 & a_{23} \\ b_3 & a_{33} \end{array} \right| - x_1 \left| \begin{array}{cc} a_{21} & a_{23} \\ a_{31} & a_{33} \end{array} \right|}{\left| \begin{array}{cc} a_{22} & a_{23} \\ a_{32} & a_{33} \end{array} \right|} + a_{13} \frac{\left| \begin{array}{cc} a_{22} & b_2 \\ a_{32} & b_3 \end{array} \right| - x_1 \left| \begin{array}{cc} a_{22} & a_{21} \\ a_{32} & a_{31} \end{array} \right|}{\left| \begin{array}{cc} a_{22} & a_{23} \\ a_{32} & a_{33} \end{array} \right|} = b_1,$$
整理得
$$\left( a_{11} \left| \begin{array}{cc} a_{22} & a_{23} \\ a_{32} & a_{33} \end{array} \right| - a_{12}\left| \begin{array}{cc} a_{21} & a_{23} \\ a_{31} & a_{33} \end{array} \right| - a_{13}\left| \begin{array}{cc} a_{22} & a_{21} \\ a_{32} & a_{31} \end{array} \right| \right) x_1 = b_1 \left| \begin{array}{cc} a_{22} & a_{23} \\ a_{32} & a_{33} \end{array} \right| - a_{12}\left| \begin{array}{cc} b_2 & a_{23} \\ b_3 & a_{33} \end{array} \right| - a_{13}\left| \begin{array}{cc} a_{22} & b_2 \\ a_{32} & b_3 \end{array} \right|.$$
對於上式中,牽涉到$\begin{eqnarray*} a_{21} \\ a_{31} \end{eqnarray*}$與$\begin{eqnarray*} b_2 \\ b_3 \end{eqnarray*}$的行列式,將$\begin{eqnarray*} a_{21} \\ a_{31} \end{eqnarray*}$與$\begin{eqnarray*} b_2 \\ b_3 \end{eqnarray*}$各別調換至其所在行列式中的column1位置,利用前文推導過的「行列式交換column添負號」,得
$$\left( a_{11} \left| \begin{array}{cc} a_{22} & a_{23} \\ a_{32} & a_{33} \end{array} \right| - a_{12}\left| \begin{array}{cc} a_{21} & a_{23} \\ a_{31} & a_{33} \end{array} \right| + a_{13}\left| \begin{array}{cc} a_{21} & a_{22} \\ a_{31} & a_{32} \end{array} \right| \right) x_1 = b_1 \left| \begin{array}{cc} a_{22} & a_{23} \\ a_{32} & a_{33} \end{array} \right| - a_{12}\left| \begin{array}{cc} b_2 & a_{23} \\ b_3 & a_{33} \end{array} \right| + a_{13}\left| \begin{array}{cc} b_2 & a_{22} \\ b_3 & a_{32} \end{array} \right|.$$
如果我們定義3階行列式 (determinant of order 3)
$$\left| \begin{array}{ccc} d_{11} & d_{12} & d_{13} \\ d_{21} & d_{22} & d_{23} \\ d_{31} & d_{32} & d_{33} \\  \end{array} \right| = d_{11} \left| \begin{array}{cc} d_{22} & d_{23} \\ d_{32} & d_{33} \end{array} \right| - d_{12} \left| \begin{array}{cc} d_{21} & d_{23} \\ d_{31} & d_{33}  \end{array} \right| + d_{13} \left| \begin{array}{cc} d_{21} & d_{22} \\ d_{31} & d_{32} \end{array} \right|.$$
那麼上式可改寫為
$$\left| \begin{array}{ccc} a_{11} & a_{12} & a_{13} \\ a_{21} & a_{22} & a_{23} \\ a_{31} & a_{32} & a_{33} \end{array} \right| x_1 = \left| \begin{array}{ccc} b_1 & a_{12} & a_{13} \\ b_2 & a_{22} & a_{23} \\ b_3 & a_{32} & a_{33} \end{array} \right|.$$
從而可解出
$$x_1 = \frac{\left| \begin{array}{ccc} b_1 & a_{12} & a_{13} \\ b_2 & a_{22} & a_{23} \\ b_3 & a_{32} & a_{33} \end{array} \right|}{\left| \begin{array}{ccc} a_{11} & a_{12} & a_{13} \\ a_{21} & a_{22} & a_{23} \\ a_{31} & a_{32} & a_{33} \end{array} \right|}.$$
要解出$x_2$與$x_3$,無須將方才解出的$x_1$代回方程組,我們採取調換標號的手段,如下所示:
$$\left\{ \begin{array}{ccc} a_{11}x_1 + a_{12}x_2 + a_{13}x_3 &=& b_1 \\ a_{21}x_1 + a_{22}x_2 + a_{23}x_3 &=& b_2 \\ a_{31}x_1 + a_{32}x_2 + a_{33}x_3 &=& b_3 \end{array} \right. \rightarrow \left\{ \begin{array}{ccc} a_{12}x_2 + a_{11}x_1 + a_{13}x_3 &=& b_1 \\ a_{22}x_2 + a_{21}x_1 + a_{23}x_3 &=& b_2 \\ a_{32}x_2 + a_{31}x_1 + a_{33}x_3 &=& b_3 \end{array} \right. \Rightarrow x_2 = \frac{\left| \begin{array}{ccc} b_1 & a_{11} & a_{13} \\ b_2 & a_{21} & a_{23} \\ b_3 & a_{31} & a_{33} \end{array} \right|}{\left| \begin{array}{ccc} a_{12} & a_{11} & a_{13} \\ a_{22} & a_{21} & a_{23} \\ a_{32} & a_{31} & a_{33} \end{array} \right|}.$$
以及
$$\left\{ \begin{array}{ccc} a_{11}x_1 + a_{12}x_2 + a_{13}x_3 &=& b_1 \\ a_{21}x_1 + a_{22}x_2 + a_{23}x_3 &=& b_2 \\ a_{31}x_1 + a_{32}x_2 + a_{33}x_3 &=& b_3 \end{array} \right. \rightarrow \left\{ \begin{array}{ccc} a_{13}x_3 + a_{12}x_2 + a_{11}x_1 &=& b_1 \\ a_{23}x_3 + a_{22}x_2 + a_{21}x_1 &=& b_2 \\ a_{33}x_3 + a_{32}x_2 + a_{31}x_1 &=& b_3 \end{array} \right. \Rightarrow x_3 = \frac{\left| \begin{array}{ccc} b_1 & a_{12} & a_{11} \\ b_2 & a_{22} & a_{21} \\ b_3 & a_{32} & a_{31} \end{array} \right|}{\left| \begin{array}{ccc} a_{13} & a_{12} & a_{11} \\ a_{23} & a_{22} & a_{21} \\ a_{33} & a_{32} & a_{31} \end{array} \right|}.$$
為了使$x_2, x_3$的分母形式與$x_1$一致,我們還要證明:

性質  3階行列式中,對調column後,新行列式值為原行列式值添上一負號。

[證]. 考慮column 1與column 2對調的情況:
$$\begin{eqnarray*} \left| \begin{array}{ccc} d_{12} & d_{11} & d_{13} \\ d_{22} & d_{21} & d_{23} \\ d_{32} & d_{31} & d_{33} \end{array} \right| &=& d_{12} \left| \begin{array}{cc} d_{21} & d_{23} \\ d_{31} & d_{33} \end{array} \right| - d_{11}\left| \begin{array}{cc} d_{22} & d_{23} \\ d_{32} & d_{33} \end{array} \right| + d_{13} \left| \begin{array}{cc} d_{22} & d_{21} \\ d_{32} & d_{31} \end{array} \right| \\ &=& d_{12} \left| \begin{array}{cc} d_{21} & d_{23} \\ d_{31} & d_{33} \end{array} \right| - d_{11}\left| \begin{array}{cc} d_{22} & d_{23} \\ d_{32} & d_{33} \end{array} \right| - d_{13} \left| \begin{array}{cc} d_{21} & d_{22} \\ d_{31} & d_{32} \end{array} \right| \\ &=& -\left( d_{11}\left| \begin{array}{cc} d_{22} & d_{23} \\ d_{32} & d_{33} \end{array} \right| - d_{12} \left| \begin{array}{cc} d_{21} & d_{23} \\ d_{31} & d_{33} \end{array} \right| + d_{13} \left| \begin{array}{cc} d_{21} & d_{22} \\ d_{31} & d_{32} \end{array} \right| \right) \\ &=& - \left| \begin{array}{ccc} d_{11} & d_{12} & d_{13} \\ d_{21} & d_{22} & d_{23} \\ d_{31} & d_{32} & d_{33} \end{array} \right|. \end{eqnarray*}$$
其餘調換的情況也是類推。
(證明終了)

由此性質,可得
$$x_2 = \frac{\left| \begin{array}{ccc} b_1 & a_{11} & a_{13} \\ b_2 & a_{21} & a_{23} \\ b_3 & a_{31} & a_{33} \end{array} \right|}{\left| \begin{array}{ccc} a_{12} & a_{11} & a_{13} \\ a_{22} & a_{21} & a_{23} \\ a_{32} & a_{31} & a_{33} \end{array} \right|} = \frac{-\left| \begin{array}{ccc} a_{11} & b_1 & a_{13} \\ a_{21} & b_2 & a_{23} \\ a_{31} & b_3 & a_{33} \end{array} \right|}{-\left| \begin{array}{ccc} a_{11} & a_{12} & a_{13} \\ a_{21} & a_{22} & a_{23} \\ a_{31} & a_{32} & a_{33} \end{array} \right|} = \frac{\left| \begin{array}{ccc} a_{11} & b_1 & a_{13} \\ a_{21} & b_2 & a_{23} \\ a_{31} & b_3 & a_{33} \end{array} \right|}{\left| \begin{array}{ccc} a_{11} & a_{12} & a_{13} \\ a_{21} & a_{22} & a_{23} \\ a_{31} & a_{32} & a_{33} \end{array} \right|},$$
$$x_3 = \frac{\left| \begin{array}{ccc} b_1 & a_{12} & a_{11} \\ b_2 & a_{22} & a_{21} \\ b_3 & a_{32} & a_{31} \end{array} \right|}{\left| \begin{array}{ccc} a_{13} & a_{12} & a_{11} \\ a_{23} & a_{22} & a_{21} \\ a_{33} & a_{32} & a_{31} \end{array} \right|} = \frac{-\left| \begin{array}{ccc} a_{11} & a_{12} & b_1 \\ a_{21} & a_{22} & b_2 \\ a_{31} & a_{32} & b_3 \end{array} \right|}{-\left| \begin{array}{ccc} a_{11} & a_{12} & a_{13} \\ a_{21} & a_{22} & a_{23} \\ a_{31} & a_{32} & a_{33} \end{array} \right|} = \frac{\left| \begin{array}{ccc} a_{11} & a_{12} & b_1 \\ a_{21} & a_{22} & b_2 \\ a_{31} & a_{32} & b_3 \end{array} \right|}{\left| \begin{array}{ccc} a_{11} & a_{12} & a_{13} \\ a_{21} & a_{22} & a_{23} \\ a_{31} & a_{32} & a_{33} \end{array} \right|}.$$

類似對2階線性方程組的討論,我們可定義3階線性方程組$\left\{ \begin{eqnarray*} a_{11}x_1 + a_{12}x_2 + a_{13}x_3 &=& b_1 \\ a_{21}x_1 + a_{22}x_2 + a_{23}x_3 &=& b_2 \\ a_{31}x_1 + a_{32}x_2 + a_{33}x_3 &=& b_3 \end{eqnarray*} \right.$的係數行列式$D^{(3)}$及$D^{(3)}_1, D^{(3)}_2, D^{(3)}_3$如下:
$$D^{(3)} = \left| \begin{array}{ccc} a_{11} & a_{12} & a_{13} \\ a_{21} & a_{22} & a_{23} \\ a_{31} & a_{32} & a_{33} \end{array} \right|,  D^{(3)}_1 = \left| \begin{array}{ccc} b_1 & a_{12} & a_{13} \\ b_2 & a_{22} & a_{23} \\ b_3 & a_{32} & a_{33} \end{array} \right|, D^{(3)}_2 = \left| \begin{array}{ccc} a_{11} & b_1 & a_{13} \\ a_{21} & b_2 & a_{23} \\ a_{31} & b_3 & a_{33} \end{array} \right|, D^{(3)}_3 = \left| \begin{array}{ccc} a_{11} & a_{12} & b_1 \\ a_{21} & a_{22} & b_2 \\ a_{31} & a_{32} & b_3 \end{array} \right|.$$
從而3階線性方程組的Cramer法則可表述為
$$x_1 = \frac{D^{(3)}_1}{D^{(3)}}, x_2 = \frac{D^{(3)}_2}{D^{(3)}}, x_3 = \frac{D^{(3)}_3}{D^{(3)}}.$$

3. 從$n-1$到$n$


對於$n$階線性方程組
$$\left\{ \begin{eqnarray*} a_{11}x_1 + a_{12}x_2 + \cdots + a_{1n}x_n &=& b_1 \\ a_{21}x_1 + a_{22}x_2 + \cdots + a_{2n}x_n &=& b_2 \\ \vdots&& \\ a_{n1}x_1 + a_{n2}x_2 + \cdots + a_{nn}x_n &=& b_n \end{eqnarray*} \right. ,$$
$A$中的column分別構成以下的column向量
$$A_1 = \left[ \begin{array}{c} a_{11} \\ a_{21} \\ \vdots \\ a_{n1} \end{array} \right], A_2 = \left[ \begin{array}{c} a_{12} \\ a_{22} \\ \vdots \\ a_{n2} \end{array} \right], \cdots, A_n = \left[ \begin{array}{c} a_{1n} \\ a_{2n} \\ \vdots \\ a_{nn} \end{array} \right].$$
方程組右端的常數項則記為
$$b = \left[ \begin{array}{c} b_1 \\ b_2 \\ \vdots \\ b_n \end{array} \right].$$
由於我們會針對原方程組中的後$n-1$條方程式進行討論,所以再定義以下的column向量:
$$\tilde{A_1} = \left[ \begin{array}{c} a_{21} \\ \vdots \\ a_{n1} \end{array} \right],\tilde{A_2} = \left[ \begin{array}{c} a_{22} \\ \vdots \\ a_{n2} \end{array} \right], \cdots, \tilde{A_n} = \left[ \begin{array}{c} a_{2n} \\ \vdots \\ a_{nn} \end{array} \right], \tilde{b} = \left[ \begin{array}{c} b_2 \\ \vdots \\ b_n \end{array} \right].$$
它們都是從原來的$A_1, A_2, \cdots, A_n, b$砍掉頭一個元素後得到的向量。注意它們都是$n-1$維。
另外,我們用$det(d_1, d_2, \cdots, d_k)$表示由$k$維column向量所構成的$k$階行列式。
由前面從2階推導至3階的經驗,考慮以下三條歸納假設:
  1. 我們會計算$n-1$階行列式。
    $$D^{(n-1)} = \left| \begin{array}{cccc} d_{11} & d_{12} & \cdots & d_{1, n-1} \\ d_{21} & d_{22} & \cdots & d_{2, n-1} \\ \vdots & \vdots & & \vdots \\ d_{n-1, 1} & d_{n-1, 2} & \cdots & d_{n-1, n-1} \end{array} \right|.$$
  2. $n-1$階行列式具有「交換column後加上負號」的性質。
  3. 我們有$n-1$階Cramer法則。
 ​ 有了以上準備工作後,我們可以開始來討論$n$階線性方程組了。
 ​ 首先我們改寫原方程組中的後$n-1$條如下:
$$\left\{ \begin{eqnarray*} a_{22}x_2 + \cdots + a_{2n}x_n &=& b_2 - a_{21}x_1 \\ \vdots&& \\ a_{n2}x_2 + \cdots + a_{nn}x_n &=& b_n - a_{n1}x_1 \end{eqnarray*} \right.,$$
於是可根據歸納假設3解出$x_2, \cdots, x_n$
$$\displaystyle x_2 = \frac{det(\tilde{b} - x_1 \tilde{A_1}, \cdots, \tilde{A_n})}{det(\tilde{A_2}, \cdots, \tilde{A_n})}, \cdots,  x_n = \frac{det(\tilde{A_2}, \cdots, \tilde{b} - x_1 \tilde{A_1})}{det(\tilde{A_2}, \cdots, \tilde{A_n})}.$$
代回原方程組中的第一條式子,得到
$$a_{11}x_1 + a_{12} \frac{det(\tilde{b} - x_1 \tilde{A_1}, \cdots, \tilde{A_n})}{det(\tilde{A_2}, \cdots, \tilde{A_n})} + \cdots + a_{1n} \frac{det(\tilde{A_2}, \cdots, \tilde{b} - x_1 \tilde{A_1})}{det(\tilde{A_2}, \cdots, \tilde{A_n})} = b_1,$$
左右同乘以$det(\tilde{A_2}, \cdots, \tilde{A_n})$,變為
$$a_{11} x_1 det(\tilde{A_2}, \cdots, \tilde{A_n}) + a_{12} det(\tilde{b} - x_1 \tilde{A_1}, \cdots, \tilde{A_n}) + \cdots + a_{1n} det(\tilde{A_2}, \cdots, \tilde{b} - x_1 \tilde{A_1}) = b_1det(\tilde{A_2}, \cdots, \tilde{A_n}),$$
再利用$n-1$階行列式的多重線性性質,得
$$\begin{eqnarray*}&&a_{11} x_1 det(\tilde{A_2}, \cdots, \tilde{A_n}) + a_{12} det(\tilde{b}, \cdots, \tilde{A_n}) - a_{12} x_1 det(\tilde{A_1}, \cdots, \tilde{A_n}) + \cdots + a_{1n} det(\tilde{A_2}, \cdots, \tilde{b}) - a_{1n} x_1 det(\tilde{A_2}, \cdots, \tilde{A_1}) \\ &=& b_1 det(\tilde{A_2}, \cdots, \tilde{A_n}),\end{eqnarray*}$$
重新整理得
$$\begin{eqnarray*}&& \left[ a_{11} det(\tilde{A_2}, \cdots, \tilde{A_n}) - a_{12} det(\tilde{A_1}, \cdots, \tilde{A_n}) - \cdots - a_{1n} det(\tilde{A_2}, \cdots, \tilde{A_1}) \right] x_1 \\ &=& b_1 det(\tilde{A_2}, \cdots, \tilde{A_n}) - a_{12} det(\tilde{b}, \cdots, \tilde{A_n}) - \cdots - a_{1n} det(\tilde{A_2}, \cdots, \tilde{b})\end{eqnarray*}$$
對於上式中的每個$n-1$階行列式,將其中的$\tilde{A_1}$或$\tilde{b}$逐步與其前頭的元素交換,挪移到column 1的位置,並且保持其餘column的相對順序不變,則得
$$ \begin{eqnarray*} && \left[ a_{11} det(\tilde{A_2}, \cdots, \tilde{A_n}) + a_{12} (-1)^1 det(\tilde{A_1}, \tilde{A_3}, \cdots, \tilde{A_n}) + \cdots + a_{1n} (-1)^{1 + (n-2)} det(\tilde{A_1}, \tilde{A_2}, \cdots, \tilde{A_{n - 1}}) \right] x_1 \\ &=& b_1 det(\tilde{A_2}, \cdots, \tilde{A_n}) + a_{12} (-1)^1 det(\tilde{b}, \tilde{A_3}, \cdots, \tilde{A_n}) + \cdots + a_{1n} (-1)^{1 + (n-2)} det(\tilde{b}, \tilde{A_2}, \cdots, \tilde{A_{n - 1}}). \end{eqnarray*} $$
這啟發了我們定義$n$階行列式 (determinant of order n)
$$ \begin{eqnarray*} D^{(n)} &=& \left| \begin{array}{cccc} d_{11} & d_{12} & \cdots & d_{1n} \\ d_{21} & d_{22} & \cdots & d_{2n} \\ \vdots & \vdots & & \vdots \\ d_{n1} & d_{n2} & \cdots & d_{nn} \\  \end{array} \right| \\ &=& d_{11} (-1)^{1 + 1} \left| \begin{array}{ccc} d_{22} & \cdots & d_{2n} \\ \vdots & & \vdots \\ d_{n2} & \cdots & d_{nn} \\ \end{array} \right| + d_{12} (-1)^{1+2} \left| \begin{array}{cccc} d_{21} & d_{23} & \cdots & d_{2n} \\ \vdots & & \vdots \\ d_{n1} & d_{n3} & \cdots & d_{nn} \\ \end{array} \right| + \cdots + d_{1n} (-1)^{1 + n}\left| \begin{array}{ccc} d_{22} & \cdots & d_{2, n-1} \\ \vdots & & \vdots \\ d_{n2} & \cdots & d_{n, n-1} \\ \end{array} \right|. \end{eqnarray*} $$
從而可將方才的等式改寫為
$$ \left| \begin{array}{cccc} a_{11} & a_{12} & \cdots & a_{1n} \\ a_{21} & a_{22} & \cdots & a_{2n} \\ \vdots & \vdots & & \vdots \\ a_{n1} & a_{n2} & \cdots & a_{nn} \end{array} \right| x_1 = \left| \begin{array}{cccc} b_1 & a_{12} & \cdots & a_{1n} \\ b_2 & a_{22} & \cdots & a_{2n} \\ \vdots & \vdots & & \vdots \\ b_n & a_{n2} & \cdots & a_{nn} \end{array} \right|. $$
因為假定了方程組非奇異(non-singular),所以上式中$x_1$的係數必非零,故
$$ x_1 = \frac{\left| \begin{array}{cccc} b_1 & a_{12} & \cdots & a_{1n} \\ b_2 & a_{22} & \cdots & a_{2n} \\ \vdots & \vdots & & \vdots \\ b_n & a_{n2} & \cdots & a_{nn} \end{array} \right|}{\left| \begin{array}{cccc} a_{11} & a_{12} & \cdots & a_{1n} \\ a_{21} & a_{22} & \cdots & a_{2n} \\ \vdots & \vdots & & \vdots \\ a_{n1} & a_{n2} & \cdots & a_{nn} \end{array} \right|} = \frac{det(b, A_2, \cdots, A_n)}{det(A)}. $$
如果將原方程組改寫為
$$ \left\{ \begin{eqnarray*} a_{12}x_2 + a_{11}x_1 + a_{13}x_3 + \cdots + a_{1n}x_n &=& b_1 \\ a_{22}x_2 + a_{21}x_1 + a_{23}x_3 + \cdots + a_{2n}x_n &=& b_2 \\ \vdots && \\ a_{n2}x_2 + a_{n1}x_1 + a_{n3}x_3 + \cdots + a_{nn}x_n &=& b_1 \\ \end{eqnarray*} \right. ,$$
那麼仿照以上的討論,可解得
$$ x_2 = \frac{\left|  \begin{array}{ccccc} b_1 & a_{11} & a_{13} & \cdots & a_{1n} \\ b_2 & a_{21} & a_{23} & \cdots & a_{2n} \\ \vdots & \vdots & \vdots & & \vdots \\ b_n & a_{n1} & a_{n3} &  \cdots & a_{nn} \end{array} \right|}{\left| \begin{array}{cccc} a_{12} & a_{11} & a_{13} & \cdots & a_{1n} \\ a_{22} & a_{21} & a_{23} & \cdots & a_{2n} \\ \vdots & \vdots & \vdots & & \vdots \\ a_{n2} & a_{n1} & a_{n3} &  \cdots & a_{nn} \end{array} \right|}. $$
而根據歸納假設2,有
$$ \begin{eqnarray*} x_2 &=& \frac{\left| \begin{array}{ccccc} b_1 & a_{11} & a_{13} & \cdots & a_{1n} \\b_2 & a_{21} & a_{23} & \cdots & a_{2n} \\ \vdots & \vdots & \vdots & & \vdots \\ b_n & a_{n1} & a_{n3} &  \cdots & a_{nn} \end{array} \right|}{\left| \begin{array}{cccc} a_{12} & a_{11} & a_{13} & \cdots & a_{1n} \\a_{22} & a_{21} & a_{23} & \cdots & a_{2n} \\ \vdots & \vdots & \vdots & & \vdots \\ a_{n2} & a_{n1} & a_{n3} &  \cdots & a_{nn} \end{array} \right|} = \frac{-\left| \begin{array}{ccccc} a_{11} & b_1 & a_{13} & \cdots & a_{1n} \\ a_{21} & b_2 & a_{23} & \cdots & a_{2n} \\ \vdots & \vdots & \vdots & & \vdots \\ a_{n1} & b_n & a_{n3} &  \cdots & a_{nn} \end{array} \right|}{-\left| \begin{array}{cccc} a_{11} & a_{12} & a_{13} & \cdots & a_{1n} \\a_{21} & a_{22} & a_{23} & \cdots & a_{2n} \\ \vdots & \vdots & \vdots & & \vdots \\ a_{n1} & a_{n2} & a_{n3} &  \cdots & a_{nn} \end{array} \right|} = \frac{\left| \begin{array}{ccccc} a_{11} & b_1 & a_{13} & \cdots & a_{1n} \\ a_{21} & b_2 & a_{23} & \cdots & a_{2n} \\ \vdots & \vdots & \vdots & & \vdots \\ a_{n1} & b_n & a_{n3} &  \cdots & a_{nn} \end{array} \right|}{\left| \begin{array}{cccc} a_{11} & a_{12} & a_{13} & \cdots & a_{1n} \\a_{21} & a_{22} & a_{23} & \cdots & a_{2n} \\ \vdots & \vdots & \vdots & & \vdots \\ a_{n1} & a_{n2} & a_{n3} &  \cdots & a_{nn} \end{array} \right|} \\ &=& \frac{det(A_1, b, A_3, \cdots, A_n)}{det(A)}. \end{eqnarray*} $$
其餘$x_3, \cdots, x_n$的討論亦類似,得
$$ x_3 = \frac{det(A_1, A_2, b, A_4, \cdots, A_n)}{det(A)}, \cdots, x_n = \frac{det(A_1, \cdots, A_{n-1}, b)}{det(A)}. $$

結論:
  1. $n$階行列式是靠$n-1$階行列式的線性組合所定義出來的:
    $$ \begin{eqnarray*} D^{(n)} &=& \left| \begin{array}{cccc} d_{11} & d_{12} & \cdots & d_{1n} \\ d_{21} & d_{22} & \cdots & d_{2n} \\ \vdots & \vdots & & \vdots \\ d_{n1} & d_{n2} & \cdots & d_{nn} \\  \end{array} \right| \\  &=& d_{11} (-1)^{1 + 1} \left| \begin{array}{ccc} d_{22} & \cdots & d_{2n} \\ \vdots & & \vdots \\ d_{n2} & \cdots & d_{nn} \\ \end{array} \right| + d_{12} (-1)^{1+2} \left| \begin{array}{cccc} d_{21} & d_{23} & \cdots & d_{2n} \\ \vdots & & \vdots \\ d_{n1} & d_{n3} & \cdots & d_{nn} \\ \end{array} \right| + \cdots + d_{1n} (-1)^{1 + n}\left| \begin{array}{ccc} d_{22} & \cdots & d_{2, n-1} \\ \vdots & & \vdots \\ d_{n2} & \cdots & d_{n, n-1} \\ \end{array} \right|. \end{eqnarray*} $$
  2. Cramer公式:對於非奇異的$n$階線性方程組
    $$ \left\{ \begin{eqnarray*} a_{11}x_1 + a_{12}x_2 + \cdots + a_{1n}x_n &=& b_1 \\ a_{21}x_1 + a_{22}x_2 + \cdots + a_{2n}x_n &=& b_2 \\ \vdots&& \\ a_{n1}x_1 + a_{n2}x_2 + \cdots + a_{nn}x_n &=& b_n \end{eqnarray*} \right. , $$
    其解為
    $$ x_i = \frac{det(\cdots, A_{i-1}, b, A_{i+1}, \cdots)}{det(A)}. $$
  

參考文獻


[1] 朱富海,问题引导的代数学: 行列式的多样性,知乎專欄《數林廣記》

(最後更新:2020/06/05)

2020年5月13日 星期三

2020-05-10,統計量構成等差數列的問題

我的可愛家教學生育嫆問了我一道統計的題目,披著統計的外殼考數列,我一時沒有分析出來,回家後想了一會兒才理清頭緒。

先說我的評論是,這種題目對於理解統計思想沒有任何幫助,非常無聊

儘管無趣,但我們還是想辦法解開。抱怨歸抱怨,問題來了還是得面對。

==問題==

已知7筆數據:2, 5, 2, 4, 10, 2, x,如果此7筆數據的算術平均數、中位數與眾數3個統計量按照由小而大的順序排列起來恰好形成一個公差大於0的等差數列,那麼所有可能的x值其總和為何?

==解答==

首先,最重要的一步是將數據排序:2, 2, 2, 4, 5, 10, x。其中x放在最後並不意味著x是最大的,或是$x \ge 10$,僅僅是因為x未知大小,索性就丟在最後頭。

注意到在數據中,2一共出現了3次,這表示說,無論x取什麼值,在這7筆數據中,2永遠是出現最多次的數據,因此我們可以斷定眾數Mo=2

題設條件稱「算術平均數、中位數與眾數3個統計量按照由小而大的順序排列起來恰好形成一個公差大於0的等差數列」意味著3個統計量必然是完全相異的!

因為一共有7筆資料,所以中位數Me是由小而大的第4筆數據

平均數$\mu = \frac{1}{7} \left( 2 + 2 + 2 + 4 + 5 + 10 + x \right) = \frac{x + 25}{7}$。

如果$x \le 2$,則數據排序後必形如:x, 2, 2, 2, 4, 5, 10 ($x < 2$時)或2, 2, 2, 2, 4, 5, 10 ($x = 2$時)。無論是哪個情況,此時第4筆數據都是2,也就是說中位數Me=2,但這樣中位數與眾數就相等了,與題設條件矛盾。因此我們可推論$x > 2$。

如果$2 < x < 4$,則數據排序後必形如:2, 2, 2, x, 4, 5, 10。此時Me=x<4,而$\mu = \frac{x + 25}{7} > \frac{2 + 25}{7} = 3\frac{6}{7}$。此時無法直接判斷Me=x與$\mu$的大小關係。但我們仍然可以分情況討論。無論如何,眾數Mo=2都是最小的。於是Mo, Me, $\mu$三者的大小關係可能是$2 < x < \frac{x + 25}{7}$或$2 < \frac{x + 25}{7} < x$。

若為$2 < x < \frac{x + 25}{7}$,則得到$x - 2 = \frac{x + 25}{7} - x$,解得$x = 3$。

若為$2 < \frac{x + 25}{7} < x$,則得到$x = \frac{36}{5} = 7.2$,不在x的範圍內,不合。

所以當$x$介於2與4之間時,合乎題目條件的值僅有$x = 3$。

如果$x \ge 4$,則數據排序後,前4筆數據必為2, 2, 2, 4,所以中位數Me=4,而$\mu = \frac{x + 25}{7} \ge \frac{4 + 25}{7} = 4 \frac{1}{7} > 4$,所以得到Mo < Me < $\mu$。那麼公差就是$4 - 2 = 2$,因此$\mu = 4 + 2 = 6$,於是$\frac{x + 25}{7} = 6$,解得$x = 17$。

我們已經對x的所有情況都討論分析過了,因此可能的x僅有3或17,故總和為20。

==附記==

本文完稿之時,其中平均數$\mu$有誤算,經朋友許淵智老師確核答案後,始得修正。特此註記致謝。