Skip to main content

第一讲 方程组的几何解释(The Geometry of Linear Equations)

线性代数的一个主要应用是求解线性方程组。本讲座介绍了解这些方程组的三种思路。"行法"侧重于单个方程,"列法 "侧重于合并各列,而 "矩阵法 "则是描述线性方程组的一种更简洁、更强大的方法。

A major application of linear algebra is to solving systems of linear equations. This lecture presents three ways of thinking about these systems. The “row method” focuses on the individual equations, the “column method” focuses on combining the columns, and the “matrix method” is an even more compact and powerful way of describing systems of linear equations.

课本:《Introduction to Linear Algebra》

课程地址:http://web.mit.edu/18.06

视频中给出的地址已无法正常打开,地址更改为:https://ocw.mit.edu/courses/18-06sc-linear-algebra-fall-2011/

建议阅读章节

  • 1.1 Vectors and Linear Combinations
  • 1.2 Lengths and Dot Products
  • 2.1 Vectors and Linear Equations

行图(Row Picture)

先从一个例子开始,两个方程(equations),两个未知数(unknowns)

{2xy=0x+2y=3\begin{cases} 2x - y & = 0 \\ -x + 2y & = 3 \end{cases}

现在马上我们就有矩阵的概念了

[2112][xy]=[03]系数矩阵A未知数向量x值向量b\begin{matrix} \begin{bmatrix} 2 & -1\\ -1 & 2 \end{bmatrix} & \begin{bmatrix} x\\ y \end{bmatrix} &=& \begin{bmatrix} 0\\ 3 \end{bmatrix} \\ \text{系数矩阵$A$} & \text{未知数向量}\boldsymbol{x} &&\text{值向量$\boldsymbol{b}$} \end{matrix}

这个例子的行图是怎样的呢?

首先做出满足 2xy=02x-y=0 所有的点。

  1. y=0y=0时,有x=0x=0,点(0,0)(0,0)即原点(origin)位于图像上。
  2. x=1x=1时,有y=2y=2,即点(1,2)(1,2)位于图像上。

我们还可以找出更多的点,但是两个点就足够了(两点可以确定一条直线)。因为其他的点也都在这条直线上。这就是线性方程,“线性”就是直线的意思

这条直线就是方程2xy=02x-y=0的解。

是否经过原点非常重要,上面的方程经过原点,而下面这个方程将不经过原点。

对于: x+2y=3-x + 2y = 3

  • y=0y=0,得到x=3x=-3,得到 (3,0)(-3,0)是这条直线的第一个点
  • x=1x=-1,得到y=1y=1,得到第二个点:(1,1)(-1,1)

output.png

函数图像生成代码
import matplotlib.pyplot as plt
import numpy as np

from mpl_toolkits.axisartist.axislines import AxesZero

fig = plt.figure()
ax = fig.add_subplot(axes_class=AxesZero)

for direction in ["xzero", "yzero"]:
# adds arrows at the ends of each axis
ax.axis[direction].set_axisline_style("-|>")

# adds X and Y-axis from the origin
ax.axis[direction].set_visible(True)

for direction in ["left", "right", "bottom", "top"]:
# hides borders
ax.axis[direction].set_visible(False)

ax.set_xlim(-5, 5)
ax.set_ylim(-3, 4)

x = np.linspace(-5, 5., 300)
y1 = 2*x
y2 = (3+x)/2
ax.plot(x, y1)
ax.plot(x, y2)

colors = ['#2e80b9', 'r', '#ff7f0e', '#ff7f0e']
x1 = [0, 1, -3, 0]
y2 = [0, 2, 0, 1.5]

plt.scatter(x1, y2, c=colors)

plt.draw()

两条直线的交点(1,2)(1,2),就是方程组的解。

列图(Column Picture)

注意:列图才是关键(key point)

在列图中,我们将系统中各列的系数转化为向量,从而将线性方程组改写为单个方程:

x[21]+y[12]=[03]x \begin{bmatrix} 2 \\ -1 \end{bmatrix} + y \begin{bmatrix} -1 \\ 2 \end{bmatrix} = \begin{bmatrix} 0 \\ 3 \end{bmatrix}

这称为 线性组合(Linear Combination of The Columns) ,它是贯穿课程始终的基本方法。

关于线性组合的概念,参考《Introduction to Linear Algebra》 1.1 Vectors and Linear Combinations