Academic
  • Introduction
  • Artificial Intelligence
    • Introduction
    • AI Concepts, Terminology, and Application Areas
    • AI: Issues, Concerns and Ethical Considerations
  • Biology
    • Scientific Method
    • Chemistry of Life
    • Water, Acids, Bases
    • Properties of carbon
    • Macromolecules
    • Energy and Enzymes
    • Structure of a cell
    • Membranes and transport
    • Cellular respiration
    • Cell Signaling
    • Cell Division
    • Classical and molecular genetics
    • DNA as the genetic material
    • Central dogma
    • Gene regulation
  • Bioinformatics
    • Bioinformatics Overview
  • Deep Learning
    • Neural Networks and Deep Learning
      • Introduction
      • Logistic Regression as a Neural Network
      • Python and Vectorization
      • Shallow Neural Network
      • Deep Neural Network
    • Improving Deep Neural Networks
      • Setting up your Machine Learning Application
      • Regularizing your Neural Network
      • Setting up your Optimization Problem
      • Optimization algorithms
      • Hyperparameter, Batch Normalization, Softmax
    • Structuring Machine Learning Projects
    • Convolutional Neural Networks
      • Introduction
    • Sequence Models
      • Recurrent Neural Networks
      • Natural Language Processing & Word Embeddings
      • Sequence models & Attention mechanism
  • Linear Algebra
    • Vectors and Spaces
      • Vectors
      • Linear combinations and spans
      • Linear dependence and independence
      • Subspaces and the basis for a subspace
      • Vector dot and cross products
      • Matrices for solving systems by elimination
      • Null space and column space
    • Matrix transformations
      • Functions and linear transformations
      • Linear transformation examples
      • Transformations and matrix multiplication
      • Inverse functions and transformations
      • Finding inverses and determinants
      • More Determinant Depth
  • Machine Learning
    • Introduction
    • Linear Regression
      • Model and Cost Function
      • Parameter Learning
      • Multivariate Linear Regression
      • Computing Parameters Analytically
      • Octave
    • Logistic Regression
      • Classification and Representation
      • Logistic Regression Model
    • Regularization
      • Solving the Problem of Overfitting
    • Neural Networks
      • Introduction of Neural Networks
      • Neural Networks - Learning
    • Improve Learning Algorithm
      • Advice for Applying Machine Learning
      • Machine Learning System Design
    • Support Vector Machine
      • Large Margin Classification
      • Kernels
      • SVM in Practice
  • NCKU - Artificial Intelligence
    • Introduction
    • Intelligent Agents
    • Solving Problems by Searching
    • Beyond Classical Search
    • Learning from Examples
  • NCKU - Computer Architecture
    • First Week
  • NCKU - Data Mining
    • Introduction
    • Association Analysis
    • FP-growth
    • Other Association Rules
    • Sequence Pattern
    • Classification
    • Evaluation
    • Clustering
    • Link Analysis
  • NCKU - Machine Learning
    • Probability
    • Inference
    • Bayesian Inference
    • Introduction
  • NCKU - Robotic Navigation and Exploration
    • Kinetic Model & Vehicle Control
    • Motion Planning
    • SLAM Back-end (I)
    • SLAM Back-end (II)
    • Computer Vision / Multi-view Geometry
    • Lie group & Lie algebra
    • SLAM Front-end
  • Python
    • Numpy
    • Pandas
    • Scikit-learn
      • Introduction
      • Statistic Learning
  • Statstics
    • Quantitative Data
    • Modeling Data Distribution
    • Bivariate Numerical Data
    • Probability
    • Random Variables
    • Sampling Distribution
    • Confidence Intervals
    • Significance tests
Powered by GitBook
On this page
  • Determinant when row multiplied by scalar
  • Determinant when row is added
  • Duplicate row determinant
  • Determinant after row operations

Was this helpful?

  1. Linear Algebra
  2. Matrix transformations

More Determinant Depth

PreviousFinding inverses and determinantsNextMachine Learning

Last updated 5 years ago

Was this helpful?

Determinant when row multiplied by scalar

我們將矩陣某一列全部乘以 k 會發生什麼事呢

∣abkckd∣=kad−kbc=k(ad−bc)=k∣abcd∣\left\lvert\begin{matrix} a&b\\kc&kd \end{matrix}\right\rvert = kad - kbc = k(ad-bc) = k\left\lvert\begin{matrix} a&b\\c&d \end{matrix}\right\rvert​akc​bkd​​=kad−kbc=k(ad−bc)=k​ac​bd​​

新的 determinant 會等於原本的 determinant 乘上 k

那如果兩列都乘以 k 會怎麼樣呢

∣kakbkckd∣=k2(ad)−k2(bc)=k2(ad−bc)=k2∣abcd∣\left\lvert\begin{matrix} ka&kb\\kc&kd \end{matrix}\right\rvert = k^2(ad)-k^2(bc) = k^2(ad-bc) = k^2\left\lvert\begin{matrix} a&b\\c&d \end{matrix}\right\rvert​kakc​kbkd​​=k2(ad)−k2(bc)=k2(ad−bc)=k2​ac​bd​​

會變成 k 的 2 次方 ( 2 列 ) 再乘以 determinant

假設今天有一個 3 × 3 矩陣 A

A=[abcdefghi]\mathbf{A} = \begin{bmatrix} a&b&c\\d&e&f\\g&h&i\end{bmatrix}A=​adg​beh​cfi​​

我們從他的第二列展開 determinant 會得到

現在我們將第二列元素都乘上 k 得到 A', A' 的 determinant 會等於

我們試著將他 generalize 成 n × n 矩陣

假設我們從第 i 列展開,可以得到

現在第 i 列全部乘以 k 了,新的 A' 的 determinant 等於

現在我們可以確定,當你對 matrix 的 n row 執行 multiplication by k

你的 determinant 就必須要乘以 k 的 n 次方

Determinant when row is added

什麼時候 determinant 會等於另外兩個 matrix 的 determinant 的相加呢

看起來是只有某一列不同,其他列完全相同的時候,他們的 determinant 才會有所關聯

我們換成 n × n 矩陣觀察

各別求出他們的 determinants

我們得知此時

但我們要注意,只有在這個非常特殊的情況下 (所有元素相同,單獨一列不同) 才會發生

一般的相加是不會讓 determinant 也相加的 !

Duplicate row determinant

我們先了解,當 matrix 交換任意兩列時,新產生的 matrix 的 determinant 將加上負號

現在我們來看當 matrix 擁有相同兩列時會發生什麼

我們先用 Row vector 的方式來呈現整個 matrix

接著我們將 matrix A 的第 i 列和第 j 列互換,得到了 matrix S

此時,S 的 determinant 應該為 A 的 determinant 加上負號

但我們想知道,若 i 和 j 列的元素是完全一樣的話會發生什麼

兩列一樣,那代表交換後, S 還是等於 A 矩陣,determinant 應該要一模一樣才對

但我們又不能違背交換兩列要加上負號的規則

所以 S determinant 等於 A determinant 又等於負的 A determinant

什麼時候才會滿足負正相等,只有 0 的時候

我們可以統整一下

Determinant after row operations

接著來看一下,若把某一個 row 加上另一個 row 乘以任意 scalar 的結果

也就是執行完一次 row operation 後,determinant 會有所改變嗎 ?

像在簡化至 rref 時,將任一列乘以 c 加到另一列來做消除的動作,我們稱之為 row operation

我們假設 A 把第 j 列減掉 c 乘上第 i 列得到 B

這時候 B 的 determinant 等於

這是根據我們學過的 Determinant when row is added

然後我們又可以將第二個的 -c 拆出來

結果得到兩個 row 相同,兩個 row 相同意味著 det = 0

所以,當 matrix 做了任意的 row operation 時,他的 determinant 是不變的 !

∣A∣=−d∣bchi∣+e∣acgi∣−f∣abgh∣\lvert \mathbf{A} \rvert = - d\left\lvert\begin{matrix} b&c\\h&i \end{matrix}\right\rvert +e\left\lvert\begin{matrix} a&c\\g&i \end{matrix}\right\rvert -f\left\lvert\begin{matrix} a&b \\ g&h\end{matrix}\right\rvert∣A∣=−d​bh​ci​​+e​ag​ci​​−f​ag​bh​​
∣A′∣=−kd∣bchi∣+ke∣acgi∣−kf∣abgh∣=k(−d∣bchi∣+e∣acgi∣−f∣abgh∣)=k∣A∣\begin{aligned} \lvert \mathbf{A'} \rvert &= -kd\left\lvert\begin{matrix} b&c\\h&i \end{matrix}\right\rvert +ke\left\lvert\begin{matrix} a&c\\g&i \end{matrix}\right\rvert -kf\left\lvert\begin{matrix} a&b \\ g&h\end{matrix}\right\rvert \\ &=k\left(-d\left\lvert\begin{matrix} b&c\\h&i \end{matrix}\right\rvert +e\left\lvert\begin{matrix} a&c\\g&i \end{matrix}\right\rvert -f\left\lvert\begin{matrix} a&b \\ g&h\end{matrix}\right\rvert\right) \\ &= k \lvert \mathbf{A}\rvert \end{aligned}∣A′∣​=−kd​bh​ci​​+ke​ag​ci​​−kf​ag​bh​​=k(−d​bh​ci​​+e​ag​ci​​−f​ag​bh​​)=k∣A∣​
An×n=[a11a12⋯a1n⋮ai1ai2⋯ain⋮an1an2⋯ann]\mathbf{A}_{n\times n} = \begin{bmatrix} a_{11} & a_{12} & \cdots &a_{1n}\\ \vdots\\ \color{red}{a_{i1}} & \color{red}{a_{i2}} & \cdots &\color{red}{a_{in}}\\ \vdots\\ a_{n1} & a_{n2} & \cdots &a_{nn} \end{bmatrix}An×n​=​a11​⋮ai1​⋮an1​​a12​ai2​an2​​⋯⋯⋯​a1n​ain​ann​​​
det⁡(A)=(−1)i+1ai1det⁡(Ai1)+(−1)i+2ai2det⁡(Ai2)+⋯+(−1)i+naindet⁡(Ain)=∑j=1j=n((−1)i+jaijdet⁡(Aij)\begin{aligned} \det(\mathbf{A}) &= (-1)^{i+1}a_{i1}\det(\mathbf{A}_{i1}) + (-1)^{i+2}a_{i2}\det(\mathbf{A}_{i2}) + \cdots + (-1)^{i+n}a_{in}\det(\mathbf{A}_{in}) \\ &= \sum_{j=1}^{j=n}\left((-1)^{i+j}a_{ij}\det(\mathbf{A}_{ij}\right) \end{aligned}det(A)​=(−1)i+1ai1​det(Ai1​)+(−1)i+2ai2​det(Ai2​)+⋯+(−1)i+nain​det(Ain​)=j=1∑j=n​((−1)i+jaij​det(Aij​)​
det⁡(A′)=(−1)i+1kai1det⁡(Ai1)+(−1)i+2kai2det⁡(Ai2)+⋯+(−1)i+nkaindet⁡(Ain)=∑j=1j=n((−1)i+jkaijdet⁡(Aij)=k∑j=1j=n((−1)i+jaijdet⁡(Aij)=kdet⁡(A)\begin{aligned} \det(\mathbf{A'}) &= (-1)^{i+1}\color{red}{k}a_{i1}\det(\mathbf{A}_{i1}) + (-1)^{i+2}\color{red}{k}a_{i2}\det(\mathbf{A}_{i2}) + \cdots + (-1)^{i+n}\color{red}{k}a_{in}\det(\mathbf{A}_{in}) \\ &= \sum_{j=1}^{j=n}\left((-1)^{i+j}\color{red}{k}a_{ij}\det(\mathbf{A}_{ij}\right) \\ &= \color{red}{k}\sum_{j=1}^{j=n}\left((-1)^{i+j}a_{ij}\det(\mathbf{A}_{ij}\right) \\ &= \color{red}{k}\det(\mathbf{A}) \end{aligned}det(A′)​=(−1)i+1kai1​det(Ai1​)+(−1)i+2kai2​det(Ai2​)+⋯+(−1)i+nkain​det(Ain​)=j=1∑j=n​((−1)i+jkaij​det(Aij​)=kj=1∑j=n​((−1)i+jaij​det(Aij​)=kdet(A)​
det⁡(kA)=kndet⁡(A)\det(k\mathbf{A}) = k^n\det(\mathbf{A})det(kA)=kndet(A)

X=[abx1x2],Y=[aby1y2],Z=[abx1+y1x2+y2]\mathbf{X} = \begin{bmatrix} a &b \\x_1&x_2\end{bmatrix}, \mathbf{Y} = \begin{bmatrix} a &b \\y_1&y_2\end{bmatrix}, \mathbf{Z} = \begin{bmatrix} a &b \\x_1+y_1&x_2+y_2\end{bmatrix}X=[ax1​​bx2​​],Y=[ay1​​by2​​],Z=[ax1​+y1​​bx2​+y2​​]
det⁡(X)=ax2−bx1det⁡(Y)=ay2−by1det⁡(Z)=a(x2+y2)−b(x1+y1)=ax2+ay2−bx1−by1=(ax2−bx1)+(ay2−by1)=det⁡(X)+det⁡(Y)\begin{aligned} \det(\mathbf{X}) &= ax_2-bx_1 \\ \det(\mathbf{Y}) &= ay_2-by_1 \\ \det(\mathbf{Z}) &= a(x_2+y_2)-b(x_1+y_1) \\ &=ax_2+ay_2-bx_1-by_1 \\ &= (ax_2-bx_1)+(ay_2-by_1)\\ &= \det(\mathbf{X}) + \det(\mathbf{Y}) \end{aligned}det(X)det(Y)det(Z)​=ax2​−bx1​=ay2​−by1​=a(x2​+y2​)−b(x1​+y1​)=ax2​+ay2​−bx1​−by1​=(ax2​−bx1​)+(ay2​−by1​)=det(X)+det(Y)​
X=[a11a12⋯a1n⋮x1x2⋯xn⋮an1an2⋯ann],Y=[a11a12⋯a1n⋮y1y2⋯yn⋮an1an2⋯ann],Z=[a11a12⋯a1n⋮x1+y1x2+y2⋯xn+yn⋮an1an2⋯ann]\mathbf{X} = \begin{bmatrix} a_{11} &a_{12} & \cdots & a_{1n}\\ \vdots \\ x_1&x_2&\cdots&x_n\\ \vdots\\ a_{n1} &a_{n2} &\cdots& a_{nn} \end{bmatrix}, \mathbf{Y} = \begin{bmatrix} a_{11} &a_{12} & \cdots & a_{1n}\\ \vdots \\ y_1&y_2&\cdots&y_n\\ \vdots\\ a_{n1} &a_{n2} &\cdots& a_{nn} \end{bmatrix}, \mathbf{Z} = \begin{bmatrix} a_{11} &a_{12} & \cdots & a_{1n}\\ \vdots \\ x_1+y_1&x_2+y_2&\cdots&x_n +y_n \\ \vdots\\ a_{n1} &a_{n2} &\cdots& a_{nn} \end{bmatrix}X=​a11​⋮x1​⋮an1​​a12​x2​an2​​⋯⋯⋯​a1n​xn​ann​​​,Y=​a11​⋮y1​⋮an1​​a12​y2​an2​​⋯⋯⋯​a1n​yn​ann​​​,Z=​a11​⋮x1​+y1​⋮an1​​a12​x2​+y2​an2​​⋯⋯⋯​a1n​xn​+yn​ann​​​
det⁡(X)=∑j=1n(−1)i+jxjdet⁡(Aij)det⁡(Y)=∑j=1n(−1)i+jyjdet⁡(Aij)det⁡(Z)=∑j=1n(−1)i+j(xj+yj)det⁡(Aij)\begin{aligned} \det(\mathbf{X}) = \sum_{j=1}^n(-1)^{i+j}x_j\det(\mathbf{A}_{ij}) \\ \det(\mathbf{Y}) = \sum_{j=1}^n(-1)^{i+j}y_j\det(\mathbf{A}_{ij}) \\ \det(\mathbf{Z}) = \sum_{j=1}^n(-1)^{i+j}(x_j +y_j)\det(\mathbf{A}_{ij}) \end{aligned}det(X)=j=1∑n​(−1)i+jxj​det(Aij​)det(Y)=j=1∑n​(−1)i+jyj​det(Aij​)det(Z)=j=1∑n​(−1)i+j(xj​+yj​)det(Aij​)​
det⁡(X)+det⁡(Y)=det⁡(Z)\det(\mathbf{X}) + \det(\mathbf{Y}) = \det(\mathbf{Z})det(X)+det(Y)=det(Z)
Z=X+Y⇏det⁡(Z)=det⁡(X)+det⁡(Y)\mathbf{Z} = \mathbf{X} +\mathbf{Y} \not \Rightarrow \det(\mathbf{Z}) = \det(\mathbf{X}) + \det(\mathbf{Y})Z=X+Y⇒det(Z)=det(X)+det(Y)

A=[abcd],det⁡(A)=xA′=[cdab],det⁡(A′)=−x\begin{aligned} \mathbf{A} &= \begin{bmatrix} a&b\\c&d\end{bmatrix}, \det(\mathbf{A}) = x \\ \mathbf{A'} &= \begin{bmatrix} c&d\\a&b\end{bmatrix}, \det(\mathbf{A'}) = -x \\ \end{aligned}AA′​=[ac​bd​],det(A)=x=[ca​db​],det(A′)=−x​
A=[r1⃗r2⃗⋮ri⃗rj⃗⋮rn⃗],where ri⃗=[ai1ai2⋯ain]\mathbf{A} = \begin{bmatrix} \vec{r_1}\\ \vec{r_2}\\\vdots \\ \vec{r_i} \\ \vec{r_j}\\\vdots\\\vec{r_n}\end{bmatrix}, \text{where } \vec{r_i} = \begin{bmatrix} a_{i1} & a_{i2}&\cdots&a_{in} \end{bmatrix}A=​r1​​r2​​⋮ri​​rj​​⋮rn​​​​,where ri​​=[ai1​​ai2​​⋯​ain​​]
S=[r1⃗r2⃗⋮rj⃗ri⃗⋮rn⃗]\mathbf{S} = \begin{bmatrix} \vec{r_1}\\ \vec{r_2}\\\vdots \\ \vec{r_j} \\\vec{r_i}\\\vdots\\\vec{r_n}\end{bmatrix}S=​r1​​r2​​⋮rj​​ri​​⋮rn​​​​
det⁡(S)=−det⁡(A)\det(\mathbf{S}) = -\det(\mathbf{A})det(S)=−det(A)
if row i=row jS=A⇒det⁡(S)=det⁡(A)=−det⁡(A)\begin{aligned} &\text{if row }i = \text{row }j \\ & \mathbf{S} = \mathbf{A} \Rightarrow \det(\mathbf{S}) = \det(\mathbf{A}) = -\det(\mathbf{A}) \end{aligned}​if row i=row jS=A⇒det(S)=det(A)=−det(A)​
A has Duplicate Rows⇒det⁡(A)=0\mathbf{A} \text{ has Duplicate Rows} \Rightarrow \det(\mathbf{A}) = 0A has Duplicate Rows⇒det(A)=0
matrix invertible  ⟺  rref is Induplicate rows ⇒never get rref to In⇒not invertible⇒det⁡=0\text{matrix invertible} \iff \text{rref is } \mathbf{I_n} \\ \begin{aligned} \text{duplicate rows }&\Rightarrow \text{never get rref to } \mathbf{I_n} \\ &\Rightarrow \text{not invertible} \\ &\Rightarrow \det = 0 \end{aligned}matrix invertible⟺rref is In​duplicate rows ​⇒never get rref to In​⇒not invertible⇒det=0​

A=[r1⃗r2⃗⋮ri⃗rj⃗⋮rn⃗],B=[r1⃗r2⃗⋮ri⃗rj⃗−cri⃗⋮rn⃗]\mathbf{A} = \begin{bmatrix} \vec{r_1}\\ \vec{r_2}\\\vdots \\ \vec{r_i} \\\vec{r_j}\\\vdots\\\vec{r_n}\end{bmatrix}, \mathbf{B} = \begin{bmatrix} \vec{r_1}\\ \vec{r_2}\\\vdots \\ \vec{r_i} \\\vec{r_j} - c\vec{r_i}\\\vdots\\\vec{r_n}\end{bmatrix}A=​r1​​r2​​⋮ri​​rj​​⋮rn​​​​,B=​r1​​r2​​⋮ri​​rj​​−cri​​⋮rn​​​​
det⁡(B)=det⁡([r1⃗r2⃗⋮ri⃗rj⃗⋮rn⃗])+det⁡([r1⃗r2⃗⋮ri⃗−cri⃗⋮rn⃗])\det(\mathbf{B}) = \det\left(\begin{bmatrix} \vec{r_1}\\ \vec{r_2}\\\vdots \\ \vec{r_i} \\\vec{r_j}\\\vdots\\\vec{r_n}\end{bmatrix}\right) + \det\left(\begin{bmatrix} \vec{r_1}\\ \vec{r_2}\\\vdots \\ \vec{r_i} \\ - c\vec{r_i}\\\vdots\\\vec{r_n}\end{bmatrix}\right)det(B)=det​​r1​​r2​​⋮ri​​rj​​⋮rn​​​​​+det​​r1​​r2​​⋮ri​​−cri​​⋮rn​​​​​
det⁡(B)=det⁡([r1⃗r2⃗⋮ri⃗rj⃗⋮rn⃗])−cdet⁡([r1⃗r2⃗⋮ri⃗ri⃗⋮rn⃗])\det(\mathbf{B}) = \det\left(\begin{bmatrix} \vec{r_1}\\ \vec{r_2}\\\vdots \\ \vec{r_i} \\\vec{r_j}\\\vdots\\\vec{r_n}\end{bmatrix}\right) - c \det\left(\begin{bmatrix} \vec{r_1}\\ \vec{r_2}\\\vdots \\ \vec{r_i} \\\vec{r_i}\\\vdots\\\vec{r_n}\end{bmatrix}\right)det(B)=det​​r1​​r2​​⋮ri​​rj​​⋮rn​​​​​−cdet​​r1​​r2​​⋮ri​​ri​​⋮rn​​​​​
det⁡(B)=det⁡([r1⃗r2⃗⋮ri⃗rj⃗⋮rn⃗])−0=det⁡(A)\begin{aligned} \det(\mathbf{B}) &= \det\left(\begin{bmatrix} \vec{r_1}\\ \vec{r_2}\\\vdots \\ \vec{r_i} \\\vec{r_j}\\\vdots\\\vec{r_n}\end{bmatrix}\right) - 0\\ &= \det(\mathbf{A}) \end{aligned}det(B)​=det​​r1​​r2​​⋮ri​​rj​​⋮rn​​​​​−0=det(A)​
https://youtu.be/VrB3LaSD_uo
https://youtu.be/gYv8sttBIqs
https://youtu.be/kpG7xySkivg
https://youtu.be/32rdijPB-rA