返回课程

Week 5 - Algebra 代数

MATH1131 - 矩阵基础与线性方程组

矩阵运算、行列式、逆矩阵与线性系统求解

目录

第一部分: 矩阵基础与运算

第二部分: 行列式与逆矩阵

第三部分: 线性方程组的矩阵解法

第四部分: 应用与特殊矩阵

第一部分:矩阵基础与运算

1.1 矩阵的定义与表示

🎯 核心概念

  • 矩阵定义: 矩阵是一个矩形数字阵列,用大写字母表示(如 A, B, C)
  • 矩阵维度: m×n 矩阵有 m 行和 n 列
  • 元素表示: $a_{ij}$ 表示第 i 行第 j 列的元素
  • 矩阵记法: $A = [a_{ij}]_{m×n}$

📚 例子

一个 3×2 矩阵:

$$A = \begin{bmatrix} 1 & 2 \\ 3 & 4 \\ 5 & 6 \end{bmatrix}$$

其中 $a_{11} = 1$, $a_{12} = 2$, $a_{21} = 3$, 等等。

1.2 矩阵加法与标量乘法

🎯 运算规则

  • 矩阵加法: 相同维度的矩阵对应元素相加
  • 标量乘法: 标量与矩阵每个元素相乘
  • 零矩阵: 所有元素为0的矩阵,记作 $O$ 或 $0$

📋 运算步骤

矩阵加法: $(A + B)_{ij} = a_{ij} + b_{ij}$

标量乘法: $(kA)_{ij} = k \cdot a_{ij}$

1.3 矩阵乘法

🎯 乘法条件

  • 可乘条件: A 的列数必须等于 B 的行数
  • 结果维度: 若 A 是 m×n,B 是 n×p,则 AB 是 m×p
  • 非交换性: 一般情况下,AB ≠ BA

📋 计算方法

乘积元素公式:

$$(AB)_{ij} = \sum_{k=1}^{n} a_{ik}b_{kj}$$

即:第 i 行与第 j 列的点积

📚 矩阵乘法例子

给定:

$$A = \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix}, \quad B = \begin{bmatrix} 5 & 6 \\ 7 & 8 \end{bmatrix}$$

计算 AB:

$$AB = \begin{bmatrix} 1×5+2×7 & 1×6+2×8 \\ 3×5+4×7 & 3×6+4×8 \end{bmatrix} = \begin{bmatrix} 19 & 22 \\ 43 & 50 \end{bmatrix}$$

⚠️ 注意事项

  • 矩阵乘法不满足交换律:AB ≠ BA
  • 即使 AB 和 BA 都有定义,它们的维度也可能不同
  • 矩阵乘法满足结合律:(AB)C = A(BC)

第二部分:行列式与逆矩阵

2.1 行列式

🎯 行列式概念

  • 定义: 方阵的行列式是一个标量值,记作 det(A) 或 |A|
  • 几何意义: 2×2 矩阵的行列式表示平行四边形的面积
  • 奇异性: det(A) = 0 当且仅当 A 是奇异矩阵(不可逆)

📋 计算方法

2×2 行列式:

$$\begin{vmatrix} a & b \\ c & d \end{vmatrix} = ad - bc$$

3×3 行列式(按第一行展开):

$$\begin{vmatrix} a & b & c \\ d & e & f \\ g & h & i \end{vmatrix} = a\begin{vmatrix} e & f \\ h & i \end{vmatrix} - b\begin{vmatrix} d & f \\ g & i \end{vmatrix} + c\begin{vmatrix} d & e \\ g & h \end{vmatrix}$$

📚 3×3 行列式计算例子

计算:

$$\begin{vmatrix} 1 & 2 & 3 \\ 0 & 1 & 4 \\ 5 & 6 & 0 \end{vmatrix}$$

解:按第一行展开

$$= 1\begin{vmatrix} 1 & 4 \\ 6 & 0 \end{vmatrix} - 2\begin{vmatrix} 0 & 4 \\ 5 & 0 \end{vmatrix} + 3\begin{vmatrix} 0 & 1 \\ 5 & 6 \end{vmatrix}$$ $$= 1(0-24) - 2(0-20) + 3(0-5)$$ $$= -24 + 40 - 15 = 1$$

2.2 逆矩阵

🎯 逆矩阵定义

  • 定义: 若 $AA^{-1} = A^{-1}A = I$,则 $A^{-1}$ 是 A 的逆矩阵
  • 存在条件: A 可逆当且仅当 det(A) ≠ 0
  • 唯一性: 若存在,逆矩阵是唯一的

📋 2×2 逆矩阵公式

对于矩阵 $A = \begin{bmatrix} a & b \\ c & d \end{bmatrix}$:

$$A^{-1} = \frac{1}{ad-bc}\begin{bmatrix} d & -b \\ -c & a \end{bmatrix}$$

前提:det(A) = ad - bc ≠ 0

📚 逆矩阵计算例子

求矩阵的逆:$A = \begin{bmatrix} 3 & 1 \\ 2 & 4 \end{bmatrix}$

步骤:

  1. 计算行列式:det(A) = 3×4 - 1×2 = 10
  2. 应用公式:$A^{-1} = \frac{1}{10}\begin{bmatrix} 4 & -1 \\ -2 & 3 \end{bmatrix} = \begin{bmatrix} 0.4 & -0.1 \\ -0.2 & 0.3 \end{bmatrix}$

2.3 逆矩阵的性质

🎯 重要性质

  • $(A^{-1})^{-1} = A$
  • $(AB)^{-1} = B^{-1}A^{-1}$ (注意顺序)
  • $(A^T)^{-1} = (A^{-1})^T$
  • $\det(A^{-1}) = \frac{1}{\det(A)}$

第三部分:线性方程组的矩阵解法

3.1 线性方程组的矩阵形式

🎯 矩阵表示

线性方程组可以写成:Ax = b

  • A:系数矩阵
  • x:未知数向量
  • b:常数向量

📚 方程组转矩阵形式

方程组:

$$\begin{cases} 2x + 3y = 7 \\ x - y = 1 \end{cases}$$

矩阵形式:

$$\begin{bmatrix} 2 & 3 \\ 1 & -1 \end{bmatrix}\begin{bmatrix} x \\ y \end{bmatrix} = \begin{bmatrix} 7 \\ 1 \end{bmatrix}$$

3.2 使用逆矩阵求解

📋 求解步骤

  1. 1 写出矩阵方程: Ax = b
  2. 2 检查可逆性: 计算 det(A),确保 ≠ 0
  3. 3 求逆矩阵: 计算 $A^{-1}$
  4. 4 求解: $x = A^{-1}b$

📚 完整求解例子

解方程组:

$$\begin{cases} 3x + y = 11 \\ 2x + 4y = 18 \end{cases}$$

步骤:

  1. 矩阵形式:$\begin{bmatrix} 3 & 1 \\ 2 & 4 \end{bmatrix}\begin{bmatrix} x \\ y \end{bmatrix} = \begin{bmatrix} 11 \\ 18 \end{bmatrix}$
  2. det(A) = 3×4 - 1×2 = 10 ≠ 0,可逆
  3. $A^{-1} = \frac{1}{10}\begin{bmatrix} 4 & -1 \\ -2 & 3 \end{bmatrix}$
  4. $\begin{bmatrix} x \\ y \end{bmatrix} = \frac{1}{10}\begin{bmatrix} 4 & -1 \\ -2 & 3 \end{bmatrix}\begin{bmatrix} 11 \\ 18 \end{bmatrix} = \frac{1}{10}\begin{bmatrix} 26 \\ 32 \end{bmatrix} = \begin{bmatrix} 2.6 \\ 3.2 \end{bmatrix}$

答案: x = 2.6, y = 3.2

3.3 高斯消元法

🎯 增广矩阵方法

  • 增广矩阵: [A|b] 将系数矩阵和常数向量合并
  • 行简化: 使用行运算将矩阵化为行阶梯形
  • 回代: 从最后一行开始求解

📋 行运算规则

  1. 交换两行
  2. 某行乘以非零常数
  3. 某行加上另一行的倍数

第四部分:应用与特殊矩阵

4.1 特殊矩阵类型

🎯 重要矩阵类型

  • 单位矩阵 (I): 主对角线为1,其余为0
  • 对角矩阵: 只有主对角线有非零元素
  • 对称矩阵: $A^T = A$
  • 正交矩阵: $A^T A = AA^T = I$

4.2 矩阵的应用

🎯 几何变换

  • 旋转矩阵: $R(\theta) = \begin{bmatrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{bmatrix}$
  • 缩放矩阵: $S(k) = \begin{bmatrix} k & 0 \\ 0 & k \end{bmatrix}$
  • 反射矩阵: 关于x轴反射:$\begin{bmatrix} 1 & 0 \\ 0 & -1 \end{bmatrix}$

📚 变换组合例子

先旋转45°,再放大2倍:

$$T = S(2) \cdot R(45°) = \begin{bmatrix} 2 & 0 \\ 0 & 2 \end{bmatrix}\begin{bmatrix} \frac{\sqrt{2}}{2} & -\frac{\sqrt{2}}{2} \\ \frac{\sqrt{2}}{2} & \frac{\sqrt{2}}{2} \end{bmatrix}$$ $$= \begin{bmatrix} \sqrt{2} & -\sqrt{2} \\ \sqrt{2} & \sqrt{2} \end{bmatrix}$$

💡 核心要点总结

  • 矩阵运算: 加法满足交换律,乘法一般不满足
  • 行列式: 判断矩阵可逆性的关键指标
  • 逆矩阵: 求解线性方程组的强大工具
  • 几何意义: 矩阵表示线性变换,行列式表示体积缩放
  • 实际应用: 计算机图形学、经济学、工程学等领域

Week 5 - Algebra

MATH1131 - Matrix Fundamentals and Linear Systems

Matrix Operations, Determinants, Inverse Matrices and Linear System Solutions

Part 1: Matrix Basics and Operations

1.1 Matrix Definition and Notation

🎯 Core Concepts

  • Matrix Definition: A matrix is a rectangular array of numbers, denoted by capital letters (A, B, C)
  • Matrix Dimensions: An m×n matrix has m rows and n columns
  • Element Notation: $a_{ij}$ represents the element in row i, column j
  • Matrix Notation: $A = [a_{ij}]_{m×n}$

1.2 Matrix Addition and Scalar Multiplication

🎯 Operation Rules

  • Matrix Addition: Add corresponding elements of same-sized matrices
  • Scalar Multiplication: Multiply each element by the scalar
  • Zero Matrix: Matrix with all elements equal to 0, denoted as O or 0

1.3 Matrix Multiplication

🎯 Multiplication Conditions

  • Compatibility: Number of columns in A must equal number of rows in B
  • Result Dimensions: If A is m×n and B is n×p, then AB is m×p
  • Non-commutativity: Generally, AB ≠ BA

📋 Calculation Method

Product Element Formula:

$$(AB)_{ij} = \sum_{k=1}^{n} a_{ik}b_{kj}$$

i.e., dot product of row i and column j

Part 2: Determinants and Inverse Matrices

2.1 Determinants

🎯 Determinant Concepts

  • Definition: The determinant of a square matrix is a scalar value, denoted as det(A) or |A|
  • Geometric Meaning: For 2×2 matrices, determinant represents area of parallelogram
  • Singularity: det(A) = 0 if and only if A is singular (non-invertible)

2.2 Inverse Matrices

🎯 Inverse Matrix Definition

  • Definition: If $AA^{-1} = A^{-1}A = I$, then $A^{-1}$ is the inverse of A
  • Existence Condition: A is invertible if and only if det(A) ≠ 0
  • Uniqueness: If it exists, the inverse is unique

📋 2×2 Inverse Formula

For matrix $A = \begin{bmatrix} a & b \\ c & d \end{bmatrix}$:

$$A^{-1} = \frac{1}{ad-bc}\begin{bmatrix} d & -b \\ -c & a \end{bmatrix}$$

Provided: det(A) = ad - bc ≠ 0

Part 3: Matrix Solutions to Linear Systems

3.1 Matrix Form of Linear Systems

🎯 Matrix Representation

Linear systems can be written as: Ax = b

  • A: Coefficient matrix
  • x: Variable vector
  • b: Constant vector

3.2 Solution Using Inverse Matrix

📋 Solution Steps

  1. 1 Write matrix equation: Ax = b
  2. 2 Check invertibility: Calculate det(A), ensure ≠ 0
  3. 3 Find inverse: Calculate $A^{-1}$
  4. 4 Solve: $x = A^{-1}b$

Part 4: Applications and Special Matrices

4.1 Special Matrix Types

🎯 Important Matrix Types

  • Identity Matrix (I): 1s on main diagonal, 0s elsewhere
  • Diagonal Matrix: Non-zero elements only on main diagonal
  • Symmetric Matrix: $A^T = A$
  • Orthogonal Matrix: $A^T A = AA^T = I$

4.2 Matrix Applications

🎯 Geometric Transformations

  • Rotation Matrix: $R(\theta) = \begin{bmatrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{bmatrix}$
  • Scaling Matrix: $S(k) = \begin{bmatrix} k & 0 \\ 0 & k \end{bmatrix}$
  • Reflection Matrix: Reflection about x-axis: $\begin{bmatrix} 1 & 0 \\ 0 & -1 \end{bmatrix}$

💡 Key Points Summary

  • Matrix Operations: Addition is commutative, multiplication generally is not
  • Determinants: Key indicator for matrix invertibility
  • Inverse Matrices: Powerful tool for solving linear systems
  • Geometric Meaning: Matrices represent linear transformations, determinants represent volume scaling
  • Practical Applications: Computer graphics, economics, engineering, and more